diff --git a/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java b/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java index 0dc040de38c..3539c22fc2c 100644 --- a/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java +++ b/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java @@ -28,10 +28,7 @@ import java.util.List; /** - *

- * A main class which setups up a classpath and then passes - * execution off to the ActiveMQ Artemis cli main. - *

+ * A main class which setups up a classpath and then passes execution off to the ActiveMQ Artemis cli main. */ public class Artemis { diff --git a/artemis-cdi-client/src/main/java/org/apache/artemis/client/cdi/configuration/ArtemisClientConfiguration.java b/artemis-cdi-client/src/main/java/org/apache/artemis/client/cdi/configuration/ArtemisClientConfiguration.java index 4bd816c39d7..65436c8f5e5 100644 --- a/artemis-cdi-client/src/main/java/org/apache/artemis/client/cdi/configuration/ArtemisClientConfiguration.java +++ b/artemis-cdi-client/src/main/java/org/apache/artemis/client/cdi/configuration/ArtemisClientConfiguration.java @@ -28,12 +28,12 @@ public interface ArtemisClientConfiguration { String REMOTE_CONNECTOR = NettyConnectorFactory.class.getName(); /** - * @return if present, sends a username for the connection + * {@return if present, sends a username for the connection} */ String getUsername(); /** - * @return the password for the connection. If username is set, password must be set + * {@return the password for the connection. If username is set, password must be set} */ String getPassword(); @@ -45,32 +45,32 @@ public interface ArtemisClientConfiguration { String getUrl(); /** - * @return The hostname to connect to + * {@return The hostname to connect to} */ String getHost(); /** - * @return the port number to connect to + * {@return the port number to connect to} */ Integer getPort(); /** - * @return the connector factory to use for connections. + * {@return the connector factory to use for connections} */ String getConnectorFactory(); /** - * @return Whether or not to start the embedded broker + * {@return whether to start the embedded broker} */ boolean startEmbeddedBroker(); /** - * @return whether or not this is an HA connection + * {@return whether this is an HA connection} */ boolean isHa(); /** - * @return whether or not the authentication parameters should be used + * {@return whether the authentication parameters should be used} */ boolean hasAuthentication(); } diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java index 28674b909f3..a68738eda08 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java @@ -62,14 +62,13 @@ /** * Artemis is the main CLI entry point for managing/running a broker. - * - * Want to start or debug a broker from an IDE? This is probably the best class to - * run. Make sure set the -Dartemis.instance=path/to/instance system property. - * You should also use the 'apache-artemis' module for the class path since that - * includes all artemis modules. - * - * Notice that this class should not use any logging as it's part of the bootstrap and using logging here could - * disrupt the order of bootstrapping on certain components (e.g. JMX being started from log4j) + *

+ * Want to start or debug a broker from an IDE? This is probably the best class to run. Make sure set the + * -Dartemis.instance=path/to/instance system property. You should also use the 'apache-artemis' module for the class + * path since that includes all artemis modules. + *

+ * Notice that this class should not use any logging as it's part of the bootstrap and using logging here could disrupt + * the order of bootstrapping on certain components (e.g. JMX being started from log4j) */ @Command(name = "artemis", description = "ActiveMQ Artemis Command Line") public class Artemis implements Runnable { @@ -194,8 +193,7 @@ public static Object execute(boolean inputEnabled, boolean useSystemOut, boolean } /** - * This method is used to validate exception returns. - * Useful on test cases + * This method is used to validate exception returns. Useful on test cases. */ private static Object internalExecute(boolean shellEnabled, File artemisHome, File artemisInstance, File etcFolder, String[] args) throws Exception { return internalExecute(shellEnabled, artemisHome, artemisInstance, etcFolder, args, new ActionContext()); diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java index b20abe1fd51..b475b6e4a95 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java @@ -82,9 +82,11 @@ public void setHomeValues(File brokerHome, File brokerInstance, File etcFolder) @Override public String getBrokerInstance() { if (brokerInstance == null) { - /* We use File URI for locating files. The ARTEMIS_HOME variable is used to determine file paths. For Windows - the ARTEMIS_HOME variable will include back slashes (An invalid file URI character path separator). For this - reason we overwrite the ARTEMIS_HOME variable with backslashes replaced with forward slashes. */ + /* + * We use File URI for locating files. The ARTEMIS_HOME variable is used to determine file paths. For Windows + * the ARTEMIS_HOME variable will include back slashes (An invalid file URI character path separator). For this + * reason we overwrite the ARTEMIS_HOME variable with backslashes replaced with forward slashes. + */ brokerInstance = System.getProperty("artemis.instance"); if (brokerInstance != null) { brokerInstance = brokerInstance.replace("\\", "/"); @@ -188,9 +190,11 @@ public URI getBrokerURIInstance() { @Override public String getBrokerHome() { if (brokerHome == null) { - /* We use File URI for locating files. The ARTEMIS_HOME variable is used to determine file paths. For Windows - the ARTEMIS_HOME variable will include back slashes (An invalid file URI character path separator). For this - reason we overwrite the ARTEMIS_HOME variable with backslashes replaced with forward slashes. */ + /* + * We use File URI for locating files. The ARTEMIS_HOME variable is used to determine file paths. For Windows + * the ARTEMIS_HOME variable will include back slashes (An invalid file URI character path separator). For this + * reason we overwrite the ARTEMIS_HOME variable with backslashes replaced with forward slashes. + */ brokerHome = System.getProperty("artemis.home"); if (brokerHome != null) { brokerHome = brokerHome.replace("\\", "/"); 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 cec5dae03f7..9a6a29a454e 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 @@ -34,7 +34,7 @@ import picocli.CommandLine.Parameters; /** - * Abstract class where we can replace the configuration in various places * + * Abstract class where we can replace the configuration in various places */ public abstract class Configurable extends ActionAbstract { diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java index b600056add4..375d4d803e0 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/InputAbstract.java @@ -28,8 +28,9 @@ public class InputAbstract extends ActionAbstract { private static boolean inputEnabled = false; /** - * Test cases validating or using the CLI cannot deal with inputs, - * so they are generally disabled, however the main method from the CLI will enable it back. */ + * Test cases validating or using the CLI cannot deal with inputs, so they are generally disabled, however the main + * method from the CLI will enable it back. + */ public static void enableInput() { inputEnabled = true; } diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java index a8f56fa7cdf..7eb70011b1b 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java @@ -61,10 +61,8 @@ public class Run extends LockAbstract { private Timer shutdownTimer; /** - * This will disable the System.exit at the end of the server.stop, as that means there are other things - * happening on the same VM. - * - * @param embedded + * This will disable the System.exit at the end of the server.stop, as that means there are other things happening on + * the same VM. */ public static void setEmbedded(boolean embedded) { Run.embedded = true; @@ -164,8 +162,6 @@ public void deActivate() { /** * Add a simple shutdown hook to stop the server. - * - * @param configurationDir */ private void addShutdownHook(File configurationDir) { diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/helper/HelperCreate.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/helper/HelperCreate.java index e118cd22781..3f59777dbb2 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/helper/HelperCreate.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/helper/HelperCreate.java @@ -30,8 +30,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** This is a class simulating what the Artemis Maven Plugin does. - * You may use by creating a new instance, filling the properties, and calling the method create */ +/** + * This is a class simulating what the Artemis Maven Plugin does. You may use by creating a new instance, filling the + * properties, and calling the method create + */ public class HelperCreate extends HelperBase { public HelperCreate(String homeProperty) { @@ -76,9 +78,6 @@ public HelperCreate(File artemisHome) { private boolean failoverOnShutdown = false; - /** - * it will disable auto-tune - */ private boolean noAutoTune = true; private String messageLoadBalancing = "ON_DEMAND"; @@ -384,5 +383,4 @@ private void copyConfigurationFiles(String[] list, } } } - } diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/perf/AsyncJms2ProducerFacade.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/perf/AsyncJms2ProducerFacade.java index 49f5d4c29f3..297a3f9ccde 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/perf/AsyncJms2ProducerFacade.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/perf/AsyncJms2ProducerFacade.java @@ -132,8 +132,8 @@ private void addedPendingSend() { } /** - * if {@code true}, a subsequent {@link #trySend} would return {@link SendAttemptResult#Success}.
- * Otherwise, a subsequent {@link #trySend} would return {@link SendAttemptResult#NotAvailable}. + * If {@code true}, a subsequent {@link #trySend} would return {@link SendAttemptResult#Success}. Otherwise, a + * subsequent {@link #trySend} would return {@link SendAttemptResult#NotAvailable}. */ private boolean isAvailable() { if (maxPending > 0 && pending == maxPending) { diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/perf/PaddingDecimalFormat.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/perf/PaddingDecimalFormat.java index da96323200e..7ade8fbf050 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/perf/PaddingDecimalFormat.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/messages/perf/PaddingDecimalFormat.java @@ -26,8 +26,8 @@ public class PaddingDecimalFormat extends DecimalFormat { private final StringBuilder pad; /** - * Creates a PaddingDecimalFormat using the given pattern and minimum {@code minLength} and the symbols for the default - * locale. + * Creates a PaddingDecimalFormat using the given pattern and minimum {@code minLength} and the symbols for the + * default locale. */ public PaddingDecimalFormat(String pattern, int minLength) { super(pattern); diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java index 055d9bce869..7bc59464f4c 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java @@ -430,16 +430,10 @@ private static class PageCursorsInfo { private PageCursorsInfo() { } - /** - * @return the pgTXs - */ Set getPgTXs() { return pgTXs; } - /** - * @return the cursorRecords - */ Map> getCursorRecords() { return cursorRecords; } diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XMLMessageExporter.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XMLMessageExporter.java index 3f823a5b123..859d271a8f0 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XMLMessageExporter.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XMLMessageExporter.java @@ -31,7 +31,9 @@ import org.apache.activemq.artemis.reader.TextMessageUtil; -/** This is an Utility class that will import the outputs in XML format. */ +/** + * This is an Utility class that will import the outputs in XML format. + */ public class XMLMessageExporter { private static final int LARGE_MESSAGE_CHUNK_SIZE = 1000; 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 8140b7548d6..e4bca3ca6b5 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 @@ -37,7 +37,9 @@ import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; -/** This is an Utility class that will import the outputs in XML format. */ +/** + * This is an Utility class that will import the outputs in XML format. + */ public class XMLMessageImporter { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -236,7 +238,7 @@ private void processMessageBody(final ICoreMessage message, boolean decodeTextMe * to be combined to reconstruct the Base64 encoded string. You can't decode bits and pieces of each CDATA. Each * CDATA has to be decoded in its entirety. * - * @param processor used to deal with the decoded CDATA elements + * @param processor used to deal with the decoded CDATA elements * @param decodeTextMessage If this a text message we decode UTF8 and encode as a simple string */ private void getMessageBodyBytes(MessageBodyBytesProcessor processor, boolean decodeTextMessage) throws IOException, XMLStreamException { @@ -247,7 +249,8 @@ private void getMessageBodyBytes(MessageBodyBytesProcessor processor, boolean de if (currentEventType == XMLStreamConstants.END_ELEMENT) { break; } else if (currentEventType == XMLStreamConstants.CHARACTERS && reader.isWhiteSpace() && !cdata.isEmpty()) { - /* when we hit a whitespace CHARACTERS event we know that the entire CDATA is complete so decode, pass back to + /* + * when we hit a whitespace CHARACTERS event we know that the entire CDATA is complete so decode, pass back to * the processor, and reset the cdata for the next event(s) */ if (decodeTextMessage) { diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataConstants.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataConstants.java index 10b0a665d0e..4f6696c3066 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataConstants.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/xml/XmlDataConstants.java @@ -17,8 +17,8 @@ package org.apache.activemq.artemis.cli.commands.tools.xml; /** - * The constants shared by org.apache.activemq.tools.XmlDataImporter and - * org.apache.activemq.tools.XmlDataExporter. + * The constants shared by {@code org.apache.activemq.tools.XmlDataImporter} and + * {@code org.apache.activemq.tools.XmlDataExporter}. */ public final class XmlDataConstants { 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 66ca7250a8b..3dee30d1178 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 @@ -130,13 +130,6 @@ public Object execute(ActionContext context) throws Exception { /** * Use setConfiguration and process(out) instead. - * - * @param out - * @param bindingsDir - * @param journalDir - * @param pagingDir - * @param largeMessagesDir - * @throws Exception */ @Deprecated public void process(OutputStream out, @@ -409,9 +402,10 @@ private void printSingleMessageAsXML(ICoreMessage message, List queues) exporter.printSingleMessageAsXML(message, queues, false); messagesPrinted++; } + /** - * Reads from the page files and prints messages as it finds them (making sure to check acks and transactions - * from the journal). + * Reads from the page files and prints messages as it finds them (making sure to check acks and transactions from + * the journal). */ private void printPagedMessagesAsXML() { try { @@ -509,7 +503,7 @@ private List extractQueueNames(Mapjavax.xml.stream.XMLStreamWriter doesn't support that. + * Proxy to handle indenting the XML since {@code javax.xml.stream.XMLStreamWriter} doesn't support that. */ public static class PrettyPrintHandler implements InvocationHandler { 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 b21bd59fc0d..2c326e8f4bf 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 @@ -64,9 +64,9 @@ import picocli.CommandLine.Option; /** - * Read XML output from org.apache.activemq.artemis.core.persistence.impl.journal.XmlDataExporter, create a core session, and - * send the messages to a running instance of ActiveMQ Artemis. It uses the StAX javax.xml.stream.XMLStreamReader - * for speed and simplicity. + * Read XML output from {@code org.apache.activemq.artemis.core.persistence.impl.journal.XmlDataExporter}, create a core + * session, and send the messages to a running instance of ActiveMQ Artemis. It uses the StAX + * {@code javax.xml.stream.XMLStreamReader} for speed and simplicity. */ @Command(name = "imp", description = "Import all message-data using an XML that could be interpreted by any system.") public final class XmlDataImporter extends ConnectionConfigurationAbtract { @@ -130,9 +130,9 @@ public void process(String inputFileName, String host, int port) throws Exceptio /** * This is the normal constructor for programmatic access to the - * org.apache.activemq.artemis.core.persistence.impl.journal.XmlDataImporter if the session passed - * in uses auto-commit for sends. - *
+ * {@code org.apache.activemq.artemis.core.persistence.impl.journal.XmlDataImporter} if the session passed in uses + * auto-commit for sends. + *

* If the session needs to be transactional then use the constructor which takes 2 sessions. * * @param inputStream the stream from which to read the XML for import @@ -144,9 +144,9 @@ public void process(InputStream inputStream, ClientSession session) throws Excep /** * This is the constructor to use if you wish to import all messages transactionally. - *
- * Pass in a session which doesn't use auto-commit for sends, and one that does (for management - * operations necessary during import). + *

+ * Pass in a session which doesn't use auto-commit for sends, and one that does (for management operations necessary + * during import). * * @param inputStream the stream from which to read the XML for import * @param session used for sending messages, doesn't need to auto-commit sends @@ -511,6 +511,4 @@ private void bindAddress() throws Exception { logger.debug("Binding {} already exists so won't re-bind.", addressName); } } - - } diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/AddUser.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/AddUser.java index 3f91ef7de82..54a7683e4d4 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/AddUser.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/AddUser.java @@ -23,7 +23,7 @@ /** * Adding a new user, example: - * ./artemis user add --user-command-user guest --role admin --user-command-password *** + * {@literal ./artemis user add --user-command-user guest --role admin --user-command-password ***} */ @Command(name = "add", description = "Add a user.") public class AddUser extends PasswordAction { diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/RemoveUser.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/RemoveUser.java index de17056cbc9..43b271fb0c9 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/RemoveUser.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/RemoveUser.java @@ -22,7 +22,9 @@ /** * Remove a user, example: + *

{@code
  * ./artemis user rm --user guest
+ * }
*/ @Command(name = "rm", description = "Remove an existing user.") public class RemoveUser extends UserAction { diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/ResetUser.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/ResetUser.java index 795d1b739e0..bd782b75539 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/ResetUser.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/user/ResetUser.java @@ -23,7 +23,9 @@ /** * Reset a user's password or roles, example: + *
{@code
  * ./artemis user reset --user guest --role admin --password ***
+ * }
*/ @Command(name = "reset", description = "Reset user's password or roles.") public class ResetUser extends PasswordAction { diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/util/SyncCalculation.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/util/SyncCalculation.java index df43ac2f6af..8743beefb66 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/util/SyncCalculation.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/util/SyncCalculation.java @@ -37,7 +37,6 @@ /** * It will perform a simple test to evaluate how many syncs a disk can make per second - * * * */ public class SyncCalculation { @@ -45,13 +44,16 @@ public class SyncCalculation { private static final long MAX_FLUSH_NANOS = TimeUnit.SECONDS.toNanos(5); /** - * It will perform {@code tries} write tests of {@code blockSize * blocks} bytes and returning the lowest elapsed time to perform a try. - * + * It will perform {@code tries} write tests of {@code blockSize * blocks} bytes and returning the lowest elapsed + * time to perform a try. * *

- * Please configure {@code blocks >= -XX:CompileThreshold} (ie by default on most JVMs is 10000) to favour the best JIT/OSR compilation (ie: Just In Time/On Stack Replacement) - * if the test is running on a temporary file-system (eg: tmpfs on Linux) or without {@code fsync}. + * Please configure {@code blocks >= -XX:CompileThreshold} (ie by default on most JVMs is 10000) to favour the best + * JIT/OSR compilation (ie: Just In Time/On Stack Replacement) if the test is running on a temporary file-system (eg: + * tmpfs on Linux) or without {@code fsync}. *

- * NOTE: The write latencies are provided only if {@code verbose && !(journalType == JournalType.ASYNCIO && !syncWrites)} (ie are used effective synchronous writes). + * NOTE: The write latencies are provided only if + * {@code verbose && !(journalType == JournalType.ASYNCIO && !syncWrites)} (ie are used effective synchronous + * writes). * * @param datafolder the folder where the journal files will be stored * @param blockSize the size in bytes of each write on the journal @@ -59,12 +61,12 @@ public class SyncCalculation { * @param tries the number of tests * @param verbose {@code true} to make the output verbose, {@code false} otherwise * @param fsync if {@code true} the test is performing full durable writes, {@code false} otherwise - * @param syncWrites if {@code true} each write is performed only if the previous one is completed, {@code false} otherwise (ie each try will wait only the last write) + * @param syncWrites if {@code true} each write is performed only if the previous one is completed, {@code false} + * otherwise (ie each try will wait only the last write) * @param fileName the name of the journal file used for the test * @param maxAIO the max number of in-flight IO requests (if {@code journalType} will support it) * @param journalType the {@link JournalType} used for the tests * @return the lowest elapsed time (in {@link TimeUnit#MILLISECONDS}) to perform a try - * @throws Exception */ public static long syncTest(File datafolder, int blockSize, diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java index 2732d3caae6..303c956701e 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/process/ProcessBuilder.java @@ -46,14 +46,10 @@ public static void cleanupProcess() { } /** - * * - * * @param logname the prefix for log output * @param location The location where this command is being executed from * @param hook it will finish the process upon shutdown of the VM * @param args The arguments being passwed to the the CLI tool - * @return - * @throws Exception */ public static Process build(String logname, File location, boolean hook, String... args) throws Exception { boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win"); diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/integration/FileBroker.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/integration/FileBroker.java index 154a9dca7bd..b64b32dbb46 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/integration/FileBroker.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/integration/FileBroker.java @@ -125,10 +125,10 @@ public void createComponents() throws Exception { components = fileDeploymentManager.buildService(securityManager, ManagementFactory.getPlatformMBeanServer(), activateCallback); } - /* - * this makes sure the components are started in the correct order. Its simple at the mo as e only have core and jms but - * will need impproving if we get more. - * */ + /** + * This makes sure the components are started in the correct order. Its simple at the mo as e only have core and jms + * but will need impproving if we get more. + */ private List getComponentsByStartOrder(Map components) { List activeMQComponents = new ArrayList<>(); ActiveMQComponent jmsComponent = components.get("jms"); diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java index 5bf52e5695e..a77385d27f6 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/util/ServerUtil.java @@ -41,12 +41,10 @@ public static Process startServer(String artemisInstance, String serverName) thr } /** - * @param artemisInstance - * @param serverName it will be used on logs - * @param id it will be used to add on the port - * @param timeout - * @return - * @throws Exception + * Start the server. + * + * @param serverName it will be used on logs + * @param id it will be used to add on the port */ public static Process startServer(String artemisInstance, String serverName, int id, int timeout) throws Exception { return startServer(artemisInstance, serverName, id, timeout, null); @@ -122,8 +120,7 @@ public static Process execute(String artemisInstance, String jobName, String...a ProcessLogger outputLogger = new ProcessLogger(true, process.getInputStream(), jobName, false); outputLogger.start(); - // Adding a reader to System.err, so the VM won't hang on a System.err.println as identified on this forum thread: - // http://www.jboss.org/index.html?module=bb&op=viewtopic&t=151815 + // Adding a reader to System.err, so the VM won't hang on a System.err.println ProcessLogger errorLogger = new ProcessLogger(true, process.getErrorStream(), jobName, true); errorLogger.start(); return process; diff --git a/artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/CreateTest.java b/artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/CreateTest.java index 7b980e6b4ab..17320342362 100644 --- a/artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/CreateTest.java +++ b/artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/CreateTest.java @@ -84,7 +84,7 @@ public void testWriteJolokiaAccessXmlCreatesValidXml() throws Exception { * If it parses, the xml is assumed to be valid. If any exceptions occur, the xml is not valid. * * @param xml The xml file to check for validity. - * @return whether the xml file represents a valid xml document. + * @return whether the xml file represents a valid xml document */ private boolean isXmlValid(File xml) { try { 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 ab89be41518..d6e624d28b4 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 @@ -1329,9 +1329,7 @@ public void testProducerRetry() throws Exception { */ assertEquals(100L, Artemis.internalExecute(false, null, null, null, new String[] {"producer", "--destination", "queue://q1", "--message-count", "100", "--password", "admin"}, context)); - /* - * This is the same as above except it will prompt the user to re-enter both the URL and the username. - */ + // This is the same as above except it will prompt the user to re-enter both the URL and the username. in = new ByteArrayInputStream("tcp://localhost:61616\nadmin\n".getBytes()); context = new ActionContext(in, System.out, System.err); assertEquals(100L, Artemis.internalExecute(false, null, null, null, new String[] {"producer", "--destination", "queue://q1", "--message-count", "100", "--password", "admin", "--url", "tcp://badhost:11111"}, context)); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffer.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffer.java index 1b42d48e9e5..c3c2dde7d97 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffer.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffer.java @@ -33,21 +33,17 @@ public interface ActiveMQBuffer extends DataInput { /** - * Returns the underlying Netty's ByteBuf - * - * @return the underlying Netty's ByteBuf + * {@return the underlying Netty's ByteBuf} */ ByteBuf byteBuf(); /** - * Returns the number of bytes this buffer can contain. - * - * @return the number of bytes this buffer can contain. + * {@return the number of bytes this buffer can contain} */ int capacity(); /** - * @return the {@code readerIndex} of this buffer. + * {@return the {@code readerIndex} of this buffer.} */ int readerIndex(); @@ -55,14 +51,13 @@ public interface ActiveMQBuffer extends DataInput { * Sets the {@code readerIndex} of this buffer. * * @param readerIndex The reader's index - * @throws IndexOutOfBoundsException if the specified {@code readerIndex} is - * less than {@code 0} or - * greater than {@code this.writerIndex} + * @throws IndexOutOfBoundsException if the specified {@code readerIndex} is less than {@code 0} or greater than + * {@code this.writerIndex} */ void readerIndex(int readerIndex); /** - * @return the {@code writerIndex} of this buffer. + * {@return the {@code writerIndex} of this buffer.} */ int writerIndex(); @@ -70,17 +65,15 @@ public interface ActiveMQBuffer extends DataInput { * Sets the {@code writerIndex} of this buffer. * * @param writerIndex The writer's index - * @throws IndexOutOfBoundsException if the specified {@code writerIndex} is - * less than {@code this.readerIndex} or + * @throws IndexOutOfBoundsException if the specified {@code writerIndex} is less than {@code this.readerIndex} or * greater than {@code this.capacity} */ void writerIndex(int writerIndex); /** - * Sets the {@code readerIndex} and {@code writerIndex} of this buffer - * in one shot. This method is useful when you have to worry about the - * invocation order of {@link #readerIndex(int)} and {@link #writerIndex(int)} - * methods. For example, the following code will fail: + * Sets the {@code readerIndex} and {@code writerIndex} of this buffer in one shot. This method is useful when you + * have to worry about the invocation order of {@link #readerIndex(int)} and {@link #writerIndex(int)} methods. For + * example, the following code will fail: * *

     * // Create a buffer whose readerIndex, writerIndex and capacity are
@@ -92,7 +85,7 @@ public interface ActiveMQBuffer extends DataInput {
     * buf.readerIndex(2);
     * buf.writerIndex(4);
     * 
- * + *

* The following code will also fail: * *

@@ -108,11 +101,9 @@ public interface ActiveMQBuffer extends DataInput {
     * buf.writerIndex(4);
     * buf.readerIndex(2);
     * 
- * - * By contrast, {@link #setIndex(int, int)} guarantees that it never - * throws an {@link IndexOutOfBoundsException} as long as the specified - * indexes meet basic constraints, regardless what the current index - * values of the buffer are: + *

+ * By contrast, {@link #setIndex(int, int)} guarantees that it never throws an {@link IndexOutOfBoundsException} as + * long as the specified indexes meet basic constraints, regardless what the current index values of the buffer are: * *

     * // No matter what the current state of the buffer is, the following
@@ -123,72 +114,64 @@ public interface ActiveMQBuffer extends DataInput {
     *
     * @param readerIndex The reader's index
     * @param writerIndex The writer's index
-    * @throws IndexOutOfBoundsException if the specified {@code readerIndex} is less than 0,
-    *                                   if the specified {@code writerIndex} is less than the specified
-    *                                   {@code readerIndex} or if the specified {@code writerIndex} is
-    *                                   greater than {@code this.capacity}
+    * @throws IndexOutOfBoundsException if the specified {@code readerIndex} is less than 0, if the specified
+    *                                   {@code writerIndex} is less than the specified {@code readerIndex} or if the
+    *                                   specified {@code writerIndex} is greater than {@code this.capacity}
     */
    void setIndex(int readerIndex, int writerIndex);
 
    /**
-    * @return the number of readable bytes which is equal to {@code (this.writerIndex - this.readerIndex)}.
+    * {@return the number of readable bytes which is equal to {@code (this.writerIndex - this.readerIndex)}}
     */
    int readableBytes();
 
    /**
-    * @return the number of writable bytes which is equal to {@code (this.capacity - this.writerIndex)}.
+    * {@return the number of writable bytes which is equal to {@code (this.capacity - this.writerIndex)}}
     */
    int writableBytes();
 
    /**
-    * @return {@code true} if and only if {@code (this.writerIndex - this.readerIndex)} is greater than {@code 0}.
+    * {@return {@code true} if and only if {@code (this.writerIndex - this.readerIndex)} is greater than {@code 0}}
     */
    boolean readable();
 
    /**
-    * @return {@code true}if and only if {@code (this.capacity - this.writerIndex)} is greater than {@code 0}.
+    * {@return {@code true}if and only if {@code (this.capacity - this.writerIndex)} is greater than {@code 0}}
     */
    boolean writable();
 
    /**
-    * Sets the {@code readerIndex} and {@code writerIndex} of this buffer to
-    * {@code 0}.
-    * This method is identical to {@link #setIndex(int, int) setIndex(0, 0)}.
+    * Sets the {@code readerIndex} and {@code writerIndex} of this buffer to {@code 0}. This method is identical to
+    * {@link #setIndex(int, int) setIndex(0, 0)}.
     * 

- * Please note that the behavior of this method is different - * from that of NIO buffer, which sets the {@code limit} to + * Please note that the behavior of this method is different from that of NIO buffer, which sets the {@code limit} to * the {@code capacity} of the buffer. */ void clear(); /** - * Marks the current {@code readerIndex} in this buffer. You can - * reposition the current {@code readerIndex} to the marked - * {@code readerIndex} by calling {@link #resetReaderIndex()}. - * The initial value of the marked {@code readerIndex} is {@code 0}. + * Marks the current {@code readerIndex} in this buffer. You can reposition the current {@code readerIndex} to the + * marked {@code readerIndex} by calling {@link #resetReaderIndex()}. The initial value of the marked + * {@code readerIndex} is {@code 0}. */ void markReaderIndex(); /** - * Repositions the current {@code readerIndex} to the marked - * {@code readerIndex} in this buffer. + * Repositions the current {@code readerIndex} to the marked {@code readerIndex} in this buffer. * - * @throws IndexOutOfBoundsException if the current {@code writerIndex} is less than the marked - * {@code readerIndex} + * @throws IndexOutOfBoundsException if the current {@code writerIndex} is less than the marked {@code readerIndex} */ void resetReaderIndex(); /** - * Marks the current {@code writerIndex} in this buffer. You can - * reposition the current {@code writerIndex} to the marked - * {@code writerIndex} by calling {@link #resetWriterIndex()}. - * The initial value of the marked {@code writerIndex} is {@code 0}. + * Marks the current {@code writerIndex} in this buffer. You can reposition the current {@code writerIndex} to the + * marked {@code writerIndex} by calling {@link #resetWriterIndex()}. The initial value of the marked + * {@code writerIndex} is {@code 0}. */ void markWriterIndex(); /** - * Repositions the current {@code writerIndex} to the marked - * {@code writerIndex} in this buffer. + * Repositions the current {@code writerIndex} to the marked {@code writerIndex} in this buffer. * * @throws IndexOutOfBoundsException if the current {@code readerIndex} is greater than the marked * {@code writerIndex} @@ -196,440 +179,373 @@ public interface ActiveMQBuffer extends DataInput { void resetWriterIndex(); /** - * Discards the bytes between the 0th index and {@code readerIndex}. - * It moves the bytes between {@code readerIndex} and {@code writerIndex} - * to the 0th index, and sets {@code readerIndex} and {@code writerIndex} - * to {@code 0} and {@code oldWriterIndex - oldReaderIndex} respectively. + * Discards the bytes between the 0th index and {@code readerIndex}. It moves the bytes between {@code readerIndex} + * and {@code writerIndex} to the 0th index, and sets {@code readerIndex} and {@code writerIndex} to {@code 0} and + * {@code oldWriterIndex - oldReaderIndex} respectively. *

* Please refer to the class documentation for more detailed explanation. */ void discardReadBytes(); /** - * Gets a byte at the specified absolute {@code index} in this buffer. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Gets a byte at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @return The byte at the specified index - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 1} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 1} is + * greater than {@code this.capacity} */ byte getByte(int index); /** - * Gets an unsigned byte at the specified absolute {@code index} in this - * buffer. This method does not modify {@code readerIndex} or - * {@code writerIndex} of this buffer. + * Gets an unsigned byte at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @return an unsigned byte at the specified absolute {@code index} - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 1} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 1} is + * greater than {@code this.capacity} */ short getUnsignedByte(int index); /** - * Gets a 16-bit short integer at the specified absolute {@code index} in - * this buffer. This method does not modify {@code readerIndex} or - * {@code writerIndex} of this buffer. + * Gets a 16-bit short integer at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @return a 16-bit short integer at the specified absolute {@code index} - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 2} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 2} is + * greater than {@code this.capacity} */ short getShort(int index); /** - * Gets an unsigned 16-bit short integer at the specified absolute - * {@code index} in this buffer. This method does not modify - * {@code readerIndex} or {@code writerIndex} of this buffer. + * Gets an unsigned 16-bit short integer at the specified absolute {@code index} in this buffer. This method does + * not modify {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @return an unsigned 16-bit short integer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 2} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 2} is + * greater than {@code this.capacity} */ int getUnsignedShort(int index); /** - * Gets a 32-bit integer at the specified absolute {@code index} in - * this buffer. This method does not modify {@code readerIndex} or - * {@code writerIndex} of this buffer. + * Gets a 32-bit integer at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @return a 32-bit integer at the specified absolute {@code index} - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 4} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 4} is + * greater than {@code this.capacity} */ int getInt(int index); /** - * Gets an unsigned 32-bit integer at the specified absolute {@code index} - * in this buffer. This method does not modify {@code readerIndex} or - * {@code writerIndex} of this buffer. + * Gets an unsigned 32-bit integer at the specified absolute {@code index} in this buffer. This method does not + * modify {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index The index into this buffer * @return an unsigned 32-bit integer at the specified absolute {@code index} - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 4} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 4} is + * greater than {@code this.capacity} */ long getUnsignedInt(int index); /** - * Gets a 64-bit long integer at the specified absolute {@code index} in - * this buffer. This method does not modify {@code readerIndex} or - * {@code writerIndex} of this buffer. + * Gets a 64-bit long integer at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @return a 64-bit long integer at the specified absolute {@code index} - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 8} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 8} is + * greater than {@code this.capacity} */ long getLong(int index); /** - * Transfers this buffer's data to the specified destination starting at - * the specified absolute {@code index} until the destination becomes - * non-writable. This method is basically same with - * {@link #getBytes(int, ActiveMQBuffer, int, int)}, except that this - * method increases the {@code writerIndex} of the destination by the - * number of the transferred bytes while - * {@link #getBytes(int, ActiveMQBuffer, int, int)} does not. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * the source buffer (i.e. {@code this}). + * Transfers this buffer's data to the specified destination starting at the specified absolute {@code index} until + * the destination becomes non-writable. This method is basically same with + * {@link #getBytes(int, ActiveMQBuffer, int, int)}, except that this method increases the {@code writerIndex} of the + * destination by the number of the transferred bytes while {@link #getBytes(int, ActiveMQBuffer, int, int)} does + * not. This method does not modify {@code readerIndex} or {@code writerIndex} of the source buffer (i.e. + * {@code this}). * * @param index Index into the buffer * @param dst The destination buffer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * if {@code index + dst.writableBytes} is greater than - * {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or if + * {@code index + dst.writableBytes} is greater than {@code this.capacity} */ void getBytes(int index, ActiveMQBuffer dst); /** - * Transfers this buffer's data to the specified destination starting at - * the specified absolute {@code index}. This method is basically same - * with {@link #getBytes(int, ActiveMQBuffer, int, int)}, except that this - * method increases the {@code writerIndex} of the destination by the - * number of the transferred bytes while - * {@link #getBytes(int, ActiveMQBuffer, int, int)} does not. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * the source buffer (i.e. {@code this}). + * Transfers this buffer's data to the specified destination starting at the specified absolute {@code index}. This + * method is basically same with {@link #getBytes(int, ActiveMQBuffer, int, int)}, except that this method increases + * the {@code writerIndex} of the destination by the number of the transferred bytes while + * {@link #getBytes(int, ActiveMQBuffer, int, int)} does not. This method does not modify {@code readerIndex} or + * {@code writerIndex} of the source buffer (i.e. {@code this}). * * @param length the number of bytes to transfer * @param index Index into the buffer * @param dst The destination buffer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, - * if {@code index + length} is greater than - * {@code this.capacity}, or - * if {@code length} is greater than {@code dst.writableBytes} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, if {@code index + length} + * is greater than {@code this.capacity}, or if {@code length} is greater than + * {@code dst.writableBytes} */ void getBytes(int index, ActiveMQBuffer dst, int length); /** - * Transfers this buffer's data to the specified destination starting at - * the specified absolute {@code index}. - * This method does not modify {@code readerIndex} or {@code writerIndex} - * of both the source (i.e. {@code this}) and the destination. + * Transfers this buffer's data to the specified destination starting at the specified absolute {@code index}. This + * method does not modify {@code readerIndex} or {@code writerIndex} of both the source (i.e. {@code this}) and the + * destination. * * @param dst The destination bufferIndex the first index of the destination * @param length The number of bytes to transfer * @param index Index into the buffer * @param dstIndex The index into the destination bufferThe destination buffer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, - * if the specified {@code dstIndex} is less than {@code 0}, - * if {@code index + length} is greater than - * {@code this.capacity}, or - * if {@code dstIndex + length} is greater than + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, if the specified + * {@code dstIndex} is less than {@code 0}, if {@code index + length} is greater + * than {@code this.capacity}, or if {@code dstIndex + length} is greater than * {@code dst.capacity} */ void getBytes(int index, ActiveMQBuffer dst, int dstIndex, int length); /** - * Transfers this buffer's data to the specified destination starting at - * the specified absolute {@code index}. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer + * Transfers this buffer's data to the specified destination starting at the specified absolute {@code index}. This + * method does not modify {@code readerIndex} or {@code writerIndex} of this buffer * * @param index Index into the buffer * @param dst The destination buffer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * if {@code index + dst.length} is greater than - * {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or if + * {@code index + dst.length} is greater than {@code this.capacity} */ void getBytes(int index, byte[] dst); /** - * Transfers this buffer's data to the specified destination starting at - * the specified absolute {@code index}. - * This method does not modify {@code readerIndex} or {@code writerIndex} - * of this buffer. + * Transfers this buffer's data to the specified destination starting at the specified absolute {@code index}. This + * method does not modify {@code readerIndex} or {@code writerIndex} of this buffer. * * @param dstIndex The first index of the destination * @param length The number of bytes to transfer * @param index Index into the buffer * @param dst The destination buffer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, - * if the specified {@code dstIndex} is less than {@code 0}, - * if {@code index + length} is greater than - * {@code this.capacity}, or - * if {@code dstIndex + length} is greater than + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, if the specified + * {@code dstIndex} is less than {@code 0}, if {@code index + length} is greater + * than {@code this.capacity}, or if {@code dstIndex + length} is greater than * {@code dst.length} */ void getBytes(int index, byte[] dst, int dstIndex, int length); /** - * Transfers this buffer's data to the specified destination starting at - * the specified absolute {@code index} until the destination's position - * reaches its limit. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer while the destination's {@code position} will be increased. + * Transfers this buffer's data to the specified destination starting at the specified absolute {@code index} until + * the destination's position reaches its limit. This method does not modify {@code readerIndex} or + * {@code writerIndex} of this buffer while the destination's {@code position} will be increased. * * @param index Index into the buffer * @param dst The destination buffer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * if {@code index + dst.remaining()} is greater than - * {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or if + * {@code index + dst.remaining()} is greater than {@code this.capacity} */ void getBytes(int index, ByteBuffer dst); /** - * Gets a char at the specified absolute {@code index} in - * this buffer. This method does not modify {@code readerIndex} or - * {@code writerIndex} of this buffer. + * Gets a char at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @return a char at the specified absolute {@code index} - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 2} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 2} is + * greater than {@code this.capacity} */ char getChar(int index); /** - * Gets a float at the specified absolute {@code index} in - * this buffer. This method does not modify {@code readerIndex} or - * {@code writerIndex} of this buffer. + * Gets a float at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @return a float at the specified absolute {@code index} - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 4} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 4} is + * greater than {@code this.capacity} */ float getFloat(int index); /** - * Gets a double at the specified absolute {@code index} in - * this buffer. This method does not modify {@code readerIndex} or - * {@code writerIndex} of this buffer. + * Gets a double at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @return a double at the specified absolute {@code index} - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 8} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 8} is + * greater than {@code this.capacity} */ double getDouble(int index); /** - * Sets the specified byte at the specified absolute {@code index} in this - * buffer. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Sets the specified byte at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param value The specified byte - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 1} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 1} is + * greater than {@code this.capacity} */ void setByte(int index, byte value); /** - * Sets the specified 16-bit short integer at the specified absolute - * {@code index} in this buffer. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Sets the specified 16-bit short integer at the specified absolute {@code index} in this buffer. This method does + * not modify {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param value The specified 16-bit short integer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 2} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 2} is + * greater than {@code this.capacity} */ void setShort(int index, short value); /** - * Sets the specified 32-bit integer at the specified absolute - * {@code index} in this buffer. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Sets the specified 32-bit integer at the specified absolute {@code index} in this buffer. This method does not + * modify {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param value The specified 32-bit integer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 4} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 4} is + * greater than {@code this.capacity} */ void setInt(int index, int value); /** - * Sets the specified 64-bit long integer at the specified absolute - * {@code index} in this buffer. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Sets the specified 64-bit long integer at the specified absolute {@code index} in this buffer. This method does + * not modify {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param value The specified 64-bit long integer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 8} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 8} is + * greater than {@code this.capacity} */ void setLong(int index, long value); /** - * Transfers the specified source buffer's data to this buffer starting at - * the specified absolute {@code index} until the destination becomes - * unreadable. This method is basically same with - * {@link #setBytes(int, ActiveMQBuffer, int, int)}, except that this - * method increases the {@code readerIndex} of the source buffer by - * the number of the transferred bytes while - * {@link #getBytes(int, ActiveMQBuffer, int, int)} does not. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * the source buffer (i.e. {@code this}). + * Transfers the specified source buffer's data to this buffer starting at the specified absolute {@code index} until + * the destination becomes unreadable. This method is basically same with + * {@link #setBytes(int, ActiveMQBuffer, int, int)}, except that this method increases the {@code readerIndex} of the + * source buffer by the number of the transferred bytes while {@link #getBytes(int, ActiveMQBuffer, int, int)} does + * not. This method does not modify {@code readerIndex} or {@code writerIndex} of the source buffer (i.e. + * {@code this}). * * @param index Index into the buffer * @param src The source buffer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * if {@code index + src.readableBytes} is greater than - * {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or if + * {@code index + src.readableBytes} is greater than {@code this.capacity} */ void setBytes(int index, ActiveMQBuffer src); /** - * Transfers the specified source buffer's data to this buffer starting at - * the specified absolute {@code index}. This method is basically same - * with {@link #setBytes(int, ActiveMQBuffer, int, int)}, except that this - * method increases the {@code readerIndex} of the source buffer by - * the number of the transferred bytes while - * {@link #getBytes(int, ActiveMQBuffer, int, int)} does not. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * the source buffer (i.e. {@code this}). + * Transfers the specified source buffer's data to this buffer starting at the specified absolute {@code index}. This + * method is basically same with {@link #setBytes(int, ActiveMQBuffer, int, int)}, except that this method increases + * the {@code readerIndex} of the source buffer by the number of the transferred bytes while + * {@link #getBytes(int, ActiveMQBuffer, int, int)} does not. This method does not modify {@code readerIndex} or + * {@code writerIndex} of the source buffer (i.e. {@code this}). * * @param length the number of bytes to transfer * @param index Index into the buffer * @param src The source buffer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, - * if {@code index + length} is greater than - * {@code this.capacity}, or - * if {@code length} is greater than {@code src.readableBytes} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, if {@code index + length} + * is greater than {@code this.capacity}, or if {@code length} is greater than + * {@code src.readableBytes} */ void setBytes(int index, ActiveMQBuffer src, int length); /** - * Transfers the specified source buffer's data to this buffer starting at - * the specified absolute {@code index}. - * This method does not modify {@code readerIndex} or {@code writerIndex} - * of both the source (i.e. {@code this}) and the destination. + * Transfers the specified source buffer's data to this buffer starting at the specified absolute {@code index}. This + * method does not modify {@code readerIndex} or {@code writerIndex} of both the source (i.e. {@code this}) and the + * destination. * * @param src The source bufferIndex the first index of the source * @param length The number of bytes to transfer * @param index Index into the buffer * @param srcIndex The source buffer index - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, - * if the specified {@code srcIndex} is less than {@code 0}, - * if {@code index + length} is greater than - * {@code this.capacity}, or - * if {@code srcIndex + length} is greater than + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, if the specified + * {@code srcIndex} is less than {@code 0}, if {@code index + length} is greater + * than {@code this.capacity}, or if {@code srcIndex + length} is greater than * {@code src.capacity} */ void setBytes(int index, ActiveMQBuffer src, int srcIndex, int length); /** - * Transfers the specified source array's data to this buffer starting at - * the specified absolute {@code index}. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Transfers the specified source array's data to this buffer starting at the specified absolute {@code index}. This + * method does not modify {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param src The source buffer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * if {@code index + src.length} is greater than - * {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or if + * {@code index + src.length} is greater than {@code this.capacity} */ void setBytes(int index, byte[] src); /** - * Transfers the specified source array's data to this buffer starting at - * the specified absolute {@code index}. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Transfers the specified source array's data to this buffer starting at the specified absolute {@code index}. This + * method does not modify {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param src The source buffer * @param srcIndex The source buffer index * @param length The number of bytes to transfer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, - * if the specified {@code srcIndex} is less than {@code 0}, - * if {@code index + length} is greater than - * {@code this.capacity}, or - * if {@code srcIndex + length} is greater than {@code src.length} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0}, if the specified + * {@code srcIndex} is less than {@code 0}, if {@code index + length} is greater + * than {@code this.capacity}, or if {@code srcIndex + length} is greater than + * {@code src.length} */ void setBytes(int index, byte[] src, int srcIndex, int length); /** - * Transfers the specified source buffer's data to this buffer starting at - * the specified absolute {@code index} until the source buffer's position - * reaches its limit. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Transfers the specified source buffer's data to this buffer starting at the specified absolute {@code index} until + * the source buffer's position reaches its limit. This method does not modify {@code readerIndex} or + * {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param src The source buffer - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * if {@code index + src.remaining()} is greater than - * {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or if + * {@code index + src.remaining()} is greater than {@code this.capacity} */ void setBytes(int index, ByteBuffer src); /** - * Sets the specified char at the specified absolute - * {@code index} in this buffer. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Sets the specified char at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param value The specified char - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 2} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 2} is + * greater than {@code this.capacity} */ void setChar(int index, char value); /** - * Sets the specified float at the specified absolute - * {@code index} in this buffer. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Sets the specified float at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param value The specified float - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 4} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 4} is + * greater than {@code this.capacity} */ void setFloat(int index, float value); /** - * Sets the specified double at the specified absolute - * {@code index} in this buffer. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Sets the specified double at the specified absolute {@code index} in this buffer. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param value The specified double - * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or - * {@code index + 8} is greater than {@code this.capacity} + * @throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or {@code index + 8} is + * greater than {@code this.capacity} */ void setDouble(int index, double value); /** - * Gets a byte at the current {@code readerIndex} and increases - * the {@code readerIndex} by {@code 1} in this buffer. + * Gets a byte at the current {@code readerIndex} and increases the {@code readerIndex} by {@code 1} in this buffer. * * @return a byte at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 1} @@ -638,8 +554,8 @@ public interface ActiveMQBuffer extends DataInput { byte readByte(); /** - * Gets an unsigned byte at the current {@code readerIndex} and increases - * the {@code readerIndex} by {@code 1} in this buffer. + * Gets an unsigned byte at the current {@code readerIndex} and increases the {@code readerIndex} by {@code 1} in + * this buffer. * * @return an unsigned byte at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 1} @@ -648,8 +564,8 @@ public interface ActiveMQBuffer extends DataInput { int readUnsignedByte(); /** - * Gets a 16-bit short integer at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 2} in this buffer. + * Gets a 16-bit short integer at the current {@code readerIndex} and increases the {@code readerIndex} by {@code 2} + * in this buffer. * * @return a 16-bit short integer at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 2} @@ -658,8 +574,8 @@ public interface ActiveMQBuffer extends DataInput { short readShort(); /** - * Gets an unsigned 16-bit short integer at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 2} in this buffer. + * Gets an unsigned 16-bit short integer at the current {@code readerIndex} and increases the {@code readerIndex} by + * {@code 2} in this buffer. * * @return an unsigned 16-bit short integer at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 2} @@ -668,8 +584,8 @@ public interface ActiveMQBuffer extends DataInput { int readUnsignedShort(); /** - * Gets a 32-bit integer at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 4} in this buffer. + * Gets a 32-bit integer at the current {@code readerIndex} and increases the {@code readerIndex} by {@code 4} in + * this buffer. * * @return a 32-bit integer at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 4} @@ -678,8 +594,8 @@ public interface ActiveMQBuffer extends DataInput { int readInt(); /** - * Gets a (potentially {@code null}) 32-bit integer at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 4} in this buffer. + * Gets a (potentially {@code null}) 32-bit integer at the current {@code readerIndex} and increases the + * {@code readerIndex} by {@code 4} in this buffer. * * @return a (potentially {@code null}) 32-bit integer at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 4} @@ -687,8 +603,8 @@ public interface ActiveMQBuffer extends DataInput { Integer readNullableInt(); /** - * Gets an unsigned 32-bit integer at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 4} in this buffer. + * Gets an unsigned 32-bit integer at the current {@code readerIndex} and increases the {@code readerIndex} by + * {@code 4} in this buffer. * * @return an unsigned 32-bit integer at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 4} @@ -696,8 +612,8 @@ public interface ActiveMQBuffer extends DataInput { long readUnsignedInt(); /** - * Gets a 64-bit integer at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 8} in this buffer. + * Gets a 64-bit integer at the current {@code readerIndex} and increases the {@code readerIndex} by {@code 8} in + * this buffer. * * @return a 64-bit integer at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 8} @@ -706,8 +622,8 @@ public interface ActiveMQBuffer extends DataInput { long readLong(); /** - * Gets a (potentially {@code null}) 64-bit integer at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 8} in this buffer. + * Gets a (potentially {@code null}) 64-bit integer at the current {@code readerIndex} and increases the + * {@code readerIndex} by {@code 8} in this buffer. * * @return a (potentially {@code null}) 64-bit integer at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 8} @@ -715,8 +631,7 @@ public interface ActiveMQBuffer extends DataInput { Long readNullableLong(); /** - * Gets a char at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 2} in this buffer. + * Gets a char at the current {@code readerIndex} and increases the {@code readerIndex} by {@code 2} in this buffer. * * @return a char at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 2} @@ -725,8 +640,8 @@ public interface ActiveMQBuffer extends DataInput { char readChar(); /** - * Gets a float at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 4} in this buffer. + * Gets a float at the current {@code readerIndex} and increases the {@code readerIndex} by {@code 4} in this + * buffer. * * @return a float at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 4} @@ -735,8 +650,8 @@ public interface ActiveMQBuffer extends DataInput { float readFloat(); /** - * Gets a double at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 8} in this buffer. + * Gets a double at the current {@code readerIndex} and increases the {@code readerIndex} by {@code 8} in this + * buffer. * * @return a double at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 8} @@ -745,8 +660,8 @@ public interface ActiveMQBuffer extends DataInput { double readDouble(); /** - * Gets a boolean at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 1} in this buffer. + * Gets a boolean at the current {@code readerIndex} and increases the {@code readerIndex} by {@code 1} in this + * buffer. * * @return a boolean at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 1} @@ -755,8 +670,8 @@ public interface ActiveMQBuffer extends DataInput { boolean readBoolean(); /** - * Gets a (potentially {@code null}) boolean at the current {@code readerIndex} - * and increases the {@code readerIndex} by {@code 1} in this buffer. + * Gets a (potentially {@code null}) boolean at the current {@code readerIndex} and increases the {@code readerIndex} + * by {@code 1} in this buffer. * * @return a (potentially {@code null}) boolean at the current {@code readerIndex} * @throws IndexOutOfBoundsException if {@code this.readableBytes} is less than {@code 1} @@ -800,9 +715,8 @@ public interface ActiveMQBuffer extends DataInput { String readUTF(); /** - * Returns a new slice of this buffer's sub-region starting at the current - * {@code readerIndex} and increases the {@code readerIndex} by the size - * of the new slice (= {@code length}). + * Returns a new slice of this buffer's sub-region starting at the current {@code readerIndex} and increases the + * {@code readerIndex} by the size of the new slice (= {@code length}). * * @param length the size of the new slice * @return the newly created slice @@ -811,56 +725,47 @@ public interface ActiveMQBuffer extends DataInput { ActiveMQBuffer readSlice(int length); /** - * Transfers this buffer's data to the specified destination starting at - * the current {@code readerIndex} until the destination becomes - * non-writable, and increases the {@code readerIndex} by the number of the - * transferred bytes. This method is basically same with - * {@link #readBytes(ActiveMQBuffer, int, int)}, except that this method - * increases the {@code writerIndex} of the destination by the number of - * the transferred bytes while {@link #readBytes(ActiveMQBuffer, int, int)} - * does not. + * Transfers this buffer's data to the specified destination starting at the current {@code readerIndex} until the + * destination becomes non-writable, and increases the {@code readerIndex} by the number of the transferred bytes. + * This method is basically same with {@link #readBytes(ActiveMQBuffer, int, int)}, except that this method increases + * the {@code writerIndex} of the destination by the number of the transferred bytes while + * {@link #readBytes(ActiveMQBuffer, int, int)} does not. * * @param dst The destination buffer - * @throws IndexOutOfBoundsException if {@code dst.writableBytes} is greater than - * {@code this.readableBytes} + * @throws IndexOutOfBoundsException if {@code dst.writableBytes} is greater than {@code this.readableBytes} */ void readBytes(ActiveMQBuffer dst); /** - * Transfers this buffer's data to the specified destination starting at - * the current {@code readerIndex} and increases the {@code readerIndex} - * by the number of the transferred bytes (= {@code length}). This method - * is basically same with {@link #readBytes(ActiveMQBuffer, int, int)}, - * except that this method increases the {@code writerIndex} of the - * destination by the number of the transferred bytes (= {@code length}) - * while {@link #readBytes(ActiveMQBuffer, int, int)} does not. + * Transfers this buffer's data to the specified destination starting at the current {@code readerIndex} and + * increases the {@code readerIndex} by the number of the transferred bytes (= {@code length}). This method is + * basically same with {@link #readBytes(ActiveMQBuffer, int, int)}, except that this method increases the + * {@code writerIndex} of the destination by the number of the transferred bytes (= {@code length}) while + * {@link #readBytes(ActiveMQBuffer, int, int)} does not. * * @param dst The destination buffer * @param length The number of bytes to transfer - * @throws IndexOutOfBoundsException if {@code length} is greater than {@code this.readableBytes} or - * if {@code length} is greater than {@code dst.writableBytes} + * @throws IndexOutOfBoundsException if {@code length} is greater than {@code this.readableBytes} or if + * {@code length} is greater than {@code dst.writableBytes} */ void readBytes(ActiveMQBuffer dst, int length); /** - * Transfers this buffer's data to the specified destination starting at - * the current {@code readerIndex} and increases the {@code readerIndex} - * by the number of the transferred bytes (= {@code length}). + * Transfers this buffer's data to the specified destination starting at the current {@code readerIndex} and + * increases the {@code readerIndex} by the number of the transferred bytes (= {@code length}). * * @param dstIndex The destination buffer index * @param length the number of bytes to transfer * @param dst The destination buffer - * @throws IndexOutOfBoundsException if the specified {@code dstIndex} is less than {@code 0}, - * if {@code length} is greater than {@code this.readableBytes}, or - * if {@code dstIndex + length} is greater than - * {@code dst.capacity} + * @throws IndexOutOfBoundsException if the specified {@code dstIndex} is less than {@code 0}, if {@code length} is + * greater than {@code this.readableBytes}, or if {@code dstIndex + length} is + * greater than {@code dst.capacity} */ void readBytes(ActiveMQBuffer dst, int dstIndex, int length); /** - * Transfers this buffer's data to the specified destination starting at - * the current {@code readerIndex} and increases the {@code readerIndex} - * by the number of the transferred bytes (= {@code dst.length}). + * Transfers this buffer's data to the specified destination starting at the current {@code readerIndex} and + * increases the {@code readerIndex} by the number of the transferred bytes (= {@code dst.length}). * * @param dst The destination buffer * @throws IndexOutOfBoundsException if {@code dst.length} is greater than {@code this.readableBytes} @@ -868,34 +773,30 @@ public interface ActiveMQBuffer extends DataInput { void readBytes(byte[] dst); /** - * Transfers this buffer's data to the specified destination starting at - * the current {@code readerIndex} and increases the {@code readerIndex} - * by the number of the transferred bytes (= {@code length}). + * Transfers this buffer's data to the specified destination starting at the current {@code readerIndex} and + * increases the {@code readerIndex} by the number of the transferred bytes (= {@code length}). * * @param dstIndex The destination bufferIndex * @param length the number of bytes to transfer * @param dst The destination buffer - * @throws IndexOutOfBoundsException if the specified {@code dstIndex} is less than {@code 0}, - * if {@code length} is greater than {@code this.readableBytes}, or - * if {@code dstIndex + length} is greater than {@code dst.length} + * @throws IndexOutOfBoundsException if the specified {@code dstIndex} is less than {@code 0}, if {@code length} is + * greater than {@code this.readableBytes}, or if {@code dstIndex + length} is + * greater than {@code dst.length} */ void readBytes(byte[] dst, int dstIndex, int length); /** - * Transfers this buffer's data to the specified destination starting at - * the current {@code readerIndex} until the destination's position - * reaches its limit, and increases the {@code readerIndex} by the - * number of the transferred bytes. + * Transfers this buffer's data to the specified destination starting at the current {@code readerIndex} until the + * destination's position reaches its limit, and increases the {@code readerIndex} by the number of the transferred + * bytes. * * @param dst The destination buffer - * @throws IndexOutOfBoundsException if {@code dst.remaining()} is greater than - * {@code this.readableBytes} + * @throws IndexOutOfBoundsException if {@code dst.remaining()} is greater than {@code this.readableBytes} */ void readBytes(ByteBuffer dst); /** - * Increases the current {@code readerIndex} by the specified - * {@code length} in this buffer. + * Increases the current {@code readerIndex} by the specified {@code length} in this buffer. * * @param length The number of bytes to skip * @throws IndexOutOfBoundsException if {@code length} is greater than {@code this.readableBytes} @@ -904,8 +805,8 @@ public interface ActiveMQBuffer extends DataInput { int skipBytes(int length); /** - * Sets the specified byte at the current {@code writerIndex} - * and increases the {@code writerIndex} by {@code 1} in this buffer. + * Sets the specified byte at the current {@code writerIndex} and increases the {@code writerIndex} by {@code 1} in + * this buffer. * * @param value The specified byte * @throws IndexOutOfBoundsException if {@code this.writableBytes} is less than {@code 1} @@ -913,9 +814,8 @@ public interface ActiveMQBuffer extends DataInput { void writeByte(byte value); /** - * Sets the specified 16-bit short integer at the current - * {@code writerIndex} and increases the {@code writerIndex} by {@code 2} - * in this buffer. + * Sets the specified 16-bit short integer at the current {@code writerIndex} and increases the {@code writerIndex} + * by {@code 2} in this buffer. * * @param value The specified 16-bit short integer * @throws IndexOutOfBoundsException if {@code this.writableBytes} is less than {@code 2} @@ -923,8 +823,8 @@ public interface ActiveMQBuffer extends DataInput { void writeShort(short value); /** - * Sets the specified 32-bit integer at the current {@code writerIndex} - * and increases the {@code writerIndex} by {@code 4} in this buffer. + * Sets the specified 32-bit integer at the current {@code writerIndex} and increases the {@code writerIndex} by + * {@code 4} in this buffer. * * @param value The specified 32-bit integer * @throws IndexOutOfBoundsException if {@code this.writableBytes} is less than {@code 4} @@ -932,8 +832,8 @@ public interface ActiveMQBuffer extends DataInput { void writeInt(int value); /** - * Sets the specified (potentially {@code null}) 32-bit integer at the current {@code writerIndex} - * and increases the {@code writerIndex} by {@code 4} in this buffer. + * Sets the specified (potentially {@code null}) 32-bit integer at the current {@code writerIndex} and increases the + * {@code writerIndex} by {@code 4} in this buffer. * * @param value The specified (potentially {@code null}) 32-bit integer * @throws IndexOutOfBoundsException if {@code this.writableBytes} is less than {@code 4} @@ -941,9 +841,8 @@ public interface ActiveMQBuffer extends DataInput { void writeNullableInt(Integer value); /** - * Sets the specified 64-bit long integer at the current - * {@code writerIndex} and increases the {@code writerIndex} by {@code 8} - * in this buffer. + * Sets the specified 64-bit long integer at the current {@code writerIndex} and increases the {@code writerIndex} by + * {@code 8} in this buffer. * * @param value The specified 64-bit long integer * @throws IndexOutOfBoundsException if {@code this.writableBytes} is less than {@code 8} @@ -951,9 +850,8 @@ public interface ActiveMQBuffer extends DataInput { void writeLong(long value); /** - * Sets the specified (potentially {@code null}) 64-bit long integer at the current - * {@code writerIndex} and increases the {@code writerIndex} by {@code 8} - * in this buffer. + * Sets the specified (potentially {@code null}) 64-bit long integer at the current {@code writerIndex} and increases + * the {@code writerIndex} by {@code 8} in this buffer. * * @param value The specified (potentially {@code null}) 64-bit long integer * @throws IndexOutOfBoundsException if {@code this.writableBytes} is less than {@code 8} @@ -961,8 +859,8 @@ public interface ActiveMQBuffer extends DataInput { void writeNullableLong(Long value); /** - * Sets the specified char at the current {@code writerIndex} - * and increases the {@code writerIndex} by {@code 2} in this buffer. + * Sets the specified char at the current {@code writerIndex} and increases the {@code writerIndex} by {@code 2} in + * this buffer. * * @param chr The specified char * @throws IndexOutOfBoundsException if {@code this.writableBytes} is less than {@code 2} @@ -970,8 +868,8 @@ public interface ActiveMQBuffer extends DataInput { void writeChar(char chr); /** - * Sets the specified float at the current {@code writerIndex} - * and increases the {@code writerIndex} by {@code 4} in this buffer. + * Sets the specified float at the current {@code writerIndex} and increases the {@code writerIndex} by {@code 4} in + * this buffer. * * @param value The specified float * @throws IndexOutOfBoundsException if {@code this.writableBytes} is less than {@code 4} @@ -979,8 +877,8 @@ public interface ActiveMQBuffer extends DataInput { void writeFloat(float value); /** - * Sets the specified double at the current {@code writerIndex} - * and increases the {@code writerIndex} by {@code 8} in this buffer. + * Sets the specified double at the current {@code writerIndex} and increases the {@code writerIndex} by {@code 8} in + * this buffer. * * @param value The specified double * @throws IndexOutOfBoundsException if {@code this.writableBytes} is less than {@code 8} @@ -1038,40 +936,35 @@ public interface ActiveMQBuffer extends DataInput { void writeUTF(String utf); /** - * Transfers the specified source buffer's data to this buffer starting at - * the current {@code writerIndex} and increases the {@code writerIndex} - * by the number of the transferred bytes (= {@code length}). This method - * is basically same with {@link #writeBytes(ActiveMQBuffer, int, int)}, - * except that this method increases the {@code readerIndex} of the source - * buffer by the number of the transferred bytes (= {@code length}) while + * Transfers the specified source buffer's data to this buffer starting at the current {@code writerIndex} and + * increases the {@code writerIndex} by the number of the transferred bytes (= {@code length}). This method is + * basically same with {@link #writeBytes(ActiveMQBuffer, int, int)}, except that this method increases the + * {@code readerIndex} of the source buffer by the number of the transferred bytes (= {@code length}) while * {@link #writeBytes(ActiveMQBuffer, int, int)} does not. * * @param length the number of bytes to transfer * @param src The source buffer - * @throws IndexOutOfBoundsException if {@code length} is greater than {@code this.writableBytes} or - * if {@code length} is greater then {@code src.readableBytes} + * @throws IndexOutOfBoundsException if {@code length} is greater than {@code this.writableBytes} or if + * {@code length} is greater then {@code src.readableBytes} */ void writeBytes(ActiveMQBuffer src, int length); /** - * Transfers the specified source buffer's data to this buffer starting at - * the current {@code writerIndex} and increases the {@code writerIndex} - * by the number of the transferred bytes (= {@code length}). + * Transfers the specified source buffer's data to this buffer starting at the current {@code writerIndex} and + * increases the {@code writerIndex} by the number of the transferred bytes (= {@code length}). * * @param srcIndex the first index of the source * @param length the number of bytes to transfer * @param src The source buffer - * @throws IndexOutOfBoundsException if the specified {@code srcIndex} is less than {@code 0}, - * if {@code srcIndex + length} is greater than - * {@code src.capacity}, or - * if {@code length} is greater than {@code this.writableBytes} + * @throws IndexOutOfBoundsException if the specified {@code srcIndex} is less than {@code 0}, if + * {@code srcIndex + length} is greater than {@code src.capacity}, or if + * {@code length} is greater than {@code this.writableBytes} */ void writeBytes(ActiveMQBuffer src, int srcIndex, int length); /** - * Transfers the specified source array's data to this buffer starting at - * the current {@code writerIndex} and increases the {@code writerIndex} - * by the number of the transferred bytes (= {@code src.length}). + * Transfers the specified source array's data to this buffer starting at the current {@code writerIndex} and + * increases the {@code writerIndex} by the number of the transferred bytes (= {@code src.length}). * * @param src The source buffer * @throws IndexOutOfBoundsException if {@code src.length} is greater than {@code this.writableBytes} @@ -1079,123 +972,103 @@ public interface ActiveMQBuffer extends DataInput { void writeBytes(byte[] src); /** - * Transfers the specified source array's data to this buffer starting at - * the current {@code writerIndex} and increases the {@code writerIndex} - * by the number of the transferred bytes (= {@code length}). + * Transfers the specified source array's data to this buffer starting at the current {@code writerIndex} and + * increases the {@code writerIndex} by the number of the transferred bytes (= {@code length}). * * @param srcIndex the first index of the source * @param length the number of bytes to transfer * @param src The source buffer - * @throws IndexOutOfBoundsException if the specified {@code srcIndex} is less than {@code 0}, - * if {@code srcIndex + length} is greater than - * {@code src.length}, or - * if {@code length} is greater than {@code this.writableBytes} + * @throws IndexOutOfBoundsException if the specified {@code srcIndex} is less than {@code 0}, if + * {@code srcIndex + length} is greater than {@code src.length}, or if + * {@code length} is greater than {@code this.writableBytes} */ void writeBytes(byte[] src, int srcIndex, int length); /** - * Transfers the specified source buffer's data to this buffer starting at - * the current {@code writerIndex} until the source buffer's position - * reaches its limit, and increases the {@code writerIndex} by the - * number of the transferred bytes. + * Transfers the specified source buffer's data to this buffer starting at the current {@code writerIndex} until the + * source buffer's position reaches its limit, and increases the {@code writerIndex} by the number of the transferred + * bytes. * * @param src The source buffer - * @throws IndexOutOfBoundsException if {@code src.remaining()} is greater than - * {@code this.writableBytes} + * @throws IndexOutOfBoundsException if {@code src.remaining()} is greater than {@code this.writableBytes} */ void writeBytes(ByteBuffer src); - /** - * Transfers the specified source buffer's data to this buffer starting at - * the current {@code writerIndex} until the source buffer's position - * reaches its limit, and increases the {@code writerIndex} by the - * number of the transferred bytes. + * Transfers the specified source buffer's data to this buffer starting at the current {@code writerIndex} until the + * source buffer's position reaches its limit, and increases the {@code writerIndex} by the number of the transferred + * bytes. * * @param src The source buffer - * @throws IndexOutOfBoundsException if {@code src.remaining()} is greater than - * {@code this.writableBytes} + * @throws IndexOutOfBoundsException if {@code src.remaining()} is greater than {@code this.writableBytes} */ void writeBytes(ByteBuf src, int srcIndex, int length); /** - * Returns a copy of this buffer's readable bytes. Modifying the content - * of the returned buffer or this buffer does not affect each other at all. - * This method is identical to {@code buf.copy(buf.readerIndex(), buf.readableBytes())}. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Returns a copy of this buffer's readable bytes. Modifying the content of the returned buffer or this buffer does + * not affect each other at all. This method is identical to + * {@code buf.copy(buf.readerIndex(), buf.readableBytes())}. This method does not modify {@code readerIndex} or + * {@code writerIndex} of this buffer. * - * @return a copy of this buffer's readable bytes. + * @return a copy of this buffer's readable bytes */ ActiveMQBuffer copy(); /** - * Returns a copy of this buffer's sub-region. Modifying the content of - * the returned buffer or this buffer does not affect each other at all. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Returns a copy of this buffer's sub-region. Modifying the content of the returned buffer or this buffer does not + * affect each other at all. This method does not modify {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param length The number of bytes to copy - * @return a copy of this buffer's readable bytes. + * @return a copy of this buffer's readable bytes */ ActiveMQBuffer copy(int index, int length); /** - * Returns a slice of this buffer's readable bytes. Modifying the content - * of the returned buffer or this buffer affects each other's content - * while they maintain separate indexes and marks. This method is - * identical to {@code buf.slice(buf.readerIndex(), buf.readableBytes())}. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Returns a slice of this buffer's readable bytes. Modifying the content of the returned buffer or this buffer + * affects each other's content while they maintain separate indexes and marks. This method is identical to + * {@code buf.slice(buf.readerIndex(), buf.readableBytes())}. This method does not modify {@code readerIndex} or + * {@code writerIndex} of this buffer. * * @return a slice of this buffer's readable bytes */ ActiveMQBuffer slice(); /** - * Returns a slice of this buffer's sub-region. Modifying the content of - * the returned buffer or this buffer affects each other's content while - * they maintain separate indexes and marks. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Returns a slice of this buffer's sub-region. Modifying the content of the returned buffer or this buffer affects + * each other's content while they maintain separate indexes and marks. This method does not modify + * {@code readerIndex} or {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param length The number of bytes - * @return a slice of this buffer's sub-region. + * @return a slice of this buffer's sub-region */ ActiveMQBuffer slice(int index, int length); /** - * Returns a buffer which shares the whole region of this buffer. - * Modifying the content of the returned buffer or this buffer affects - * each other's content while they maintain separate indexes and marks. - * This method is identical to {@code buf.slice(0, buf.capacity())}. - * This method does not modify {@code readerIndex} or {@code writerIndex} of + * Returns a buffer which shares the whole region of this buffer. Modifying the content of the returned buffer or + * this buffer affects each other's content while they maintain separate indexes and marks. This method is identical + * to {@code buf.slice(0, buf.capacity())}. This method does not modify {@code readerIndex} or {@code writerIndex} of * this buffer. * - * @return a buffer which shares the whole region of this buffer. + * @return a buffer which shares the whole region of this buffer */ ActiveMQBuffer duplicate(); /** - * Converts this buffer's readable bytes into a NIO buffer. The returned - * buffer might or might not share the content with this buffer, while - * they have separate indexes and marks. This method is identical to - * {@code buf.toByteBuffer(buf.readerIndex(), buf.readableBytes())}. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Converts this buffer's readable bytes into a NIO buffer. The returned buffer might or might not share the content + * with this buffer, while they have separate indexes and marks. This method is identical to + * {@code buf.toByteBuffer(buf.readerIndex(), buf.readableBytes())}. This method does not modify {@code readerIndex} + * or {@code writerIndex} of this buffer. * * @return A converted NIO ByteBuffer */ ByteBuffer toByteBuffer(); /** - * Converts this buffer's sub-region into a NIO buffer. The returned - * buffer might or might not share the content with this buffer, while - * they have separate indexes and marks. - * This method does not modify {@code readerIndex} or {@code writerIndex} of - * this buffer. + * Converts this buffer's sub-region into a NIO buffer. The returned buffer might or might not share the content + * with this buffer, while they have separate indexes and marks. This method does not modify {@code readerIndex} or + * {@code writerIndex} of this buffer. * * @param index Index into the buffer * @param length The number of bytes @@ -1204,8 +1077,8 @@ public interface ActiveMQBuffer extends DataInput { ByteBuffer toByteBuffer(int index, int length); /** - * Release any underlying resources held by this buffer - */ + * Release any underlying resources held by this buffer + */ void release(); } diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffers.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffers.java index 328d3c8038e..057803c8e83 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffers.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffers.java @@ -60,7 +60,7 @@ public static ActiveMQBuffer dynamicBuffer(final byte[] bytes) { /** * Creates an ActiveMQBuffer wrapping an underlying NIO ByteBuffer - * + *

* The position on this buffer won't affect the position on the inner buffer * * @param underlying the underlying NIO ByteBuffer @@ -76,7 +76,7 @@ public static ActiveMQBuffer wrappedBuffer(final ByteBuffer underlying) { /** * Creates an ActiveMQBuffer wrapping an underlying ByteBuf - * + *

* The position on this buffer won't affect the position on the inner buffer * * @param underlying the underlying NIO ByteBuffer diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQException.java index 056ec290ce9..d96a141d11e 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQException.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQException.java @@ -44,9 +44,9 @@ public ActiveMQException(String message, Throwable t, ActiveMQExceptionType type this.type = type; } - /* - * This constructor is needed only for the native layer - */ + /** + * This constructor is needed only for the native layer + */ public ActiveMQException(int code, String msg) { super(msg); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQIllegalStateException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQIllegalStateException.java index 3ee855b06de..f5a8935caa8 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQIllegalStateException.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQIllegalStateException.java @@ -17,8 +17,8 @@ package org.apache.activemq.artemis.api.core; /** - * An ActiveMQ Artemis resource is not in a legal state (e.g. calling ClientConsumer.receive() if a - * MessageHandler is set). + * An ActiveMQ Artemis resource is not in a legal state (e.g. calling ClientConsumer.receive() if a MessageHandler is + * set). */ public final class ActiveMQIllegalStateException extends ActiveMQException { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQInterceptorRejectedPacketException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQInterceptorRejectedPacketException.java index e52c113bf46..f1ac0c18606 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQInterceptorRejectedPacketException.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQInterceptorRejectedPacketException.java @@ -20,7 +20,6 @@ * An outgoing interceptor returned false. * See org.apache.activemq.artemis.api.core.client.ServerLocator#addOutgoingInterceptor(org.apache.activemq.artemis.api.core.Interceptor) */ -// XXX I doubt any reader will make much sense of this Javadoc's text. public final class ActiveMQInterceptorRejectedPacketException extends ActiveMQException { private static final long serialVersionUID = -5798841227645281815L; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQLargeMessageInterruptedException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQLargeMessageInterruptedException.java index 77c45b93cbb..bfe649afe9c 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQLargeMessageInterruptedException.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQLargeMessageInterruptedException.java @@ -16,9 +16,6 @@ */ package org.apache.activemq.artemis.api.core; -/** - */ -// XXX public class ActiveMQLargeMessageInterruptedException extends ActiveMQException { private static final long serialVersionUID = 0; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQNativeIOError.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQNativeIOError.java index 1ed755d2bac..90a529261c9 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQNativeIOError.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQNativeIOError.java @@ -19,7 +19,6 @@ /** * An error has happened at ActiveMQ's native (non-Java) code used in reading and writing data. */ -// XXX public final class ActiveMQNativeIOError extends ActiveMQException { private static final long serialVersionUID = 2355120980683293085L; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQObjectClosedException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQObjectClosedException.java index 06dad546e5a..46e0c178cf2 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQObjectClosedException.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQObjectClosedException.java @@ -17,8 +17,7 @@ package org.apache.activemq.artemis.api.core; /** - * A client operation failed because the calling resource (ClientSession, ClientProducer, etc.) is - * closed. + * A client operation failed because the calling resource (ClientSession, ClientProducer, etc.) is closed. */ public final class ActiveMQObjectClosedException extends ActiveMQException { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQRemoteDisconnectException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQRemoteDisconnectException.java index 9d44b7d557b..ba89a8a3233 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQRemoteDisconnectException.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQRemoteDisconnectException.java @@ -19,7 +19,7 @@ import static org.apache.activemq.artemis.api.core.ActiveMQExceptionType.REMOTE_DISCONNECT; /** - * A security problem occurred (authentication issues, permission issues,...) + * A security problem occurred (authentication issues, permission issues, etc.) */ public final class ActiveMQRemoteDisconnectException extends ActiveMQException { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQReplicationTimeooutException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQReplicationTimeooutException.java index b0075c3d150..eebff32c40a 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQReplicationTimeooutException.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQReplicationTimeooutException.java @@ -17,8 +17,8 @@ package org.apache.activemq.artemis.api.core; /** - * The creation of a session was rejected by the server (e.g. if the server is starting and has not - * finish to be initialized. + * The creation of a session was rejected by the server (e.g. if the server is starting and has not finish to be + * initialized. */ public final class ActiveMQReplicationTimeooutException extends ActiveMQException { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQSecurityException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQSecurityException.java index da51b3836dd..4ab8f343965 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQSecurityException.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQSecurityException.java @@ -19,7 +19,7 @@ import static org.apache.activemq.artemis.api.core.ActiveMQExceptionType.SECURITY_EXCEPTION; /** - * A security problem occurred (authentication issues, permission issues,...) + * A security problem occurred (authentication issues, permission issues, etc.) */ public final class ActiveMQSecurityException extends ActiveMQException { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQSessionCreationException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQSessionCreationException.java index a2c973a4f9d..2be9bb810c9 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQSessionCreationException.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQSessionCreationException.java @@ -17,8 +17,8 @@ package org.apache.activemq.artemis.api.core; /** - * The creation of a session was rejected by the server (e.g. if the server is starting and has not - * finish to be initialized. + * The creation of a session was rejected by the server (e.g. if the server is starting and has not finish to be + * initialized. */ public final class ActiveMQSessionCreationException extends ActiveMQException { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ParameterisedAddress.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ParameterisedAddress.java index d6afbbe9727..daebf2745ad 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ParameterisedAddress.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ParameterisedAddress.java @@ -112,13 +112,11 @@ public static SimpleString extractAddress(SimpleString address) { } /** - * Given an address string, extract only the query portion if the address is - * parameterized, otherwise return an empty {@link Map}. + * Given an address string, extract only the query portion if the address is parameterized, otherwise return an empty + * {@link Map}. * - * @param address - * The address to operate on. - * - * @return a {@link Map} containing the parameters associated with the given address. + * @param address The address to operate on. + * @return a {@link Map} containing the parameters associated with the given address */ @SuppressWarnings("unchecked") public static Map extractParameters(String address) { @@ -132,13 +130,11 @@ public static Map extractParameters(String address) { } /** - * Given an address string, extract only the address portion if the address is - * parameterized, otherwise just return the provided address. - * - * @param address - * The address to operate on. + * Given an address string, extract only the address portion if the address is parameterized, otherwise just return + * the provided address. * - * @return the original address minus any appended parameters. + * @param address The address to operate on. + * @return the original address minus any appended parameters */ public static String extractAddress(String address) { final int index = address != null ? address.indexOf('?') : -1; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/QueueConfiguration.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/QueueConfiguration.java index 7f4ce79d7c3..db768d7614a 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/QueueConfiguration.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/QueueConfiguration.java @@ -114,9 +114,8 @@ public class QueueConfiguration implements Serializable { /** * Instance factory which invokes {@link #setName(SimpleString)} * - * @see #setName(SimpleString) - * * @param name the name to use for the queue + * @see #setName(SimpleString) */ public static QueueConfiguration of(final String name) { return new QueueConfiguration(name); @@ -125,16 +124,15 @@ public static QueueConfiguration of(final String name) { /** * Instance factory which invokes {@link #setName(SimpleString)} * - * @see #setName(SimpleString) - * * @param name the name to use for the queue + * @see #setName(SimpleString) */ public static QueueConfiguration of(final SimpleString name) { return new QueueConfiguration(name); } /** - * @param queueConfiguration create a copy of this + * {@return the {@code QueueConfiguration} instance which is a copy of the input parameter} */ public static QueueConfiguration of(final QueueConfiguration queueConfiguration) { return new QueueConfiguration(queueConfiguration); @@ -149,10 +147,8 @@ public QueueConfiguration() { } /** - * @deprecated - * Use {@link #of(QueueConfiguration)} instead. - * * @param o create a copy of this + * @deprecated Use {@link #of(QueueConfiguration)} instead. */ @Deprecated(forRemoval = true) public QueueConfiguration(final QueueConfiguration o) { @@ -193,12 +189,9 @@ public QueueConfiguration(final QueueConfiguration o) { /** * Instantiate this object and invoke {@link #setName(SimpleString)} * - * @see #setName(SimpleString) - * - * @deprecated - * Use {@link #of(SimpleString)} instead. - * * @param name the name to use for the queue + * @see #setName(SimpleString) + * @deprecated Use {@link #of(SimpleString)} instead. */ @Deprecated(forRemoval = true) public QueueConfiguration(SimpleString name) { @@ -208,12 +201,9 @@ public QueueConfiguration(SimpleString name) { /** * Instantiate this object and invoke {@link #setName(SimpleString)} * - * @see #setName(SimpleString) - * - * @deprecated - * Use {@link #of(String)} instead. - * * @param name the name to use for the queue + * @see #setName(SimpleString) + * @deprecated Use {@link #of(String)} instead. */ @Deprecated(forRemoval = true) public QueueConfiguration(String name) { @@ -259,7 +249,7 @@ public QueueConfiguration(String name) { * example, if you pass the value "TRUE" for the key "auto-created" the {@code String} "TRUE" will be converted to * the {@code Boolean} {@code true}. * - * @param key the key to set to the value + * @param key the key to set to the value * @param value the value to set for the key * @return this {@code QueueConfiguration} */ @@ -340,7 +330,7 @@ public QueueConfiguration setId(Long id) { } /** - * @return the name of the address; if the address is {@code null} then return the value of {@link #getName()}. + * {@return the name of the address; if the address is {@code null} then return the value of {@link #getName()}} */ public SimpleString getAddress() { return address == null ? getName() : address; @@ -366,6 +356,8 @@ public QueueConfiguration setAddress(SimpleString address) { } /** + * Converts the input {@code String} and invokes {@link #setAddress(SimpleString)} + * * @see QueueConfiguration#setAddress(SimpleString) */ public QueueConfiguration setAddress(String address) { @@ -396,6 +388,8 @@ public QueueConfiguration setName(SimpleString name) { } /** + * Converts the input {@code String} and invokes {@link #setName(SimpleString)} + * * @see QueueConfiguration#setName(SimpleString) */ public QueueConfiguration setName(String name) { @@ -442,7 +436,6 @@ public QueueConfiguration setFilterString(String filterString) { /** * defaults to {@code true} - * @return */ public Boolean isDurable() { return durable == null ? true : durable; @@ -639,7 +632,6 @@ public QueueConfiguration setRingSize(Long ringSize) { /** * defaults to {@code false} - * @return */ public Boolean isConfigurationManaged() { return configurationManaged == null ? false : configurationManaged; @@ -652,7 +644,6 @@ public QueueConfiguration setConfigurationManaged(Boolean configurationManaged) /** * defaults to {@code false} - * @return */ public Boolean isTemporary() { return temporary == null ? false : temporary; @@ -674,7 +665,6 @@ public QueueConfiguration setAutoCreateAddress(Boolean autoCreateAddress) { /** * defaults to {@code false} - * @return */ public Boolean isInternal() { return internal == null ? false : internal; @@ -687,7 +677,6 @@ public QueueConfiguration setInternal(Boolean internal) { /** * defaults to {@code false} - * @return */ public Boolean isTransient() { return _transient == null ? false : _transient; @@ -700,7 +689,6 @@ public QueueConfiguration setTransient(Boolean _transient) { /** * defaults to {@code false} - * @return */ public Boolean isAutoCreated() { return autoCreated == null ? false : autoCreated; @@ -715,7 +703,6 @@ public QueueConfiguration setAutoCreated(Boolean autoCreated) { * Based on if the name or address uses FQQN when set * * defaults to {@code false} - * @return */ public Boolean isFqqn() { return fqqn == null ? Boolean.FALSE : fqqn; @@ -834,7 +821,6 @@ public String toJSON() { * This method returns a {@code QueueConfiguration} created from the JSON-formatted input {@code String}. The input * should be a simple object of key/value pairs. Valid keys are referenced in {@link #set(String, String)}. * - * @param jsonString * @return the {@code QueueConfiguration} created from the JSON-formatted input {@code String} */ public static QueueConfiguration fromJSON(String jsonString) { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java index ef28b3466ad..8bcb0848560 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java @@ -28,8 +28,8 @@ import org.apache.activemq.artemis.utils.DataConstants; /** - * A simple String class that can store all characters, and stores as simple {@code byte[]}, this - * minimises expensive copying between String objects. + * A simple String class that can store all characters, and stores as simple {@code byte[]}, this minimises expensive + * copying between String objects. *

* This object is used heavily throughout ActiveMQ Artemis for performance reasons. */ @@ -47,7 +47,6 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl private transient String[] paths; - /** * Returns a SimpleString constructed from the {@code string} parameter. *

@@ -102,11 +101,9 @@ public static SimpleString of(final char c) { *

* If {@code string} is {@code null}, the return value will be {@code null} too. * - * @deprecated - * Use {@link #of(String)} instead. - * * @param string String used to instantiate a SimpleString. * @return A new SimpleString + * @deprecated Use {@link #of(String)} instead. */ @Deprecated(forRemoval = true) public static SimpleString toSimpleString(final String string) { @@ -118,12 +115,10 @@ public static SimpleString toSimpleString(final String string) { *

* If {@code string} is {@code null}, the return value will be {@code null} too. * - * @deprecated - * Use {@link #of(String, StringSimpleStringPool)} instead. - * * @param string String used to instantiate a SimpleString. * @param pool The pool from which to create the SimpleString * @return A new SimpleString + * @deprecated Use {@link #of(String, StringSimpleStringPool)} instead. */ @Deprecated(forRemoval = true) public static SimpleString toSimpleString(final String string, StringSimpleStringPool pool) { @@ -133,10 +128,8 @@ public static SimpleString toSimpleString(final String string, StringSimpleStrin /** * creates a SimpleString from a conventional String * - * @deprecated - * Use {@link #of(String)} instead. - * * @param string the string to transform + * @deprecated Use {@link #of(String)} instead. */ @Deprecated(forRemoval = true) public SimpleString(final String string) { @@ -164,10 +157,8 @@ public SimpleString(final String string) { /** * creates a SimpleString from a byte array * - * @deprecated - * Use {@link #of(byte[])} instead. - * * @param data the byte array to use + * @deprecated Use {@link #of(byte[])} instead. */ @Deprecated(forRemoval = true) public SimpleString(final byte[] data) { @@ -177,10 +168,8 @@ public SimpleString(final byte[] data) { /** * creates a SimpleString from a character * - * @deprecated - * Use {@link #of(char)} instead. - * * @param c the char to use + * @deprecated Use {@link #of(char)} instead. */ @Deprecated(forRemoval = true) public SimpleString(final char c) { @@ -309,19 +298,17 @@ public int compareTo(final SimpleString o) { } /** - * returns the underlying byte array of this SimpleString - * - * @return the byte array + * {@return the underlying byte array of this {@code SimpleString}} */ public byte[] getData() { return data; } /** - * returns true if the SimpleString parameter starts with the same data as this one. false if not. + * {@return {@code true} if the {@code SimpleString} parameter starts with the same data as this one, otherwise + * {@code false}} * * @param other the SimpleString to look for - * @return true if this SimpleString starts with the same data */ public boolean startsWith(final SimpleString other) { byte[] otherdata = other.data; @@ -373,9 +360,8 @@ public String toString() { } /** - * note the result of the first use is cached, the separator is configured on - * the postoffice so will be static for the duration of a server instance. - * calling with different separator values could give invalid results + * note the result of the first use is cached, the separator is configured on the postoffice so will be static for + * the duration of a server instance. calling with different separator values could give invalid results * * @param separator value from wildcardConfiguration * @return String[] reference to the split paths or the cached value if previously called @@ -417,8 +403,8 @@ public boolean equals(final Object other) { * Returns {@code true} if the {@link SimpleString} encoded content into {@code bytes} is equals to {@code s}, * {@code false} otherwise. *

- * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie starting right after the - * length field. + * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie + * starting right after the length field. */ public boolean equals(final ByteBuf byteBuf, final int offset, final int length) { return ByteUtil.equals(data, byteBuf, offset, length); @@ -438,8 +424,8 @@ public int hashCode() { } /** - * Splits this SimpleString into an array of SimpleString using the char param as the delimiter. - * i.e. "a.b" would return "a" and "b" if . was the delimiter + * Splits this SimpleString into an array of SimpleString using the char param as the delimiter. i.e. "a.b" would + * return "a" and "b" if . was the delimiter * * @param delim The delimiter to split this SimpleString on. * @return An array of SimpleStrings @@ -547,7 +533,7 @@ private static List addSimpleStringPart(List all, * checks to see if this SimpleString contains the char parameter passed in * * @param c the char to check for - * @return true if the char is found, false otherwise. + * @return true if the char is found, false otherwise */ public boolean contains(final char c) { if (this.str != null) { @@ -630,29 +616,25 @@ public SimpleString concat(final char c) { } /** - * returns the size of this SimpleString - * - * @return the size + * {@return the size of this SimpleString} */ public int sizeof() { return DataConstants.SIZE_INT + data.length; } /** - * returns the size of a SimpleString + * {@return the size of a SimpleString} * * @param str the SimpleString to check - * @return the size */ public static int sizeofString(final SimpleString str) { return str.sizeof(); } /** - * returns the size of a SimpleString which could be null + * {@return the size of a SimpleString which could be {@code null}} * * @param str the SimpleString to check - * @return the size */ public static int sizeofNullableString(final SimpleString str) { if (str == null) { @@ -663,8 +645,8 @@ public static int sizeofNullableString(final SimpleString str) { } /** - * This method performs a similar function to {@link String#getChars(int, int, char[], int)}. - * This is mainly used by the Parsers on Filters + * This method performs a similar function to {@link String#getChars(int, int, char[], int)}. This is mainly used by + * the Parsers on Filters * * @param srcBegin The srcBegin * @param srcEnd The srcEnd diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/persistence/Persister.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/persistence/Persister.java index e3b870fa738..6eed47d0852 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/persistence/Persister.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/persistence/Persister.java @@ -20,11 +20,11 @@ public interface Persister { - - /** This is to be used to store the protocol-id on Messages. - * Messages are stored on their bare format. - * The protocol manager will be responsible to code or decode messages. - * The caveat here is that the first short-sized bytes need to be this constant. */ + /** + * This is to be used to store the protocol-id on Messages. Messages are stored on their bare format. The protocol + * manager will be responsible to code or decode messages. The caveat here is that the first short-sized bytes need + * to be this constant. + */ byte getID(); int getEncodeSize(T record); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/persistence/PersisterIDs.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/persistence/PersisterIDs.java index 57440552cf6..483f0ae670b 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/persistence/PersisterIDs.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/persistence/PersisterIDs.java @@ -17,13 +17,10 @@ package org.apache.activemq.artemis.core.persistence; - - -/** this is a list for all the persisters - The sole purpose of this is to make sure these IDs will not be duplicate - so we know where to find IDs. -*/ - +/** + * This is a list for all the persisters. The sole purpose of this is to make sure these IDs will not be duplicate so we + * know where to find IDs. + */ public class PersisterIDs { public static final int MAX_PERSISTERS = 5; 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 ae7c773381e..e0438f8a7a4 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 @@ -40,7 +40,9 @@ public abstract class ActiveMQScheduledComponent implements ActiveMQComponent, R protected ScheduledExecutorService scheduledExecutorService; private boolean startedOwnScheduler; - /** initialDelay < 0 would mean no initial delay, use the period instead */ + /** + * initialDelay < 0 would mean no initial delay, use the period instead + */ private long initialDelay; private long period; private TimeUnit timeUnit; @@ -52,14 +54,17 @@ public abstract class ActiveMQScheduledComponent implements ActiveMQComponent, R private AtomicBoolean bookedForRunning; /** - * It creates a scheduled component that can trigger {@link #run()} with a fixed {@code checkPeriod} on a configured {@code executor}. + * It creates a scheduled component that can trigger {@link #run()} with a fixed {@code checkPeriod} on a configured + * {@code executor}. * - * @param scheduledExecutorService the {@link ScheduledExecutorService} that periodically trigger {@link #run()} on the configured {@code executor} + * @param scheduledExecutorService the {@link ScheduledExecutorService} that periodically trigger {@link #run()} on + * the configured {@code executor} * @param executor the {@link Executor} that execute {@link #run()} when triggered * @param initialDelay the time to delay first execution * @param checkPeriod the delay between the termination of one execution and the start of the next * @param timeUnit the time unit of the {@code initialDelay} and {@code checkPeriod} parameters - * @param onDemand if {@code true} the task won't be scheduled on {@link #start()}, {@code false} otherwise + * @param onDemand if {@code true} the task won't be scheduled on {@link #start()}, {@code false} + * otherwise */ public ActiveMQScheduledComponent(ScheduledExecutorService scheduledExecutorService, Executor executor, @@ -78,13 +83,16 @@ public ActiveMQScheduledComponent(ScheduledExecutorService scheduledExecutorServ } /** - * It creates a scheduled component that can trigger {@link #run()} with a fixed {@code checkPeriod} on a configured {@code executor}. + * It creates a scheduled component that can trigger {@link #run()} with a fixed {@code checkPeriod} on a configured + * {@code executor}. * - * @param scheduledExecutorService the {@link ScheduledExecutorService} that periodically trigger {@link #run()} on the configured {@code executor} + * @param scheduledExecutorService the {@link ScheduledExecutorService} that periodically trigger {@link #run()} on + * the configured {@code executor} * @param initialDelay the time to delay first execution * @param checkPeriod the delay between the termination of one execution and the start of the next * @param timeUnit the time unit of the {@code initialDelay} and {@code checkPeriod} parameters - * @param onDemand if {@code true} the task won't be scheduled on {@link #start()}, {@code false} otherwise + * @param onDemand if {@code true} the task won't be scheduled on {@link #start()}, {@code false} + * otherwise */ public ActiveMQScheduledComponent(ScheduledExecutorService scheduledExecutorService, long initialDelay, @@ -95,16 +103,18 @@ public ActiveMQScheduledComponent(ScheduledExecutorService scheduledExecutorServ } /** - * It creates a scheduled component that can trigger {@link #run()} with a fixed {@code checkPeriod} on a configured {@code executor}. - * + * It creates a scheduled component that can trigger {@link #run()} with a fixed {@code checkPeriod} on a configured + * {@code executor}. *

* The component created will have {@code initialDelay} defaulted to {@code checkPeriod}. * - * @param scheduledExecutorService the {@link ScheduledExecutorService} that periodically trigger {@link #run()} on the configured {@code executor} + * @param scheduledExecutorService the {@link ScheduledExecutorService} that periodically trigger {@link #run()} on + * the configured {@code executor} * @param executor the {@link Executor} that execute {@link #run()} when triggered * @param checkPeriod the delay between the termination of one execution and the start of the next * @param timeUnit the time unit of the {@code initialDelay} and {@code checkPeriod} parameters - * @param onDemand if {@code true} the task won't be scheduled on {@link #start()}, {@code false} otherwise + * @param onDemand if {@code true} the task won't be scheduled on {@link #start()}, {@code false} + * otherwise */ public ActiveMQScheduledComponent(ScheduledExecutorService scheduledExecutorService, Executor executor, @@ -115,11 +125,12 @@ public ActiveMQScheduledComponent(ScheduledExecutorService scheduledExecutorServ } /** - * It creates a scheduled component that can trigger {@link #run()} with a fixed {@code checkPeriod} on a configured {@code executor}. - * + * It creates a scheduled component that can trigger {@link #run()} with a fixed {@code checkPeriod} on a configured + * {@code executor}. *

- * This is useful for cases where we want our own scheduler executor: on {@link #start()} it will create a fresh new single-threaded {@link ScheduledExecutorService} - * using {@link #getThreadFactory()} and {@link #getThisClassLoader()}, while on {@link #stop()} it will garbage it. + * This is useful for cases where we want our own scheduler executor: on {@link #start()} it will create a fresh new + * single-threaded {@link ScheduledExecutorService} using {@link #getThreadFactory()} and + * {@link #getThisClassLoader()}, while on {@link #stop()} it will garbage it. * * @param initialDelay the time to delay first execution * @param checkPeriod the delay between the termination of one execution and the start of the next @@ -131,11 +142,12 @@ public ActiveMQScheduledComponent(long initialDelay, long checkPeriod, TimeUnit } /** - * It creates a scheduled component that can trigger {@link #run()} with a fixed {@code checkPeriod} on a configured {@code executor}. + * It creates a scheduled component that can trigger {@link #run()} with a fixed {@code checkPeriod} on a configured + * {@code executor}. * *

- * This is useful for cases where we want our own scheduler executor. - * The component created will have {@code initialDelay} defaulted to {@code checkPeriod}. + * This is useful for cases where we want our own scheduler executor. The component created will have + * {@code initialDelay} defaulted to {@code checkPeriod}. * * @param checkPeriod the delay between the termination of one execution and the start of the next * @param timeUnit the time unit of the {@code initialDelay} and {@code checkPeriod} parameters @@ -186,7 +198,7 @@ private ClassLoader getThisClassLoader() { *

  • there is no pending execution request * *

    - * When a delay request succeed it schedule a new execution to happen in {@link #getPeriod()}.
    + * When a delay request succeed it schedule a new execution to happen in {@link #getPeriod()}. */ public boolean delay() { final AtomicBoolean booked = this.bookedForRunning; 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 73c86e2976e..4d29a5e4a8d 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 @@ -39,8 +39,8 @@ import java.lang.invoke.MethodHandles; /** - * This will use {@link InetAddress#isReachable(int)} to determine if the network is alive. - * It will have a set of addresses, and if any address is reached the network will be considered alive. + * This will use {@link InetAddress#isReachable(int)} to determine if the network is alive. It will have a set of + * addresses, and if any address is reached the network will be considered alive. */ public class NetworkHealthCheck extends ActiveMQScheduledComponent { @@ -306,7 +306,7 @@ public void run() { } /** - * @return true if no checks were done or if one address/url responds; false if all addresses/urls fail + * {@return true if no checks were done or if one address/url responds; false if all addresses/urls fail} */ public boolean check() { if (isEmpty()) { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonArray.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonArray.java index 88833dec64a..af4c2d7c545 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonArray.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonArray.java @@ -33,67 +33,71 @@ * {"name":"sue", "age": 42}, * ] *

  • - * - * */ public interface JsonArray extends JsonValue, List { /** - * @return the JsonObject at the given position + * {@return the JsonObject at the given position} + * * @throws IndexOutOfBoundsException if the index is out of range - * @throws ClassCastException if the value at the specified position is not - * assignable to the JsonObject + * @throws ClassCastException if the value at the specified position is not assignable to the JsonObject */ JsonObject getJsonObject(int index); /** - * @return the JsonArray at the given position + * {@return the JsonArray at the given position} + * * @throws IndexOutOfBoundsException if the index is out of range - * @throws ClassCastException if the value at the specified position is not - * assignable to the JsonArray + * @throws ClassCastException if the value at the specified position is not assignable to the JsonArray */ JsonArray getJsonArray(int index); /** - * @return the JsonNumber at the given position + * {@return the JsonNumber at the given position} + * * @throws IndexOutOfBoundsException if the index is out of range - * @throws ClassCastException if the value at the specified position is not - * assignable to the JsonNumber + * @throws ClassCastException if the value at the specified position is not assignable to the JsonNumber */ JsonNumber getJsonNumber(int index); /** - * @return the JsonString at the given position + * {@return the JsonString at the given position} + * * @throws IndexOutOfBoundsException if the index is out of range - * @throws ClassCastException if the value at the specified position is not - * assignable to the JsonString + * @throws ClassCastException if the value at the specified position is not assignable to the JsonString */ JsonString getJsonString(int index); /** - * @return the respective JsonValue at the given position + * {@return the respective JsonValue at the given position} + * * @throws IndexOutOfBoundsException if the index is out of range - * @throws ClassCastException if the value at the specified position is not - * assignable to the given slazz + * @throws ClassCastException if the value at the specified position is not assignable to the given slazz */ List getValuesAs(Class clazz); /** - * Returns a list for the array. The value and the type of the elements - * in the list is specified by the {@code func} argument. - *

    This method can be used to obtain a list of the unwrapped types, such as - *

    {@code
    +    * Returns a {@code List} for the array. The value and the type of the elements in the list is specified by the
    +    * {@code func} argument.
    +    * 

    + * This method can be used to obtain a list of the unwrapped types, such as + *

    +    * {@code
         *     List strings = ary1.getValuesAs(JsonString::getString);
         *     List ints = ary2.getValuesAs(JsonNumber::intValue);
    -    * } 
    + * } + *
    * It can also be used to obtain a list of simple projections, such as - *
     {@code
    +    * 
    +    * {@code
         *     Lsit stringsizes = arr.getValueAs((JsonString v) -> v.getString().length();
    -    * } 
    - * @param The element type (must be a subtype of JsonValue) of this JsonArray. - * @param The element type of the returned List + * } + *
    + * + * @param The element type (must be a subtype of JsonValue) of this JsonArray. + * @param The element type of the returned List * @param func The function that maps the elements of this JsonArray to the target elements. - * @return A List of the specified values and type. + * @return A List of the specified values and type * @throws ClassCastException if the {@code JsonArray} contains a value of wrong type */ default List getValuesAs(Function func) { @@ -102,57 +106,58 @@ default List getValuesAs(Function func) { } /** - * @return the native String at the given position + * {@return the native String at the given position} + * * @throws IndexOutOfBoundsException if the index is out of range - * @throws ClassCastException if the value at the specified position is not - * assignable to a String + * @throws ClassCastException if the value at the specified position is not assignable to a String */ String getString(int index); /** - * @return the native String at the given position or the defaultValue if null + * {@return the native String at the given position or the defaultValue if null} + * * @throws IndexOutOfBoundsException if the index is out of range - * @throws ClassCastException if the value at the specified position is not - * assignable to a String + * @throws ClassCastException if the value at the specified position is not assignable to a String */ String getString(int index, String defaultValue); /** - * @return the native int value at the given position + * {@return the native int value at the given position} + * * @throws IndexOutOfBoundsException if the index is out of range - * @throws ClassCastException if the value at the specified position is not - * assignable to an int - * @throws NullPointerException if an object with the given name doesn't exist + * @throws ClassCastException if the value at the specified position is not assignable to an int + * @throws NullPointerException if an object with the given name doesn't exist */ int getInt(int index); /** - * @return the native int value at the given position or the defaultValue if null + * {@return the native int value at the given position or the defaultValue if null} + * * @throws IndexOutOfBoundsException if the index is out of range - * @throws ClassCastException if the value at the specified position is not - * assignable to an int + * @throws ClassCastException if the value at the specified position is not assignable to an int */ int getInt(int index, int defaultValue); /** - * @return the native boolean value at the given position + * {@return the native boolean value at the given position} + * * @throws IndexOutOfBoundsException if the index is out of range - * @throws ClassCastException if the value at the specified position is not - * assignable to a boolean - * @throws NullPointerException if an object with the given name doesn't exist + * @throws ClassCastException if the value at the specified position is not assignable to a boolean + * @throws NullPointerException if an object with the given name doesn't exist */ boolean getBoolean(int index); /** - * @return the native boolean value at the given position or the defaultValue if null + * {@return the native boolean value at the given position or the defaultValue if null} + * * @throws IndexOutOfBoundsException if the index is out of range - * @throws ClassCastException if the value at the specified position is not - * assignable to a boolean + * @throws ClassCastException if the value at the specified position is not assignable to a boolean */ boolean getBoolean(int index, boolean defaultValue); /** - * @return whether the value at the given position is {@link JsonValue#NULL}. + * {@return whether the value at the given position is {@link JsonValue#NULL}} + * * @throws IndexOutOfBoundsException if the index is out of range */ boolean isNull(int index); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonNumber.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonNumber.java index 5713b3257fc..22f6ffc1555 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonNumber.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonNumber.java @@ -21,7 +21,7 @@ /** * JsonValue which represents a number. - * + *

    * The decimal point is defined as dot '.'. * * @see RFC-4627 JSON Specification @@ -45,9 +45,6 @@ public interface JsonNumber extends JsonValue { BigDecimal bigDecimalValue(); - /** - * @since 1.1 - */ default Number numberValue() { throw new UnsupportedOperationException(); } diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonObject.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonObject.java index b044edd20bf..4c150bee779 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonObject.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonObject.java @@ -30,76 +30,85 @@ * } * } * - * - * A JsonObject is always also a Map which uses the attribute names as key mapping - * to their JsonValues. + *

    + * A JsonObject is always also a Map which uses the attribute names as key mapping to their JsonValues. */ public interface JsonObject extends JsonValue, Map { /** - * @return the JsonArray with the given name or {@code null} if there is no attribute with that name + * {@return the JsonArray with the given name or {@code null} if there is no attribute with that name} + * * @throws ClassCastException if the JsonValue cannot be correctly cast */ JsonArray getJsonArray(String name); /** - * @return the JsonObject with the given name or {@code null} if there is no attribute with that name + * {@return the JsonObject with the given name or {@code null} if there is no attribute with that name} + * * @throws ClassCastException if the JsonValue cannot be correctly cast */ JsonObject getJsonObject(String name); /** - * @return the JsonNumber with the given name or {@code null} if there is no attribute with that name + * {@return the JsonNumber with the given name or {@code null} if there is no attribute with that name} + * * @throws ClassCastException if the JsonValue cannot be correctly cast */ JsonNumber getJsonNumber(String name); /** - * @return the JsonString with the given name or {@code null} if there is no attribute with that name + * {@return the JsonString with the given name or {@code null} if there is no attribute with that name} + * * @throws ClassCastException if the JsonValue cannot be correctly cast */ JsonString getJsonString(String name); /** - * @return the native string with the given name or {@code null} if there is no attribute with that name + * {@return the native string with the given name or {@code null} if there is no attribute with that name} + * * @throws ClassCastException if the JsonValue cannot be correctly cast */ String getString(String name); /** - * @return the native string with the given name or the default value if there is no attribute with that name + * {@return the native string with the given name or the default value if there is no attribute with that name} + * * @throws ClassCastException if the JsonValue cannot be correctly cast */ String getString(String name, String defaultValue); /** - * @return the int with the given name or {@code null} if there is no attribute with that name - * @throws ClassCastException if the JsonValue cannot be correctly cast + * {@return the int with the given name or {@code null} if there is no attribute with that name} + * + * @throws ClassCastException if the JsonValue cannot be correctly cast * @throws NullPointerException if an object with the given name doesn't exist */ int getInt(String name); /** - * @return the int with the given name or the default value if there is no attribute with that name + * {@return the int with the given name or the default value if there is no attribute with that name} + * * @throws ClassCastException if the JsonValue cannot be correctly cast */ int getInt(String name, int defaultValue); /** - * @return the boolean with the given name or {@code null} if there is no attribute with that name - * @throws ClassCastException if the JsonValue cannot be correctly cast + * {@return the boolean with the given name or {@code null} if there is no attribute with that name} + * + * @throws ClassCastException if the JsonValue cannot be correctly cast * @throws NullPointerException if an object with the given name doesn't exist */ boolean getBoolean(String name); /** - * @return the boolean with the given name or the default value if there is no attribute with that name + * {@return the boolean with the given name or the default value if there is no attribute with that name} + * * @throws ClassCastException if the JsonValue cannot be correctly cast */ boolean getBoolean(String name, boolean defaultValue); /** - * @return whether the attribute with the given name is {@link JsonValue#NULL} + * {@return whether the attribute with the given name is {@link JsonValue#NULL}} */ boolean isNull(String name); } \ No newline at end of file diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonObjectBuilder.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonObjectBuilder.java index fa08e0c95c9..c7eaabcd3ff 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonObjectBuilder.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonObjectBuilder.java @@ -20,125 +20,135 @@ import java.math.BigInteger; /** - * A JsonObjectBuilder can be used to build {@link JsonObject JsonObjects}. - * Instances are not thread safe. - * - * Calling any of those methods with either the {@code name} or {@code value} param as {@code null} - * will result in a {@code NullPointerException} + * A JsonObjectBuilder can be used to build {@link JsonObject JsonObjects}. Instances are not thread safe. + *

    + * Calling any of those methods with either the {@code name} or {@code value} param as {@code null} will result in a + * {@code NullPointerException} */ public interface JsonObjectBuilder { + /** - * Add the given JsonValue value to the JsonObject to be created. - * If a value with that name already exists it will be replaced by the new value. - * @param name the JSON attribute name + * Add the given JsonValue value to the JsonObject to be created. If a value with that name already exists it will be + * replaced by the new value. + * + * @param name the JSON attribute name * @param value the JsonValue to add * @return the current JsonObjectBuilder */ JsonObjectBuilder add(String name, JsonValue value); /** - * Add the given String value to the JsonObject to be created. - * If a value with that name already exists it will be replaced by the new value. - * @param name the JSON attribute name + * Add the given String value to the JsonObject to be created. If a value with that name already exists it will be + * replaced by the new value. + * + * @param name the JSON attribute name * @param value the String value to add * @return the current JsonObjectBuilder */ JsonObjectBuilder add(String name, String value); + JsonObjectBuilder add(String name, String value, JsonValue defaultValue); /** - * Add the given BigInteger value to the JsonObject to be created. - * If a value with that name already exists it will be replaced by the new value. - * @param name the JSON attribute name + * Add the given BigInteger value to the JsonObject to be created. If a value with that name already exists it will + * be replaced by the new value. + * + * @param name the JSON attribute name * @param value the BigInteger value to add * @return the current JsonObjectBuilder */ JsonObjectBuilder add(String name, BigInteger value); + JsonObjectBuilder add(String name, BigInteger value, JsonValue defaultValue); /** - * Add the given BigDecimal value to the JsonObject to be created. - * If a value with that name already exists it will be replaced by the new value. - * @param name the JSON attribute name + * Add the given BigDecimal value to the JsonObject to be created. If a value with that name already exists it will + * be replaced by the new value. + * + * @param name the JSON attribute name * @param value the BigDecimal value to add * @return the current JsonObjectBuilder */ JsonObjectBuilder add(String name, BigDecimal value); + JsonObjectBuilder add(String name, BigDecimal value, JsonValue defaultValue); /** - * Add the given int value to the JsonObject to be created. - * If a value with that name already exists it will be replaced by the new value. - * @param name the JSON attribute name + * Add the given int value to the JsonObject to be created. If a value with that name already exists it will be + * replaced by the new value. + * + * @param name the JSON attribute name * @param value to add * @return the current JsonObjectBuilder */ JsonObjectBuilder add(String name, int value); /** - * Add the given long value to the JsonObject to be created. - * If a value with that name already exists it will be replaced by the new value. - * @param name the JSON attribute name + * Add the given long value to the JsonObject to be created. If a value with that name already exists it will be + * replaced by the new value. + * + * @param name the JSON attribute name * @param value to add * @return the current JsonObjectBuilder */ JsonObjectBuilder add(String name, long value); /** - * Add the given double value to the JsonObject to be created. - * If a value with that name already exists it will be replaced by the new value. - * @param name the JSON attribute name + * Add the given double value to the JsonObject to be created. If a value with that name already exists it will be + * replaced by the new value. + * + * @param name the JSON attribute name * @param value to add * @return the current JsonObjectBuilder */ JsonObjectBuilder add(String name, double value); /** - * Add the given boolean value to the JsonObject to be created. - * If a value with that name already exists it will be replaced by the new value. - * @param name the JSON attribute name + * Add the given boolean value to the JsonObject to be created. If a value with that name already exists it will be + * replaced by the new value. + * + * @param name the JSON attribute name * @param value to add * @return the current JsonObjectBuilder */ JsonObjectBuilder add(String name, boolean value); /** - * Add a {@link JsonValue#NULL} value to the JsonObject to be created. - * If a value with that name already exists it will be replaced by the null value. + * Add a {@link JsonValue#NULL} value to the JsonObject to be created. If a value with that name already exists it + * will be replaced by the null value. + * * @param name the JSON attribute name * @return the current JsonObjectBuilder */ JsonObjectBuilder addNull(String name); /** - * Use the given {@link JsonObjectBuilder} to create a {@link JsonObject} which will be - * added to the JsonObject to be created by this builder. - * If a value with that name already exists it will be replaced by the new value. - * @param name the JSON attribute name + * Use the given {@link JsonObjectBuilder} to create a {@link JsonObject} which will be added to the JsonObject to be + * created by this builder. If a value with that name already exists it will be replaced by the new value. + * + * @param name the JSON attribute name * @param builder for creating the JsonObject to add * @return the current JsonObjectBuilder */ JsonObjectBuilder add(String name, JsonObjectBuilder builder); /** - * Use the given {@link JsonArrayBuilder} to create a {@link JsonArray} which will be - * added to the JsonObject to be created by this builder. - * If a value with that name already exists it will be replaced by the new value. - * @param name the JSON attribute name + * Use the given {@link JsonArrayBuilder} to create a {@link JsonArray} which will be added to the JsonObject to be + * created by this builder. If a value with that name already exists it will be replaced by the new value. + * + * @param name the JSON attribute name * @param builder for creating the JsonArray to add * @return the current JsonObjectBuilder */ JsonObjectBuilder add(String name, JsonArrayBuilder builder); /** - * @return a {@link JsonObject} based on the added values. + * {@return a {@link JsonObject} based on the added values} */ JsonObject build(); /** * Add all of the attributes of the given {@link JsonObjectBuilder} to the current one - * - * @since 1.1 */ default JsonObjectBuilder addAll(JsonObjectBuilder builder) { throw new UnsupportedOperationException(); @@ -146,8 +156,6 @@ default JsonObjectBuilder addAll(JsonObjectBuilder builder) { /** * Remove the attribute with the given name from the builder. - * - * @since 1.1 */ default JsonObjectBuilder remove(String name) { throw new UnsupportedOperationException(); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonValue.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonValue.java index a0e54488e34..afa6feba4ef 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonValue.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/json/JsonValue.java @@ -35,7 +35,6 @@ public interface JsonValue { */ JsonArray EMPTY_JSON_ARRAY = new JsonArrayImpl(javax.json.JsonValue.EMPTY_JSON_ARRAY); - /** * A constant JsonValue for null values */ diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java index 1654d482d5a..a6daeb4da14 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/logs/AuditLogger.java @@ -65,7 +65,8 @@ static boolean isMessageLoggingEnabled() { } /** - * @return a String representing the "caller" in the format "user(role)@remoteAddress" using ThreadLocal values (if set) + * {@return a String representing the "caller" in the format "user(role)@remoteAddress" using ThreadLocal values (if + * set)} */ static String getCaller() { Subject subject = Subject.getSubject(AccessController.getContext()); @@ -76,9 +77,10 @@ static String getCaller() { } /** - * @param subject the Subject to be used instead of the corresponding ThreadLocal Subject - * @param remoteAddress the remote address to use; if null use the corresponding ThreadLocal remote address (if set) - * @return a String representing the "caller" in the format "user(role)@remoteAddress" + * {@return a {@code String} representing the "caller" in the format "user(role)@remoteAddress"} + * + * @param subject the Subject to be used instead of the corresponding ThreadLocal Subject + * @param remoteAddress the remote address to use; if null use the corresponding ThreadLocal remote address (if set) */ static String getCaller(Subject subject, String remoteAddress) { String user = "anonymous"; @@ -2131,11 +2133,7 @@ static void getPreparedTransactionMessageCount(Object source) { @LogMessage(id = 601514, value = "User {} is getting preparedTransactionMessageCount property on target resource: {}", level = LogMessage.Level.INFO) void getPreparedTransactionMessageCount(String user, Object source); - /* - * This logger is for message production and consumption and is on the hot path so enabled independently - * - * */ - //hot path log using a different logger + // This logger is for message production and consumption and is on the hot path so enabled independently static void coreSendMessage(Subject user, String remoteAddress, String messageToString, Object context, String tx) { MESSAGE_LOGGER.coreSendMessage(getCaller(user, remoteAddress), messageToString, context, tx); } @@ -2159,10 +2157,7 @@ static void coreAcknowledgeMessage(Subject user, String remoteAddress, String qu @LogMessage(id = 601502, value = "User {} acknowledged message from {}: {}, transaction: {}", level = LogMessage.Level.INFO) void coreAcknowledgeMessage(String user, String queue, String message, String tx); - /* - * This logger is focused on user interaction from the console or thru resource specific functions in the management layer/JMX - * */ - + // This logger is focused on user interaction from the console or thru resource specific functions in the management layer/JMX static void createAddressSuccess(String name, String routingTypes) { RESOURCE_LOGGER.createAddressSuccess(getCaller(), name, routingTypes); } diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractByteBufPool.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractByteBufPool.java index 162f8067149..5be6902abaa 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractByteBufPool.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractByteBufPool.java @@ -23,9 +23,9 @@ /** * Thread-safe {@code } interner. *

    - * Differently from {@link String#intern()} it contains a fixed amount of entries and - * when used by concurrent threads it doesn't ensure the uniqueness of the entries ie - * the same entry could be allocated multiple times by concurrent calls. + * Differently from {@link String#intern()} it contains a fixed amount of entries and when used by concurrent threads it + * doesn't ensure the uniqueness of the entries ie the same entry could be allocated multiple times by concurrent + * calls. */ public abstract class AbstractByteBufPool { @@ -47,8 +47,8 @@ public AbstractByteBufPool(final int capacity) { } /** - * Batch hash code implementation that works at its best if {@code bytes} - * contains a {@link org.apache.activemq.artemis.api.core.SimpleString} encoded. + * Batch hash code implementation that works at its best if {@code bytes} contains a + * {@link org.apache.activemq.artemis.api.core.SimpleString} encoded. */ private static int hashCode(final ByteBuf bytes, final int offset, final int length) { if (PlatformDependent.isUnaligned() && PlatformDependent.hasUnsafe()) { @@ -110,8 +110,8 @@ private static int byteBufHashCode(final ByteBuf byteBuf, final int offset, fina } /** - * Returns {@code true} if {@code length}'s {@code byteBuf} content from {@link ByteBuf#readerIndex()} can be pooled, - * {@code false} otherwise. + * {@return {@code true} if {@code length}'s {@code byteBuf} content from {@link ByteBuf#readerIndex()} can be + * pooled, {@code false} otherwise} */ protected abstract boolean canPool(ByteBuf byteBuf, int length); @@ -121,8 +121,8 @@ private static int byteBufHashCode(final ByteBuf byteBuf, final int offset, fina protected abstract T create(ByteBuf byteBuf, int length); /** - * Returns {@code true} if the {@code entry} content is the same of {@code byteBuf} at the specified {@code offset} - * and {@code length} {@code false} otherwise. + * {@return {@code true} if the {@code entry} content is the same of {@code byteBuf} at the specified {@code offset} + * and {@code length} {@code false} otherwise} */ protected abstract boolean isEqual(T entry, ByteBuf byteBuf, int offset, int length); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractPool.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractPool.java index 666f4abb5d4..5978031dfbd 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractPool.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractPool.java @@ -22,9 +22,9 @@ /** * Thread-safe {@code } interner. *

    - * Differently from {@link String#intern()} it contains a fixed amount of entries and - * when used by concurrent threads it doesn't ensure the uniqueness of the entries ie - * the same entry could be allocated multiple times by concurrent calls. + * Differently from {@link String#intern()} it contains a fixed amount of entries and when used by concurrent threads it + * doesn't ensure the uniqueness of the entries ie the same entry could be allocated multiple times by concurrent + * calls. */ public abstract class AbstractPool { @@ -51,7 +51,7 @@ public AbstractPool(final int capacity) { protected abstract O create(I value); /** - * Returns {@code true} if the {@code entry} content is equal to {@code value}; + * {@return {@code true} if the {@code entry} content is equal to {@code value};} */ protected abstract boolean isEqual(O entry, I value); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ActiveMQThreadFactory.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ActiveMQThreadFactory.java index b9c3c28342a..6edeaf5348f 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ActiveMQThreadFactory.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ActiveMQThreadFactory.java @@ -42,8 +42,8 @@ public final class ActiveMQThreadFactory implements ThreadFactory { private final String prefix; /** - * Construct a new instance. The access control context of the calling thread will be the one used to create - * new threads if a security manager is installed. + * Construct a new instance. The access control context of the calling thread will be the one used to create new + * threads if a security manager is installed. * * @param groupName the name of the thread group to assign threads to by default * @param daemon whether the created threads should be daemon threads @@ -54,8 +54,8 @@ public ActiveMQThreadFactory(final String groupName, final boolean daemon, final } /** - * Construct a new instance. The access control context of the calling thread will be the one used to create - * new threads if a security manager is installed. + * Construct a new instance. The access control context of the calling thread will be the one used to create new + * threads if a security manager is installed. * * @param groupName the name of the thread group to assign threads to by default * @param daemon whether the created threads should be daemon threads @@ -99,7 +99,9 @@ public Thread run() { } } - /** It will wait all threads to finish */ + /** + * It will wait all threads to finish + */ public boolean join(int timeout, TimeUnit timeUnit) { try { return active.await(timeout, timeUnit); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ArtemisCloseable.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ArtemisCloseable.java index c6d3830ab28..f21921ce4c7 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ArtemisCloseable.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ArtemisCloseable.java @@ -18,7 +18,9 @@ public interface ArtemisCloseable extends AutoCloseable { - /** The main purpose of this interface is to hide the exception since it is not needed. */ + /** + * The main purpose of this interface is to hide the exception since it is not needed. + */ @Override void close(); } diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AutomaticLatch.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AutomaticLatch.java index 36e5f8522c7..66d95f7b85c 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AutomaticLatch.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AutomaticLatch.java @@ -16,11 +16,11 @@ */ package org.apache.activemq.artemis.utils; -/** An automatic latch has the same semantic as the ReusableLatch - * However this class has a replaceable callback that could be called - * when the number of elements reach zero. - * With that you can either block to wait completion, or to send a callback to be - * used when it reaches 0. */ +/** + * An automatic latch has the same semantic as the ReusableLatch However this class has a replaceable callback that + * could be called when the number of elements reach zero. With that you can either block to wait completion, or to send + * a callback to be used when it reaches 0. + */ public class AutomaticLatch extends AbstractLatch { volatile Runnable afterCompletion; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ByteUtil.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ByteUtil.java index 0472598e739..53aace6c86a 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ByteUtil.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ByteUtil.java @@ -120,7 +120,9 @@ public static String bytesToHex(byte[] bytes) { return new String(hexChars); } - /** Simplify reading of a byte array in a programmers understable way */ + /** + * Simplify reading of a byte array in a programmers understable way + */ public static String debugByteArray(byte[] byteArray) { StringWriter builder = new StringWriter(); PrintWriter writer = new PrintWriter(builder); @@ -390,7 +392,8 @@ private static boolean equalsUnsafe(final byte[] left, } /** - * This ensure a more exact resizing then {@link ByteBuf#ensureWritable(int)}, if needed.
    + * This ensure a more exact resizing then {@link ByteBuf#ensureWritable(int)}, if needed. + *

    * It won't try to trim a large enough buffer. */ public static void ensureExactWritable(ByteBuf buffer, int minWritableBytes) { @@ -399,13 +402,12 @@ public static void ensureExactWritable(ByteBuf buffer, int minWritableBytes) { } } - /** - * Returns {@code true} if the {@link SimpleString} encoded content into {@code bytes} is equals to {@code s}, + * {@return {@code true} if the {@link SimpleString} encoded content into {@code bytes} is equals to {@code s} * {@code false} otherwise. *

    - * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie starting right after the - * length field. + * It assumes that the {@code bytes} content is read using {@link SimpleString#readSimpleString(ByteBuf, int)} ie + * starting right after the length field.} */ public static boolean equals(final byte[] bytes, final ByteBuf byteBuf, final int offset, final int length) { if (bytes.length != length) @@ -479,7 +481,8 @@ public static void zeros(final ByteBuffer buffer) { /** * It zeroes {@code bytes} of the given {@code buffer}, starting (inclusive) from {@code offset}. * - * @throws IndexOutOfBoundsException if {@code offset + bytes > }{@link ByteBuffer#capacity()} or {@code offset >= }{@link ByteBuffer#capacity()} + * @throws IndexOutOfBoundsException if {@code offset + bytes > }{@link ByteBuffer#capacity()} or + * {@code offset >= }{@link ByteBuffer#capacity()} * @throws IllegalArgumentException if {@code offset} or {@code capacity} are less then 0 * @throws ReadOnlyBufferException if {@code buffer} is read-only */ 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 2a4019947f4..14769a6204e 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 @@ -25,12 +25,11 @@ import java.lang.invoke.MethodHandles; /** - * This class will be used to perform generic class-loader operations, - * such as load a class first using TCCL, and then the classLoader used by ActiveMQ Artemis (ClassloadingUtil.getClass().getClassLoader()). + * This class will be used to perform generic class-loader operations, such as load a class first using TCCL, and then + * the classLoader used by ActiveMQ Artemis (ClassloadingUtil.getClass().getClassLoader()). *

    * Is't required to use a Security Block on any calls to this class. */ - public final class ClassloadingUtil { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ConcurrentUtil.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ConcurrentUtil.java index db2b86fc0dc..bddc29f5004 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ConcurrentUtil.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ConcurrentUtil.java @@ -24,8 +24,9 @@ public class ConcurrentUtil { /** * Await for condition, handling * spurious wakeups. + * * @param condition condition to await for - * @param timeout the maximum time to wait in milliseconds + * @param timeout the maximum time to wait in milliseconds * @return value from {@link Condition#await(long, TimeUnit)} */ public static boolean await(final Condition condition, final long timeout) throws InterruptedException { 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 bb25d3347a7..9a1d32e0659 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 @@ -39,15 +39,12 @@ /** * A DefaultSensitiveDataCodec - * - * The default implementation of SensitiveDataCodec. - * This class is used when the user indicates in the config - * file to use a masked password but doesn't give a - * codec implementation. - * - * It supports one-way hash (digest) and two-way (encrypt-decrpt) algorithms - * The two-way uses "Blowfish" algorithm - * The one-way uses "PBKDF2" hash algorithm + *

    + * The default implementation of SensitiveDataCodec. This class is used when the user indicates in the config file to + * use a masked password but doesn't give a codec implementation. + *

    + * It supports one-way hash (digest) and two-way (encrypt-decrpt) algorithms The two-way uses "Blowfish" algorithm The + * one-way uses "PBKDF2" hash algorithm */ public class DefaultSensitiveStringCodec implements SensitiveDataCodec { @@ -94,10 +91,7 @@ public void init(Map params) throws Exception { } /** - * This main class is as documented on configuration-index.md, where the user can mask the password here. * - * - * @param args - * @throws Exception + * This main class is as documented on configuration-index.md, where the user can mask the password here. */ public static void main(String[] args) throws Exception { if (args.length != 1) { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Env.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Env.java index df9d24d4434..e78f43b9010 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Env.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Env.java @@ -20,8 +20,8 @@ import java.lang.reflect.Field; /** - * Utility that detects various properties specific to the current runtime - * environment, such as JVM bitness and OS type. + * Utility that detects various properties specific to the current runtime environment, such as JVM bitness and OS + * type. */ public final class Env { @@ -51,10 +51,9 @@ public final class Env { } /** - * The system will change a few logs and semantics to be suitable to - * run a long testsuite. - * Like a few log entries that are only valid during a production system. - * or a few cases we need to know as warn on the testsuite and as log in production. + * The system will change a few logs and semantics to be suitable to run a long testsuite. Like a few log entries + * that are only valid during a production system. or a few cases we need to know as warn on the testsuite and as log + * in production. */ private static boolean testEnv = false; @@ -68,8 +67,7 @@ private Env() { } /** - * Return the size in bytes of a OS memory page. - * This value will always be a power of two. + * Return the size in bytes of a OS memory page. This value will always be a power of two. */ public static int osPageSize() { return OS_PAGE_SIZE; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/FactoryFinder.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/FactoryFinder.java index 619a937a15e..2373d5748f6 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/FactoryFinder.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/FactoryFinder.java @@ -27,18 +27,19 @@ public class FactoryFinder { /** - * The strategy that the FactoryFinder uses to find load and instantiate Objects - * can be changed out by calling the setObjectFactory method with a custom implementation of ObjectFactory. - * - * The default ObjectFactory is typically changed out when running in a specialized container - * environment where service discovery needs to be done via the container system. For example, - * in an OSGi scenario. + * The strategy that the FactoryFinder uses to find load and instantiate Objects can be changed out by calling the + * setObjectFactory method with a custom implementation of ObjectFactory. + *

    + * The default ObjectFactory is typically changed out when running in a specialized container environment where + * service discovery needs to be done via the container system. For example, in an OSGi scenario. */ public interface ObjectFactory { /** + * Creates an {@code Object} based on the input + * * @param path the full service path - * @return Object + * @return {@code Object} * @throws IllegalAccessException illegal access * @throws InstantiationException on instantiation error * @throws IOException On IO Error @@ -139,8 +140,7 @@ public FactoryFinder(String path) { /** * Creates a new instance of the given key * - * @param key is the key to add to the path to find a text file containing - * the factory name + * @param key is the key to add to the path to find a text file containing the factory name * @return a newly created instance * @throws IllegalAccessException On illegal access * @throws InstantiationException On can not instantiate exception diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/FileUtil.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/FileUtil.java index 68333f24fd8..d01bb705d21 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/FileUtil.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/FileUtil.java @@ -108,15 +108,13 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO }); } - /** * Search and replace strings on a file * - * @param file file to be replaced - * @param find string expected to match + * @param file file to be replaced + * @param find string expected to match * @param replace string to be replaced * @return true if the replacement was successful - * @throws Exception */ public static boolean findReplace(File file, String find, String replace) throws Exception { if (!file.exists()) { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/HashProcessor.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/HashProcessor.java index 0b441322968..5aadf12949f 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/HashProcessor.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/HashProcessor.java @@ -24,18 +24,18 @@ public interface HashProcessor { /** * produce hash text from plain text + * * @param plainText Plain text input * @return the Hash value of the input plain text - * @throws Exception */ String hash(String plainText) throws Exception; /** * compare the plain char array against the hash value + * * @param inputValue value of the plain text * @param storedHash the existing hash value - * @return true if the char array matches the hash value, - * otherwise false. + * @return true if the char array matches the hash value, otherwise false. */ boolean compare(char[] inputValue, String storedHash); } diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/IPV6Util.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/IPV6Util.java index 22535c693c5..8dffd1466ae 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/IPV6Util.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/IPV6Util.java @@ -26,7 +26,8 @@ public static String encloseHost(final String host) { if (host != null && host.contains(":")) { String hostToCheck = host; - /* strip off zone index since com.google.common.net.InetAddresses.isInetAddress() doesn't support it + /* + * strip off zone index since com.google.common.net.InetAddresses.isInetAddress() doesn't support it * see https://en.wikipedia.org/wiki/IPv6_address#Link-local_addresses_and_zone_indices for more info */ if (host.contains("%")) { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/JsonLoader.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/JsonLoader.java index ab0490a2147..6ff1f04129e 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/JsonLoader.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/JsonLoader.java @@ -30,8 +30,8 @@ import java.io.Reader; /** - * This is to make sure we use the proper classLoader to load JSon libraries. - * This is equivalent to using {@link javax.json.Json} + * This is to make sure we use the proper classLoader to load JSon libraries. This is equivalent to using + * {@link javax.json.Json} */ public class JsonLoader { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PasswordMaskingUtil.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PasswordMaskingUtil.java index ed668f97d29..42f752875cf 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PasswordMaskingUtil.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PasswordMaskingUtil.java @@ -38,11 +38,11 @@ private PasswordMaskingUtil() { /** * This method deals with password masking and returns the password in its plain text form. - * @param password : the original value of password string; interpreted as masked if wrapped in ENC() - * or as plain text otherwise. - * @param codecClass : the codec used to decode the password. Only when the password is interpreted - * as masked will this codec be used. Ignored otherwise. - * @return + * + * @param password : the original value of password string; interpreted as masked if wrapped in ENC() or as plain + * text otherwise. + * @param codecClass : the codec used to decode the password. Only when the password is interpreted as masked will + * this codec be used. Ignored otherwise. */ public static String resolveMask(String password, String codecClass) throws Exception { return resolveMask(null, password, codecClass); @@ -50,14 +50,13 @@ public static String resolveMask(String password, String codecClass) throws Exce /** * This method deals with password masking and returns the password in its plain text form. - * @param maskPassword : explicit mask flag. If it's true, the password is interpreted as - * masked. If it is false, the password is interpreted as plain text. - * if it is null, the password will be interpreted as masked if the - * password is wrapped in ENC(), or as plain text otherwise. - * @param password : the original value of password string - * @param codecClass : the codec used to decode the password. Only when the password is interpreted - * as masked will this codec be used. Ignored otherwise. - * @return + * + * @param maskPassword : explicit mask flag. If it's true, the password is interpreted as masked. If it is false, the + * password is interpreted as plain text. if it is null, the password will be interpreted as + * masked if the password is wrapped in ENC(), or as plain text otherwise. + * @param password : the original value of password string + * @param codecClass : the codec used to decode the password. Only when the password is interpreted as masked will + * this codec be used. Ignored otherwise. */ public static String resolveMask(Boolean maskPassword, String password, String codecClass) throws Exception { String plainText = password; @@ -155,14 +154,12 @@ public static HashProcessor getHashProcessor() { return processor; } - /* + /** * Loading the codec class. * * @param codecDesc This parameter must have the following format: - * - * ;key=value;key1=value1;... - * - * Where only is required. key/value pairs are optional + * {@code ;key=value;key1=value1;...} where only + * {@code } is required. key/value pairs are optional */ public static SensitiveDataCodec getCodec(String codecDesc) throws ActiveMQException { SensitiveDataCodec codecInstance; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PendingTask.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PendingTask.java index 4a42aba3cac..7aed97f1c69 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PendingTask.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PendingTask.java @@ -17,9 +17,8 @@ package org.apache.activemq.artemis.utils; /** - * This is similar to a Runnable, except that we throw exceptions. - * In certain places we need to complete tasks after deliveries, - * and this will take care of those situations. + * This is similar to a Runnable, except that we throw exceptions. In certain places we need to complete tasks after + * deliveries, and this will take care of those situations. */ public abstract class PendingTask { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PowerOf2Util.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PowerOf2Util.java index fd604027592..2863d9e7d56 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PowerOf2Util.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/PowerOf2Util.java @@ -25,9 +25,11 @@ private PowerOf2Util() { } /** - * Fast alignment operation with power of 2 {@code alignment} and {@code value >=0} and {@code value <}{@link Integer#MAX_VALUE}.
    - * In order to be fast is up to the caller to check arguments correctness. - * Original algorithm is on https://en.wikipedia.org/wiki/Data_structure_alignment. + * Fast alignment operation with power of 2 {@code alignment} and {@code value >=0} and + * {@code value <}{@link Integer#MAX_VALUE}. + *

    + * In order to be fast is up to the caller to check arguments correctness. Original algorithm is on + * https://en.wikipedia.org/wiki/Data_structure_alignment. */ public static int align(final int value, final int pow2alignment) { return (value + (pow2alignment - 1)) & ~(pow2alignment - 1); @@ -37,7 +39,7 @@ public static int align(final int value, final int pow2alignment) { * Is a value a positive power of two. * * @param value to be checked. - * @return true if the number is a positive power of two otherwise false. + * @return true if the number is a positive power of two otherwise false */ public static boolean isPowOf2(final int value) { return Integer.bitCount(value) == 1; @@ -48,7 +50,7 @@ public static boolean isPowOf2(final int value) { * * @param value to be tested. * @param pow2alignment boundary the address is tested against. - * @return true if the address is on the aligned boundary otherwise false. + * @return true if the address is on the aligned boundary otherwise false * @throws IllegalArgumentException if the alignment is not a power of 2 */ public static boolean isAligned(final long value, final int pow2alignment) { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Preconditions.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Preconditions.java index 02d4fc55a15..5252133fe52 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Preconditions.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Preconditions.java @@ -31,12 +31,13 @@ public static T checkNotNull(T reference) { } return reference; } + /** * Ensures the truth of an expression involving one or more parameters to the calling method. * - * @param expression a boolean expression - * @param errorMessage the exception message to use if the check fails; will be converted to a - * string using {@link String#valueOf(Object)} + * @param expression a boolean expression + * @param errorMessage the exception message to use if the check fails; will be converted to a string using + * {@link String#valueOf(Object)} * @throws IllegalArgumentException if {@code expression} is false */ public static void checkArgument(boolean expression, Object errorMessage) { @@ -48,17 +49,17 @@ public static void checkArgument(boolean expression, Object errorMessage) { /** * Ensures the truth of an expression involving one or more parameters to the calling method. * - * @param expression a boolean expression - * @param errorMessageTemplate a template for the exception message should the check fail. The - * message is formed by replacing each {@code %s} placeholder in the template with an - * argument. These are matched by position - the first {@code %s} gets {@code - * errorMessageArgs[0]}, etc. Unmatched arguments will be appended to the formatted message - * in square braces. Unmatched placeholders will be left as-is. - * @param errorMessageArgs the arguments to be substituted into the message template. Arguments - * are converted to strings using {@link String#valueOf(Object)}. + * @param expression a boolean expression + * @param errorMessageTemplate a template for the exception message should the check fail. The message is formed by + * replacing each {@code %s} placeholder in the template with an argument. These are + * matched by position - the first {@code %s} gets {@code errorMessageArgs[0]}, etc. + * Unmatched arguments will be appended to the formatted message in square braces. + * Unmatched placeholders will be left as-is. + * @param errorMessageArgs the arguments to be substituted into the message template. Arguments are converted to + * strings using {@link String#valueOf(Object)}. * @throws IllegalArgumentException if {@code expression} is false - * @throws NullPointerException if the check fails and either {@code errorMessageTemplate} or - * {@code errorMessageArgs} is null (don't let this happen) + * @throws NullPointerException if the check fails and either {@code errorMessageTemplate} or + * {@code errorMessageArgs} is null (don't let this happen) */ public static void checkArgument( boolean expression, diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/RandomUtil.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/RandomUtil.java index 03a928f29b8..8e883892135 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/RandomUtil.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/RandomUtil.java @@ -47,6 +47,7 @@ public static Random getRandom() { *

  • ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • *
  • 0123456789
  • * + * * @param length how long the returned {@code String} should be * @return a {@code String} of random alpha-numeric characters */ @@ -59,14 +60,14 @@ public static String randomAlphaNumericString(int length) { } /** - * @return A randomly generated {@link java.util.UUID} converted to a {@code String} + * {@return A randomly generated {@link java.util.UUID} converted to a {@code String}} */ public static String randomUUIDString() { return java.util.UUID.randomUUID().toString(); } /** - * @return A randomly generated {@link java.util.UUID} converted to a {@link SimpleString} + * {@return A randomly generated {@link java.util.UUID} converted to a {@link SimpleString}} */ public static SimpleString randomUUIDSimpleString() { return SimpleString.of(RandomUtil.randomUUIDString()); @@ -79,6 +80,7 @@ public static SimpleString randomUUIDSimpleString() { *
  • ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • *
  • 0123456789
  • * + * * @return A randomly generated alpha-numeric {@code char} */ public static char randomChar() { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReferenceCounter.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReferenceCounter.java index 423b6b4fcfe..b9adeb99f7f 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReferenceCounter.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReferenceCounter.java @@ -30,9 +30,9 @@ public interface ReferenceCounter { Runnable getTask(); /** - * Some asynchronous operations (like ack) may delay certain conditions. - * After met, during afterCompletion we may need to recheck certain values - * to make sure we won't get into a situation where the condition was met asynchronously and queues not removed. + * Some asynchronous operations (like ack) may delay certain conditions. After met, during afterCompletion we may + * need to recheck certain values to make sure we won't get into a situation where the condition was met + * asynchronously and queues not removed. */ void check(); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReferenceCounterUtil.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReferenceCounterUtil.java index 89494d7f336..f739186ddc5 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReferenceCounterUtil.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReferenceCounterUtil.java @@ -76,7 +76,9 @@ public int decrement() { return value; } - /** it will set the value all the way to 0, and execute the task meant for when the value was 0. */ + /** + * it will set the value all the way to 0, and execute the task meant for when the value was 0. + */ public void exhaust() { execute(); useUpdater.set(this, 0); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReusableLatch.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReusableLatch.java index 4b28b63be4f..8d8414d9eb4 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReusableLatch.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ReusableLatch.java @@ -17,18 +17,23 @@ package org.apache.activemq.artemis.utils; /** - *

    This class will use the framework provided to by AbstractQueuedSynchronizer.

    - *

    AbstractQueuedSynchronizer is the framework for any sort of concurrent synchronization, such as Semaphores, events, etc, based on AtomicIntegers.

    - * - *

    This class works just like CountDownLatch, with the difference you can also increase the counter

    - * - *

    It could be used for sync points when one process is feeding the latch while another will wait when everything is done. (e.g. waiting IO completions to finish)

    - * - *

    On ActiveMQ Artemis we have the requirement of increment and decrement a counter until the user fires a ready event (commit). At that point we just act as a regular countDown.

    - * - *

    Note: This latch is reusable. Once it reaches zero, you can call up again, and reuse it on further waits.

    - * - *

    For example: prepareTransaction will wait for the current completions, and further adds will be called on the latch. Later on when commit is called you can reuse the same latch.

    + * This class will use the framework provided to by AbstractQueuedSynchronizer. + *

    + * AbstractQueuedSynchronizer is the framework for any sort of concurrent synchronization, such as Semaphores, events, + * etc, based on AtomicIntegers. + *

    + * This class works just like CountDownLatch, with the difference you can also increase the counter + *

    + * It could be used for sync points when one process is feeding the latch while another will wait when everything is + * done. (e.g. waiting IO completions to finish) + *

    + * On ActiveMQ Artemis we have the requirement of increment and decrement a counter until the user fires a ready event + * (commit). At that point we just act as a regular countDown. + *

    + * Note: This latch is reusable. Once it reaches zero, you can call up again, and reuse it on further waits. + *

    + * For example: prepareTransaction will wait for the current completions, and further adds will be called on the latch. + * Later on when commit is called you can reuse the same latch. */ public class ReusableLatch extends AbstractLatch { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SelectorTranslator.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SelectorTranslator.java index 65a7ab2c467..e8c6947807f 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SelectorTranslator.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SelectorTranslator.java @@ -21,15 +21,15 @@ /** * This class converts a JMS selector expression into an ActiveMQ Artemis core filter expression. - * + *

    * JMS selector and ActiveMQ Artemis filters use the same syntax but have different identifiers. - * - * We basically just need to replace the JMS header and property Identifier names - * with the corresponding ActiveMQ Artemis field and header Identifier names. - * - * We must be careful not to substitute any literals, or identifiers whose name contains the name - * of one we want to substitute. - * + *

    + * We basically just need to replace the JMS header and property Identifier names with the corresponding ActiveMQ + * Artemis field and header Identifier names. + *

    + * We must be careful not to substitute any literals, or identifiers whose name contains the name of one we want to + * substitute. + *

    * This makes it less trivial than a simple search and replace. */ public class SelectorTranslator { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SensitiveDataCodec.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SensitiveDataCodec.java index 015af65c0f4..46d6772051d 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SensitiveDataCodec.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SensitiveDataCodec.java @@ -20,9 +20,9 @@ /** * A SensitiveDataCodec - * + *

    * This interface is used for implementing a value decoder. - * + *

    * It takes in a mask value and decode it. */ public interface SensitiveDataCodec { 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 e1b7bf3a45f..1b2c6fd238d 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 @@ -56,7 +56,9 @@ public interface AddCallback { private Runnable underCallback; - /** To be used in a case where we just measure elements */ + /** + * To be used in a case where we just measure elements + */ public SizeAwareMetric() { } diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SpawnedVMSupport.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SpawnedVMSupport.java index da1e8b9a09b..c0781c24c55 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SpawnedVMSupport.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SpawnedVMSupport.java @@ -154,20 +154,9 @@ public static String getClassPath(File libfolder) { } /** - * @param classPath - * @param wordMatch - * @param wordRunning - * @param className - * @param memoryArg1 - * @param memoryArg2 - * @param vmargs - * @param logOutput - * @param logErrorOutput - * @param debugPort if <=0 it means no debug - * @param args - * @return - * @throws IOException - * @throws ClassNotFoundException + * Spawns a VM + * + * @param debugPort if <=0 it means no debug {@return a {@code Process} based on the input parameters} */ public static Process spawnVM(String classPath, String wordMatch, @@ -238,16 +227,13 @@ public static void spawnLoggers(String wordMatch, Process process) throws ClassNotFoundException { SpawnedVMSupport.startLogger(logOutput, wordMatch, wordRunning, className, process); - // Adding a reader to System.err, so the VM won't hang on a System.err.println as identified on this forum thread: - // http://www.jboss.org/index.html?module=bb&op=viewtopic&t=151815 + // Adding a reader to System.err, so the VM won't hang on a System.err.println ProcessLogger errorLogger = new ProcessLogger(logErrorOutput, process.getErrorStream(), className, wordMatch, wordRunning); errorLogger.start(); } /** * it will return a pair of dead / alive servers - * - * @return */ private static Set getAliveProcesses() { @@ -315,11 +301,6 @@ public static boolean checkProcess() { return true; } - /** - * @param className - * @param process - * @throws ClassNotFoundException - */ public static void startLogger(final boolean print, final String wordMatch, final Runnable wordRunanble, @@ -329,11 +310,6 @@ public static void startLogger(final boolean print, outputLogger.start(); } - /** - * @param className - * @param process - * @throws ClassNotFoundException - */ public static void startLogger(final String className, final Process process) throws ClassNotFoundException { startLogger(true, null, null, className, process); } @@ -351,8 +327,7 @@ static class ProcessLogger extends Thread { private final String wordMatch; /** - * This will be executed when wordMatch is within any line on the log * - * * + * This will be executed when wordMatch is within any line on the log */ private final Runnable wordRunner; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/StringEscapeUtils.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/StringEscapeUtils.java index db18e30f75d..65f72d649e5 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/StringEscapeUtils.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/StringEscapeUtils.java @@ -24,8 +24,7 @@ public abstract class StringEscapeUtils { /** * Adapted from commons lang StringEscapeUtils, escapes a string * - * @param str - * @return an escaped version of the input string. + * @return an escaped version of the input string */ public static String escapeString(String str) { if (str == null) { @@ -92,11 +91,11 @@ public static String escapeString(String str) { } /** - *

    Returns an upper case hexadecimal String for the given + *

    Returns an upper case hexadecimal {@code String} for the given * character.

    * * @param ch The character to convert. - * @return An upper case hexadecimal String + * @return An upper case hexadecimal {@code String} */ private static String hex(char ch) { return Integer.toHexString(ch).toUpperCase(); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Suppliers.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Suppliers.java index c184f097274..023f9d73962 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Suppliers.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Suppliers.java @@ -27,18 +27,15 @@ public class Suppliers { /** - * Returns a supplier which caches the instance retrieved during the first - * call to {@code get()} and returns that value on subsequent calls to - * {@code get()}. See: + * Returns a supplier which caches the instance retrieved during the first call to {@code get()} and returns that + * value on subsequent calls to {@code get()}. See: * memoization - * - *

    The returned supplier is thread-safe. The delegate's {@code get()} - * method will be invoked at most once. The supplier's serialized form does - * not contain the cached value, which will be recalculated when {@code get()} - * is called on the reserialized instance. - * - *

    If {@code delegate} is an instance created by an earlier call to {@code - * memoize}, it is returned directly. + *

    + * The returned supplier is thread-safe. The delegate's {@code get()} method will be invoked at most once. The + * supplier's serialized form does not contain the cached value, which will be recalculated when {@code get()} is + * called on the reserialized instance. + *

    + * If {@code delegate} is an instance created by an earlier call to {@code memoize}, it is returned directly. */ public static Supplier memoize(Supplier delegate) { return (delegate instanceof MemoizingSupplier) diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/TimeUtils.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/TimeUtils.java index c9c5a55a202..1197fbba1ef 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/TimeUtils.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/TimeUtils.java @@ -22,9 +22,6 @@ import java.text.NumberFormat; import java.util.Locale; -/** - * Time utils. - */ public final class TimeUtils { private TimeUtils() { 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 b6cb93e047e..9a11f542ab3 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 @@ -29,7 +29,7 @@ /** * A UTF8Util - * + *

    * This class will write UTFs directly to the ByteOutput (through the MessageBuffer interface) */ public final class UTF8Util { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUID.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUID.java index 716267a9469..187785972f7 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUID.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUID.java @@ -17,29 +17,23 @@ package org.apache.activemq.artemis.utils; /** - * UUID represents Universally Unique Identifiers (aka Global UID in Windows - * world). UUIDs are usually generated via UUIDGenerator (or in case of 'Null - * UUID', 16 zero bytes, via static method getNullUUID()), or received from - * external systems. + * UUID represents Universally Unique Identifiers (aka Global UID in Windows world). UUIDs are usually generated via + * UUIDGenerator (or in case of 'Null UUID', 16 zero bytes, via static method getNullUUID()), or received from external + * systems. *

    - * By default class caches the string presentations of UUIDs so that description - * is only created the first time it's needed. For memory stingy applications - * this caching can be turned off (note though that if uuid.toString() is never - * called, desc is never calculated so only loss is the space allocated for the - * desc pointer... which can of course be commented out to save memory). + * By default class caches the string presentations of UUIDs so that description is only created the first time it's + * needed. For memory stingy applications this caching can be turned off (note though that if uuid.toString() is never + * called, desc is never calculated so only loss is the space allocated for the desc pointer... which can of course be + * commented out to save memory). *

    - * Similarly, hash code is calculated when it's needed for the first time, and - * from thereon that value is just returned. This means that using UUIDs as keys - * should be reasonably efficient. + * Similarly, hash code is calculated when it's needed for the first time, and from thereon that value is just returned. + * This means that using UUIDs as keys should be reasonably efficient. *

    - * UUIDs can be compared for equality, serialized, cloned and even sorted. - * Equality is a simple bit-wise comparison. Ordering (for sorting) is done by - * first ordering based on type (in the order of numeric values of types), - * secondarily by time stamp (only for time-based time stamps), and finally by - * straight numeric byte-by-byte comparison (from most to least significant - * bytes). + * UUIDs can be compared for equality, serialized, cloned and even sorted. Equality is a simple bit-wise comparison. + * Ordering (for sorting) is done by first ordering based on type (in the order of numeric values of types), secondarily + * by time stamp (only for time-based time stamps), and finally by straight numeric byte-by-byte comparison (from most + * to least significant bytes). */ - public final class UUID { private static final String kHexChars = "0123456789abcdefABCDEF"; @@ -67,9 +61,7 @@ public final class UUID { public static final byte TYPE_RANDOM_BASED = 4; - /* - * 'Standard' namespaces defined (suggested) by UUID specs: - */ + // 'Standard' namespaces defined (suggested) by UUID specs: public static final String NAMESPACE_DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; public static final String NAMESPACE_URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; @@ -113,7 +105,9 @@ private UUID(final byte[] data) { mId = data; } - /** This is for conversions between two types of UUID */ + /** + * This is for conversions between two types of UUID + */ public UUID(java.util.UUID uuid) { this(ByteUtil.doubleLongToBytes(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits())); } @@ -123,16 +117,13 @@ public byte[] asBytes() { } /** - * Could use just the default hash code, but we can probably create a better - * identity hash (ie. same contents generate same hash) manually, without - * sacrificing speed too much. Although multiplications with modulos would + * Could use just the default hash code, but we can probably create a better identity hash (ie. same contents + * generate same hash) manually, without sacrificing speed too much. Although multiplications with modulos would * generate better hashing, let's use just shifts, and do 2 bytes at a time. - *
    - * Of course, assuming UUIDs are randomized enough, even simpler approach - * might be good enough? - *
    - * Is this a good hash? ... one of these days I better read more about basic - * hashing techniques I swear! + *

    + * Of course, assuming UUIDs are randomized enough, even simpler approach might be good enough? + *

    + * Is this a good hash? ... one of these days I better read more about basic hashing techniques I swear! */ private static final int[] kShifts = {3, 7, 17, 21, 29, 4, 9}; @@ -211,8 +202,7 @@ public String toString() { * Creates a 128bit number from the String representation of {@link UUID}. * * @param uuid The UUID - * @return byte array that can be used to recreate a UUID instance from the given String - * representation + * @return byte array that can be used to recreate a UUID instance from the given String representation */ public static byte[] stringToBytes(String uuid) { byte[] data = new byte[16]; 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 69970771465..b6c6f29f72f 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 @@ -71,19 +71,12 @@ public static UUIDGenerator getInstance() { return UUIDGenerator.sSingleton; } - /* - * ///////////////////////////////////////////////////// // Configuration - * ///////////////////////////////////////////////////// - */ - /** - * Method for getting the shared random number generator used for generating - * the UUIDs. This way the initialization cost is only taken once; access - * need not be synchronized (or in cases where it has to, SecureRandom takes - * care of it); it might even be good for getting really 'random' stuff to - * get shared access.. + * Method for getting the shared random number generator used for generating the UUIDs. This way the initialization + * cost is only taken once; access need not be synchronized (or in cases where it has to, SecureRandom takes care of + * it); it might even be good for getting really 'random' stuff to get shared access.. * - * @return A Random number generator. + * @return A Random number generator */ public Random getRandomNumberGenerator() { /* @@ -121,7 +114,8 @@ public byte[] generateDummyAddress() { Random rnd = getRandomNumberGenerator(); byte[] dummy = new byte[6]; rnd.nextBytes(dummy); - /* Need to set the broadcast bit to indicate it's not a real + /* + * Need to set the broadcast bit to indicate it's not a real * address. */ dummy[0] |= (byte) 0x01; @@ -133,10 +127,10 @@ public byte[] generateDummyAddress() { } /** - * If running java 6 or above, returns {@link NetworkInterface#getHardwareAddress()}, else return {@code null}. - * The first hardware address is returned when iterating all the NetworkInterfaces + * If running java 6 or above, returns {@link NetworkInterface#getHardwareAddress()}, else return {@code null}. The + * first hardware address is returned when iterating all the NetworkInterfaces * - * @return A byte array containing the hardware address. + * @return A byte array containing the hardware address */ public static byte[] getHardwareAddress() { try { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUIDTimer.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUIDTimer.java index add7c126020..517997a7f6f 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUIDTimer.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/UUIDTimer.java @@ -19,63 +19,50 @@ import java.util.Random; /** - * UUIDTimer produces the time stamps required for time-based UUIDs. It works as - * outlined in the UUID specification, with following implementation: + * UUIDTimer produces the time stamps required for time-based UUIDs. It works as outlined in the UUID specification, + * with following implementation: *

      - *
    • Java classes can only product time stamps with maximum resolution of one - * millisecond (at least before JDK 1.5). To compensate, an additional counter - * is used, so that more than one UUID can be generated between java clock - * updates. Counter may be used to generate up to 10000 UUIDs for each distinct - * java clock value. - *
    • Due to even lower clock resolution on some platforms (older Windows - * versions use 55 msec resolution), timestamp value can also advanced ahead of - * physical value within limits (by default, up 100 millisecond ahead of - * reported), iff necessary (ie. 10000 instances created before clock time - * advances). - *
    • As an additional precaution, counter is initialized not to 0 but to a - * random 8-bit number, and each time clock changes, lowest 8-bits of counter - * are preserved. The purpose it to make likelihood of multi-JVM multi-instance - * generators to collide, without significantly reducing max. UUID generation - * speed. Note though that using more than one generator (from separate JVMs) is - * strongly discouraged, so hopefully this enhancement isn't needed. This 8-bit - * offset has to be reduced from total max. UUID count to preserve ordering - * property of UUIDs (ie. one can see which UUID was generated first for given - * UUID generator); the resulting 9500 UUIDs isn't much different from the - * optimal choice. - *
    • Finally, as of version 2.0 and onwards, optional external timestamp - * synchronization can be done. This is done similar to the way UUID - * specification suggests; except that since there is no way to lock the whole - * system, file-based locking is used. This works between multiple JVMs and Jug - * instances. + *
    • Java classes can only product time stamps with maximum resolution of one millisecond (at least before JDK 1.5). + * To compensate, an additional counter is used, so that more than one UUID can be generated between java clock updates. + * Counter may be used to generate up to 10000 UUIDs for each distinct java clock value. + *
    • Due to even lower clock resolution on some platforms (older Windows versions use 55 msec resolution), timestamp + * value can also advanced ahead of physical value within limits (by default, up 100 millisecond ahead of reported), iff + * necessary (ie. 10000 instances created before clock time advances). + *
    • As an additional precaution, counter is initialized not to 0 but to a random 8-bit number, and each time clock + * changes, lowest 8-bits of counter are preserved. The purpose it to make likelihood of multi-JVM multi-instance + * generators to collide, without significantly reducing max. UUID generation speed. Note though that using more than + * one generator (from separate JVMs) is strongly discouraged, so hopefully this enhancement isn't needed. This 8-bit + * offset has to be reduced from total max. UUID count to preserve ordering property of UUIDs (ie. one can see which + * UUID was generated first for given UUID generator); the resulting 9500 UUIDs isn't much different from the optimal + * choice. + *
    • Finally, as of version 2.0 and onwards, optional external timestamp synchronization can be done. This is done + * similar to the way UUID specification suggests; except that since there is no way to lock the whole system, + * file-based locking is used. This works between multiple JVMs and Jug instances. *
    *

    * Some additional assumptions about calculating the timestamp: *

      - *
    • System.currentTimeMillis() is assumed to give time offset in UTC, or at - * least close enough thing to get correct timestamps. The alternate route would - * have to go through calendar object, use TimeZone offset to get to UTC, and - * then modify. Using currentTimeMillis should be much faster to allow rapid - * UUID creation. - *
    • Similarly, the constant used for time offset between 1.1.1970 and start - * of Gregorian calendar is assumed to be correct (which seems to be the case - * when testing with Java calendars). + *
    • System.currentTimeMillis() is assumed to give time offset in UTC, or at least close enough thing to get correct + * timestamps. The alternate route would have to go through calendar object, use TimeZone offset to get to UTC, and then + * modify. Using currentTimeMillis should be much faster to allow rapid UUID creation. + *
    • Similarly, the constant used for time offset between 1.1.1970 and start of Gregorian calendar is assumed to be + * correct (which seems to be the case when testing with Java calendars). *
    *

    - * Note about synchronization: this class is assumed to always be called from a - * synchronized context (caller locks on either this object, or a similar timer - * lock), and so has no method synchronization. + * Note about synchronization: this class is assumed to always be called from a synchronized context (caller locks on + * either this object, or a similar timer lock), and so has no method synchronization. */ public class UUIDTimer { + /** - * Since System.longTimeMillis() returns time from january 1st 1970, and - * UUIDs need time from the beginning of gregorian calendar (15-oct-1582), - * need to apply the offset: + * Since System.longTimeMillis() returns time from january 1st 1970, and UUIDs need time from the beginning of + * gregorian calendar (15-oct-1582), need to apply the offset: */ private static final long kClockOffset = 0x01b21dd213814000L; /** - * Also, instead of getting time in units of 100nsecs, we get something with - * max resolution of 1 msec... and need the multiplier as well + * Also, instead of getting time in units of 100nsecs, we get something with max resolution of 1 msec... and need the + * multiplier as well */ private static final long kClockMultiplier = 10000; @@ -94,27 +81,23 @@ public class UUIDTimer { // // // Clock state: /** - * Additional state information used to protect against anomalous cases - * (clock time going backwards, node id getting mixed up). Third byte is - * actually used for seeding counter on counter overflow. + * Additional state information used to protect against anomalous cases (clock time going backwards, node id getting + * mixed up). Third byte is actually used for seeding counter on counter overflow. */ private final byte[] mClockSequence = new byte[3]; /** - * Last physical timestamp value System.currentTimeMillis() - * returned: used to catch (and report) cases where system clock goes - * backwards. Is also used to limit "drifting", that is, amount timestamps - * used can differ from the system time value. This value is not guaranteed - * to be monotonically increasing. + * Last physical timestamp value {@code System.currentTimeMillis()} returned: used to catch (and report) cases where + * system clock goes backwards. Is also used to limit "drifting", that is, amount timestamps used can differ from the + * system time value. This value is not guaranteed to be monotonically increasing. */ private long mLastSystemTimestamp = 0L; /** - * Timestamp value last used for generating a UUID (along with - * {@link #mClockCounter}. Usually the same as {@link #mLastSystemTimestamp}, - * but not always (system clock moved backwards). Note that this value is - * guaranteed to be monotonically increasing; that is, at given absolute time - * points t1 and t2 (where t2 is after t1), t1 <= t2 will always hold true. + * Timestamp value last used for generating a UUID (along with {@link #mClockCounter}. Usually the same as + * {@link #mLastSystemTimestamp}, but not always (system clock moved backwards). Note that this value is guaranteed + * to be monotonically increasing; that is, at given absolute time points t1 and t2 (where t2 is after t1), t1 <= t2 + * will always hold true. */ private long mLastUsedTimestamp = 0L; @@ -133,16 +116,15 @@ public class UUIDTimer { private void initCounters(final Random rnd) { /* - * Let's generate the clock sequence field now; as with counter, this - * reduces likelihood of collisions (as explained in UUID specs) + * Let's generate the clock sequence field now; as with counter, this reduces likelihood of collisions (as + * explained in UUID specs) */ rnd.nextBytes(mClockSequence); /* - * Ok, let's also initialize the counter... Counter is used to make it - * slightly less likely that two instances of UUIDGenerator (from separate - * JVMs as no more than one can be created in one JVM) would produce - * colliding time-based UUIDs. The practice of using multiple generators, - * is strongly discouraged, of course, but just in case... + * Ok, let's also initialize the counter... Counter is used to make it slightly less likely that two instances of + * UUIDGenerator (from separate JVMs as no more than one can be created in one JVM) would produce colliding + * time-based UUIDs. The practice of using multiple generators, is strongly discouraged, of course, but just in + * case... */ mClockCounter = mClockSequence[2] & 0xFF; } @@ -154,10 +136,7 @@ public void getTimestamp(final byte[] uuidData) { long systime = System.currentTimeMillis(); - /* - * Let's first verify that the system time is not going backwards; - * independent of whether we can use it: - */ + // Let's first verify that the system time is not going backwards; independent of whether we can use it: if (systime < mLastSystemTimestamp) { // Logger.logWarning("System time going backwards! (got value // "+systime+", last "+mLastSystemTimestamp); @@ -166,15 +145,11 @@ public void getTimestamp(final byte[] uuidData) { } /* - * But even without it going backwards, it may be less than the last one - * used (when generating UUIDs fast with coarse clock resolution; or if - * clock has gone backwards over reboot etc). + * But even without it going backwards, it may be less than the last one used (when generating UUIDs fast with + * coarse clock resolution; or if clock has gone backwards over reboot etc). */ if (systime <= mLastUsedTimestamp) { - /* - * Can we just use the last time stamp (ok if the counter hasn't hit - * max yet) - */ + // Can we just use the last time stamp (ok if the counter hasn't hit max yet) if (mClockCounter < UUIDTimer.kClockMultiplier) { // yup, still have room systime = mLastUsedTimestamp; } else { // nope, have to roll over to next value and maybe wait @@ -186,17 +161,15 @@ public void getTimestamp(final byte[] uuidData) { // random sequence"); /* - * Clock counter is now at exactly the multiplier; no use just - * anding its value. So, we better get some random numbers - * instead... + * Clock counter is now at exactly the multiplier; no use just anding its value. So, we better get some + * random numbers instead... */ initCounters(mRnd); /* - * But do we also need to slow down? (to try to keep virtual time - * close to physical time; ie. either catch up when system clock has - * been moved backwards, or when coarse clock resolution has forced - * us to advance virtual timer too far) + * But do we also need to slow down? (to try to keep virtual time close to physical time; ie. either catch + * up when system clock has been moved backwards, or when coarse clock resolution has forced us to advance + * virtual timer too far) */ if (actDiff >= UUIDTimer.kMaxClockAdvance) { UUIDTimer.slowDown(origTime, actDiff); @@ -204,9 +177,8 @@ public void getTimestamp(final byte[] uuidData) { } } else { /* - * Clock has advanced normally; just need to make sure counter is reset - * to a low value (need not be 0; good to leave a small residual to - * further decrease collisions) + * Clock has advanced normally; just need to make sure counter is reset to a low value (need not be 0; good to + * leave a small residual to further decrease collisions) */ mClockCounter &= 0xFF; } @@ -214,8 +186,8 @@ public void getTimestamp(final byte[] uuidData) { mLastUsedTimestamp = systime; /* - * Now, let's translate the timestamp to one UUID needs, 100ns unit offset - * from the beginning of Gregorian calendar... + * Now, let's translate the timestamp to one UUID needs, 100ns unit offset from the beginning of Gregorian + * calendar... */ systime *= UUIDTimer.kClockMultiplierL; systime += UUIDTimer.kClockOffset; @@ -225,10 +197,7 @@ public void getTimestamp(final byte[] uuidData) { // and then increase ++mClockCounter; - /* - * Time fields are nicely split across the UUID, so can't just linearly - * dump the stamp: - */ + // Time fields are nicely split across the UUID, so can't just linearly dump the stamp: int clockHi = (int) (systime >>> 32); int clockLo = (int) systime; @@ -246,17 +215,12 @@ public void getTimestamp(final byte[] uuidData) { private static final int MAX_WAIT_COUNT = 50; /** - * Simple utility method to use to wait for couple of milliseconds, to let - * system clock hopefully advance closer to the virtual timestamps used. - * Delay is kept to just a millisecond or two, to prevent excessive blocking; - * but that should be enough to eventually synchronize physical clock with - * virtual clock values used for UUIDs. + * Simple utility method to use to wait for couple of milliseconds, to let system clock hopefully advance closer to + * the virtual timestamps used. Delay is kept to just a millisecond or two, to prevent excessive blocking; but that + * should be enough to eventually synchronize physical clock with virtual clock values used for UUIDs. */ private static void slowDown(final long startTime, final long actDiff) { - /* - * First, let's determine how long we'd like to wait. This is based on how - * far ahead are we as of now. - */ + // First, let's determine how long we'd like to wait. This is based on how far ahead are we as of now. long ratio = actDiff / UUIDTimer.kMaxClockAdvance; long delay; @@ -280,8 +244,8 @@ private static void slowDown(final long startTime, final long actDiff) { } delay = 1L; /* - * This is just a sanity check: don't want an "infinite" loop if clock - * happened to be moved backwards by, say, an hour... + * This is just a sanity check: don't want an "infinite" loop if clock happened to be moved backwards by, say, + * an hour... */ if (++counter > UUIDTimer.MAX_WAIT_COUNT) { break; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Waiter.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Waiter.java index 49e301085e1..45e9b630eb2 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Waiter.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/Waiter.java @@ -27,8 +27,10 @@ public interface Condition { boolean result(); } - /** This method will wait for the condition.result to be true or a timeout has ocurred. - * it will return the last result. */ + /** + * This method will wait for the condition.result to be true or a timeout has ocurred. it will return the last + * result. + */ public static boolean waitFor(Condition condition, TimeUnit unit, long timeout, TimeUnit parkUnit, long parkTime) { long timeoutNanos = unit.toNanos(timeout); final long deadline = System.nanoTime() + timeoutNanos; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ArtemisExecutor.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ArtemisExecutor.java index e1ea54e0c39..43bbd9cf0c3 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ArtemisExecutor.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/ArtemisExecutor.java @@ -24,18 +24,15 @@ public interface ArtemisExecutor extends Executor { /** - * Artemis is supposed to implement this properly, however in tests or tools - * this can be used as a fake, doing a simple delegate and using the default methods implemented here. - * @param executor - * @return + * Artemis is supposed to implement this properly, however in tests or tools this can be used as a fake, doing a + * simple delegate and using the default methods implemented here. */ static ArtemisExecutor delegate(Executor executor) { return executor::execute; } /** - * It will wait the current execution (if there is one) to finish - * but will not complete any further executions. + * It will wait the current execution (if there is one) to finish but will not complete any further executions. * * @param onPendingTask it will be called for each pending task found * @return the number of pending tasks that won't be executed @@ -44,12 +41,9 @@ default int shutdownNow(Consumer onPendingTask, int timeout, T return 0; } - /** To be used to flush an executor from a different thread. - * WARNING: Do not call this within the executor. That would be stoopid ;) - * - * @param timeout - * @param unit - * @return + /** + * To be used to flush an executor from a different thread. + * WARNING: Do not call this within the executor. That would be stoopid ;) */ default boolean flush(long timeout, TimeUnit unit) { CountDownLatch latch = new CountDownLatch(1); @@ -62,8 +56,7 @@ default boolean flush(long timeout, TimeUnit unit) { } /** - * It will wait the current execution (if there is one) to finish - * but will not complete any further executions + * It will wait the current execution (if there is one) to finish but will not complete any further executions */ default int shutdownNow() { return shutdownNow(t -> { @@ -86,16 +79,16 @@ default boolean isFair() { return false; } - /** If this OrderedExecutor is fair, it will yield for another executors after each task ran */ + /** + * If this OrderedExecutor is fair, it will yield for another executors after each task ran + */ default ArtemisExecutor setFair(boolean fair) { return this; } - - /** - * This will verify if the executor is flushed with no wait (or very minimal wait if not the {@link org.apache.activemq.artemis.utils.actors.OrderedExecutor} - * @return + * This will verify if the executor is flushed with no wait (or very minimal wait if not the + * {@link org.apache.activemq.artemis.utils.actors.OrderedExecutor} */ default boolean isFlushed() { CountDownLatch latch = new CountDownLatch(1); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/HandlerBase.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/HandlerBase.java index cd76ba493e0..6010a028a04 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/HandlerBase.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/HandlerBase.java @@ -18,10 +18,8 @@ package org.apache.activemq.artemis.utils.actors; /** - * This abstract class will encapsulate - * ThreadLocals to determine when a class is a handler. - * This is because some functionality has to be avoided if inHandler(). - * + * This abstract class will encapsulate ThreadLocals to determine when a class is a handler. This is because some + * functionality has to be avoided if inHandler(). */ public abstract class HandlerBase { @@ -32,7 +30,10 @@ private static class Counter { // There is only going to be a single Thread using the counter, so it is safe to cache this instance private final Counter cachedCounter = new Counter(); - /** an actor could be used within an OrderedExecutor. So we need this counter to decide if there's a Handler anywhere in the stack trace */ + /** + * an actor could be used within an OrderedExecutor. So we need this counter to decide if there's a Handler anywhere + * in the stack trace + */ private static final ThreadLocal counterThreadLocal = new ThreadLocal<>(); protected void enter() { 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 b2352dd1459..340390ac0f6 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 @@ -25,7 +25,7 @@ /** * An executor that always runs all tasks in order, using a delegate executor to run the tasks. - *
    + *

    * More specifically, any call B to the {@link #execute(Runnable)} method that happens-after another call A to the * same method, will result in B's task running after A's. */ @@ -44,8 +44,10 @@ public boolean isFair() { return fair; } + /** + * If this OrderedExecutor is fair, it will yield for another executors after each task ran + */ @Override - /** If this OrderedExecutor is fair, it will yield for another executors after each task ran */ public OrderedExecutor setFair(boolean fair) { this.fair = fair; return this; diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorFactory.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorFactory.java index 6ce3cc9ccb0..828e27d116e 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorFactory.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/actors/OrderedExecutorFactory.java @@ -21,6 +21,7 @@ import java.util.concurrent.TimeUnit; import org.apache.activemq.artemis.utils.ExecutorFactory; + /** * A factory for producing executors that run all tasks in order, which delegate to a single common executor instance. */ @@ -63,7 +64,9 @@ public ArtemisExecutor getExecutor() { return new OrderedExecutor(parent).setFair(fair); } - /** I couldn't figure out how to make a new method to return a generic Actor with a given type */ + /** + * I couldn't figure out how to make a new method to return a generic Actor with a given type + */ public Executor getParent() { return parent; } 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 323da6a5d7e..ea018e29e1b 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 @@ -38,8 +38,8 @@ public abstract class ProcessorBase extends HandlerBase { private final Executor delegate; /** - * Using a method reference instead of an inner classes allows the caller to reduce the pointer chasing - * when accessing ProcessorBase.this fields/methods. + * Using a method reference instead of an inner classes allows the caller to reduce the pointer chasing when + * accessing ProcessorBase.this fields/methods. */ private final Runnable task = this::executePendingTasks; @@ -110,7 +110,9 @@ public void yield() { this.yielded = true; } - /** It will shutdown the executor however it will not wait for finishing tasks*/ + /** + * It will shutdown the executor however it will not wait for finishing tasks + */ public int shutdownNow(Consumer onPendingItem, int timeout, TimeUnit unit) { //alert anyone that has been requested (at least) an immediate shutdown requestedForcedShutdown = true; @@ -146,10 +148,9 @@ public final boolean isFlushed() { } /** - * WARNING: This will only flush when all the activity is suspended. - * don't expect success on this call if another thread keeps feeding the queue - * this is only valid on situations where you are not feeding the queue, - * like in shutdown and failover situations. + * WARNING: This will only flush when all the activity is suspended. don't expect success on this call if another + * thread keeps feeding the queue this is only valid on situations where you are not feeding the queue, like in + * shutdown and failover situations. */ public final boolean flush(long timeout, TimeUnit unit) { if (this.state == STATE_NOT_RUNNING) { @@ -189,9 +190,9 @@ protected void task(T command) { } /** - * This has to be called on the assumption that state!=STATE_RUNNING. - * It is packed separately from {@link #task(Object)} just for performance reasons: it - * handles the uncommon execution cases for bursty scenarios i.e. the slowest execution path. + * This has to be called on the assumption that state!=STATE_RUNNING. It is packed separately from + * {@link #task(Object)} just for performance reasons: it handles the uncommon execution cases for bursty scenarios + * i.e. the slowest execution path. */ private void onAddedTaskIfNotRunning(int state) { if (state == STATE_NOT_RUNNING) { @@ -207,10 +208,10 @@ private static void logAddOnShutdown() { } /** - * Returns the remaining items to be processed. - *

    - * This method is safe to be called by different threads and its accuracy is subject to concurrent modifications.
    - * It is meant to be used only for test purposes, because of its {@code O(n)} cost. + * This method is safe to be called by different threads and its accuracy is subject to concurrent modifications. It + * is meant to be used only for test purposes, because of its {@code O(n)} cost. + * + * @return the remaining items to be processed */ public final int remaining() { return tasks.size(); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/bean/MetaBean.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/bean/MetaBean.java index cc89858660a..191f55fb591 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/bean/MetaBean.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/bean/MetaBean.java @@ -34,13 +34,13 @@ import org.slf4j.LoggerFactory; /** - * Receives a metadata about a class with methods to read, write and certain gates. - * And provides a generic logic to convert to and from JSON. + * Receives a metadata about a class with methods to read, write and certain gates. And provides a generic logic to + * convert to and from JSON. *

    - * As a historical context the first try to make a few objects more dynamic (e.g. AddressSettings) was - * around BeanUtils however there was some implicit logic on when certain settings were Null or default values. - * for that reason I decided for a meta-data approach where extra semantic could be applied for each individual attributes - * rather than a generic BeanUtils parser. + * As a historical context the first try to make a few objects more dynamic (e.g. AddressSettings) was around BeanUtils + * however there was some implicit logic on when certain settings were Null or default values. for that reason I decided + * for a meta-data approach where extra semantic could be applied for each individual attributes rather than a generic + * BeanUtils parser. */ public class MetaBean { @@ -50,13 +50,15 @@ public class MetaBean { /** * Accepted types: - * String.class - * SimpleString.class - * Integer.class - * Long.class - * Double.class - * Float.class - * Enumerations + *

      + *
    • String.class + *
    • SimpleString.class + *
    • Integer.class + *
    • Long.class + *
    • Double.class + *
    • Float.class + *
    • Enumerations + *
    */ public MetaBean add(Class type, String name, @@ -133,7 +135,9 @@ public void parseToJSON(T object, JsonObjectBuilder builder, boolean ignoreNullA }); } - /** Generates a random Object using the setters for testing purposes. */ + /** + * Generates a random Object using the setters for testing purposes. + */ public void setRandom(T randomObject) { forEach((type, name, setter, getter, gate) -> { if (Enum.class.isAssignableFrom(type)) { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ArrayResettableIterator.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ArrayResettableIterator.java index 9de3f6422bf..90be5fc5dd2 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ArrayResettableIterator.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ArrayResettableIterator.java @@ -19,10 +19,8 @@ import java.util.Collection; /** - * Provides an Array Iterator that is able to reset, allowing you to iterate over the full array. - * It achieves this though by moving end position mark to the the current cursors position, - * so it round robins, even with reset. - * @param + * Provides an Array Iterator that is able to reset, allowing you to iterate over the full array. It achieves this + * though by moving end position mark to the the current cursors position, so it round robins, even with reset. */ public class ArrayResettableIterator implements ResettableIterator { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentAppendOnlyChunkedList.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentAppendOnlyChunkedList.java index 7d0702601b7..2cdf2e4c050 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentAppendOnlyChunkedList.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentAppendOnlyChunkedList.java @@ -22,7 +22,8 @@ import java.util.function.IntFunction; /** - * This collection is a concurrent append-only list that grows in chunks.
    + * This collection is a concurrent append-only list that grows in chunks. + *

    * It's safe to be used by many threads concurrently and has a max capacity of {@link Integer#MAX_VALUE}. */ public final class ConcurrentAppendOnlyChunkedList { @@ -93,7 +94,7 @@ public void addAll(E[] elements) { } /** - * Returns the element at the specified position in this collection or {@code null} if not found. + * {@return the element at the specified position in this collection or {@code null} if not found.} */ public E get(int index) { if (index < 0) { @@ -118,8 +119,8 @@ public E get(int index) { } /** - * Implements a lock-free version of the optimization used on {@link java.util.LinkedList#get(int)} to speed up queries - * ie backward search of a node if needed. + * Implements a lock-free version of the optimization used on {@link java.util.LinkedList#get(int)} to speed up + * queries i.e. backward search of a node if needed. */ private AtomicChunk getChunkOf(final int index, final long lastIndex) { final int chunkSizeLog2 = this.chunkSizeLog2; @@ -160,7 +161,7 @@ private AtomicChunk getChunkOf(final int index, final long lastIndex) { * Appends the specified element to the end of this collection. * * @throws NullPointerException if {@code e} is {@code null} - **/ + */ public void add(E e) { Objects.requireNonNull(e); while (true) { @@ -227,9 +228,9 @@ public E[] toArray(IntFunction arrayAllocator) { } /** - * Returns an array containing all of the elements in this collection in proper - * sequence (from first to last element).
    - * {@code arrayAllocator} will be used to instantiate the array of the correct size with the right runtime type. + * {@return an array containing all of the elements in this collection in proper sequence (from first to last + * element); {@code arrayAllocator} will be used to instantiate the array of the correct size with the right runtime + * type} */ public E[] toArray(IntFunction arrayAllocator, int startIndex) { if (startIndex < 0) { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentHashSet.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentHashSet.java index 21c15885a47..93b0b809dd2 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentHashSet.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentHashSet.java @@ -23,7 +23,7 @@ /** * A ConcurrentHashSet. - * + *

    * Offers same concurrency as ConcurrentHashMap but for a Set */ public class ConcurrentHashSet extends AbstractSet implements ConcurrentSet { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashMap.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashMap.java index f1bc07b49db..6fef04fc7b7 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashMap.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashMap.java @@ -28,14 +28,12 @@ /** * Map from long to an Object. - * + *

    * Provides similar methods as a {@literal ConcurrentMap} with 2 differences: *

      *
    1. No boxing/unboxing from {@literal long -> Long} *
    2. Open hash map with linear probing, no node allocations to store the values *
    - * - * @param */ @SuppressWarnings("unchecked") public class ConcurrentLongHashMap { 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 794ecb6a570..1cac4cc8e5b 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 @@ -30,7 +30,7 @@ /** * Concurrent hash set for primitive longs - * + *

    * Provides similar methods as a ConcurrentSet<Long> but since it's an open hash map with linear probing, no node * allocations are required to store the values. *

    @@ -136,7 +136,6 @@ public boolean add(long item) { /** * Remove an existing entry if found * - * @param item * @return true if removed or false if item was not present */ public boolean remove(long item) { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedList.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedList.java index e70f5caa80e..b060cf1fb38 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedList.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedList.java @@ -38,10 +38,14 @@ public interface LinkedList { void clearID(); - /** this makes possibl to use {@link #removeWithID(String, long)} */ + /** + * this makes possibl to use {@link #removeWithID(String, long)} + */ void setNodeStore(NodeStore store); - /** you need to call {@link #setNodeStore(NodeStore)} before you are able to call this method. */ + /** + * you need to call {@link #setNodeStore(NodeStore)} before you are able to call this method. + */ E removeWithID(String listID, long id); void forEach(Consumer consumer); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListImpl.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListImpl.java index 7d554bddc63..9eadd1be08f 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListImpl.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListImpl.java @@ -27,8 +27,8 @@ import org.slf4j.LoggerFactory; /** - * A linked list implementation which allows multiple iterators to exist at the same time on the queue, and which see any - * elements added or removed from the queue either directly or via iterators. + * A linked list implementation which allows multiple iterators to exist at the same time on the queue, and which see + * any elements added or removed from the queue either directly or via iterators. *

    * This class is not thread safe. */ @@ -220,11 +220,10 @@ public void addSorted(E e) { return; } - // in our usage, most of the times we will just add to the end - // as the QueueImpl cancellations in AMQP will return the buffer back to the queue, in the order they were consumed. - // There is an exception to that case, when there are more messages on the queue. - // This would be an optimization for our usage. - // avoiding scanning the entire List just to add at the end, so we compare the end first. + // In our usage, most of the times we will just add to the end as the QueueImpl cancellations in AMQP will + // return the buffer back to the queue in the order they were consumed. There is an exception to that case, + // when there are more messages on the queue. This would be an optimization for our usage - avoiding scanning + // the entire List just to add at the end, so we compare the end first. if (comparator.compare(tail.val(), e) >= 0) { logger.trace("addTail as e={} and tail={}", e, tail.val()); addTail(e); @@ -255,14 +254,14 @@ public void addSorted(E e) { return; } - // this shouldn't happen as the tail was compared before iterating - // the only possibilities for this to happen are: + // This shouldn't happen as the tail was compared before iterating the only possibilities for this to happen + // are: // - there is a bug on the comparator // - This method is buggy // - The list wasn't properly synchronized as this list does't support concurrent access // // Also I'm not bothering about creating a Logger ID for this, because the only reason for this code to exist - // is because my OCD level is not letting this out. + // is because my OCD level is not letting this out. throw new IllegalStateException("Cannot find a suitable place for your element, There's a mismatch in the comparator or there was concurrent adccess on the queue"); } } @@ -335,8 +334,7 @@ public E poll() { @Override public void clear() { // Clearing all of the links between nodes is "unnecessary", but: - // - helps a generational GC if the discarded nodes inhabit - // more than one generation + // - helps a generational GC if the discarded nodes inhabit more than one generation // - is sure to free memory even if there is a reachable Iterator while (poll() != null) { @@ -404,8 +402,8 @@ private void removeAfter(Node node) { LinkedListImpl.this.nudgeIterators(toRemove); } - //Help GC - otherwise GC potentially has to traverse a very long list to see if elements are reachable, this can result in OOM - //https://jira.jboss.org/browse/HORNETQ-469 + // Help GC - otherwise GC potentially has to traverse a very long list to see if elements are reachable, this can + // result in OOM toRemove.next = toRemove.prev = null; } diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListIterator.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListIterator.java index 5508934ffa7..c750fe38942 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListIterator.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListIterator.java @@ -20,14 +20,17 @@ /** * A LinkedListIterator - * + *

    * This iterator allows the last element to be repeated in the next call to hasNext or next */ public interface LinkedListIterator extends Iterator, AutoCloseable { void repeat(); - /** This method is doing exactly what {@link Iterator#remove()} would do, however it will return the element being removed. */ + /** + * This method is doing exactly what {@link Iterator#remove()} would do, however it will return the element being + * removed. + */ E removeLastElement(); @Override diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LongHashSet.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LongHashSet.java index fb8f9c553be..ba0bd1bd8a9 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LongHashSet.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LongHashSet.java @@ -28,13 +28,14 @@ import java.util.Set; /** - * A hash set implementation of {@literal Set} that uses open addressing values. - * To minimize the memory footprint, this class uses open addressing rather than chaining. - * Collisions are resolved using linear probing. Deletions implement compaction, so cost of - * remove can approach O(N) for full maps, which makes a small loadFactor recommended. - * - * The implementation is based on Agrona IntHashSet - * but uses long primitive keys and a different {@link #MISSING_VALUE} to account for {@link Long#hashCode} being 0 for -1. + * A hash set implementation of {@literal Set} that uses open addressing values. To minimize the memory footprint, + * this class uses open addressing rather than chaining. Collisions are resolved using linear probing. Deletions + * implement compaction, so cost of remove can approach O(N) for full maps, which makes a small loadFactor recommended. + *

    + * The implementation is based on Agrona + * IntHashSet but uses long primitive keys and a different {@link #MISSING_VALUE} to account for + * {@link Long#hashCode} being 0 for -1. */ public class LongHashSet extends AbstractSet implements Serializable { @@ -100,7 +101,7 @@ public LongHashSet(final int proposedCapacity, final float loadFactor) { /** * Get the load factor beyond which the set will increase size. * - * @return load factor for when the set should increase size. + * @return load factor for when the set should increase size */ public float loadFactor() { return loadFactor; @@ -109,17 +110,17 @@ public float loadFactor() { /** * Get the total capacity for the set to which the load factor with be a fraction of. * - * @return the total capacity for the set. + * @return the total capacity for the set */ public int capacity() { return values.length; } /** - * Get the actual threshold which when reached the map will resize. - * This is a function of the current capacity and load factor. + * Get the actual threshold which when reached the map will resize. This is a function of the current capacity and + * load factor. * - * @return the threshold when the map will resize. + * @return the threshold when the map will resize */ public int resizeThreshold() { return resizeThreshold; @@ -266,8 +267,8 @@ private void compactChain(int deleteIndex) { } /** - * Compact the backing arrays by rehashing with a capacity just larger than current size - * and giving consideration to the load factor. + * Compact the backing arrays by rehashing with a capacity just larger than current size and giving consideration to + * the load factor. */ public void compact() { final int idealCapacity = (int) Math.round(size() * (1.0 / loadFactor)); @@ -286,7 +287,7 @@ public boolean contains(final Object value) { * Contains method that does not box values. * * @param value to be check for if the set contains it. - * @return true if the value is contained in the set otherwise false. + * @return true if the value is contained in the set otherwise false * @see Collection#contains(Object) */ public boolean contains(final long value) { @@ -447,7 +448,7 @@ private void copyValues(final Object[] arrayCopy) { * LongHashSet specialised variant of {this#containsAll(Collection)}. * * @param other int hash set to compare against. - * @return true if every element in other is in this. + * @return true if every element in other is in this */ public boolean containsAll(final LongHashSet other) { for (final long value : other.values) { @@ -558,7 +559,7 @@ public Long next() { /** * Strongly typed alternative of {@link Iterator#next()} to avoid boxing. * - * @return the next int value. + * @return the next int value */ public long nextValue() { if (remaining == 1 && containsMissingValue) { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/MultiResettableIterator.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/MultiResettableIterator.java index fb28d02380a..fcb7b3471bf 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/MultiResettableIterator.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/MultiResettableIterator.java @@ -17,8 +17,8 @@ package org.apache.activemq.artemis.utils.collections; /** - * Extends MultiIterator, adding the ability if the underlying iterators are resettable, then its self can reset. - * It achieves this by going back to the first iterator, and as moves to another iterator it resets it. + * Extends MultiIterator, adding the ability if the underlying iterators are resettable, then its self can reset. It + * achieves this by going back to the first iterator, and as moves to another iterator it resets it. * * @param type of the class of the iterator. */ diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/NoOpMap.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/NoOpMap.java index 1ea2bdf820c..979f49cafe2 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/NoOpMap.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/NoOpMap.java @@ -23,9 +23,9 @@ import java.util.Set; /** - * This class implements a Map, but actually doesnt store anything, it is similar in idea to an EmptyMap, - * but where mutation methods simply do a no op rather than UnsupportedOperationException as with EmptyMap. - * + * This class implements a Map, but actually doesnt store anything, it is similar in idea to an EmptyMap, but where + * mutation methods simply do a no op rather than UnsupportedOperationException as with EmptyMap. + *

    * This is used in QueueImpl when message groups is disabled. * * @param the key type. diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/NodeStore.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/NodeStore.java index b07ce23e1a1..6eb7455d069 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/NodeStore.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/NodeStore.java @@ -22,8 +22,10 @@ */ public interface NodeStore { - /** When you store the node, make sure you find what is the ID and ListID for the element you are storing - * as later one you will need to provide the node based on list and id as specified on {@link #getNode(String, long)} */ + /** + * When you store the node, make sure you find what is the ID and ListID for the element you are storing as later one + * you will need to provide the node based on list and id as specified on {@link #getNode(String, long)} + */ void storeNode(E element, LinkedListImpl.Node node); LinkedListImpl.Node getNode(String listID, long id); @@ -38,11 +40,14 @@ default String getName() { return null; } - /** this is meant to be a quick help to Garbage Collection. - * Whenever the IDSupplier list is being cleared, you should first call the clear method and - * empty every list before you let the instance go. */ + /** + * This is meant to be a quick help to Garbage Collection. Whenever the IDSupplier list is being cleared, you should + * first call the clear method and empty every list before you let the instance go. + */ void clear(); - /** ths should return the sum of all the sizes. for test assertions. */ + /** + * ths should return the sum of all the sizes. for test assertions. + */ int size(); } diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/PriorityCollection.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/PriorityCollection.java index f90c92a0994..3d76c1abeb4 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/PriorityCollection.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/PriorityCollection.java @@ -31,11 +31,11 @@ /** * This class's purpose is to hold the the different collections used for each priority level. - * - * A supplier is required to provide the underlying collection needed when a new priority level is seen, - * and the end behaviour is that of the underlying collection, e.g. if set add will follow set's add semantics, - * if list, then list semantics. - * + *

    + * A supplier is required to provide the underlying collection needed when a new priority level is seen, and the end + * behaviour is that of the underlying collection, e.g. if set add will follow set's add semantics, if list, then list + * semantics. + *

    * Methods getArray, setArray MUST never be exposed, and all array modifications must go through these. * * @param The type this class may hold, this is generic as can be anything that extends PriorityAware. diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/PriorityLinkedList.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/PriorityLinkedList.java index 03a616b5f80..d9adb8c93c8 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/PriorityLinkedList.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/PriorityLinkedList.java @@ -19,8 +19,9 @@ import java.util.function.Supplier; /** - * A type of linked list which maintains items according to a priority - * and allows adding and removing of elements at both ends, and peeking.
    + * A type of linked list which maintains items according to a priority and allows adding and removing of elements at + * both ends, and peeking. + *

    * Only {@link #size()} and {@link #isEmpty()} are safe to be called concurrently. */ public interface PriorityLinkedList { @@ -33,30 +34,29 @@ public interface PriorityLinkedList { E poll(); - /** just look at the first element on the list */ + /** + * just look at the first element on the list + */ E peek(); void clear(); /** * @see LinkedList#setNodeStore(NodeStore) - * @param supplier */ void setNodeStore(Supplier> supplier); E removeWithID(String listID, long id); /** - * Returns the size of this list.
    - * It is safe to be called concurrently. + * {@return the size of this list; safe to be called concurrently} */ int size(); LinkedListIterator iterator(); /** - * Returns {@code true} if empty, {@code false} otherwise.
    - * It is safe to be called concurrently. + * {@return {@code true} if empty, {@code false} otherwise; safe to be called concurrently} */ boolean isEmpty(); } diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ResettableIterator.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ResettableIterator.java index 9091a4eed37..5b72961e96b 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ResettableIterator.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ResettableIterator.java @@ -21,8 +21,8 @@ public interface ResettableIterator extends Iterator { /** - * Resets the iterator so that you can iterate over all elements from your current position. - * Your current position (when reached again) signals the end of iteration as if the collection is circular. + * Resets the iterator so that you can iterate over all elements from your current position. Your current position + * (when reached again) signals the end of iteration as if the collection is circular. */ void reset(); } diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/SparseArrayLinkedList.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/SparseArrayLinkedList.java index ab8bb734ba2..ba9114a091c 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/SparseArrayLinkedList.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/SparseArrayLinkedList.java @@ -24,13 +24,14 @@ import java.util.function.Predicate; /** - * This list share the same motivation and structure of https://en.wikipedia.org/wiki/Unrolled_linked_list: - * it's a linked list of arrays/chunks of {@code T}.
    + * This list share the same motivation and structure of https://en.wikipedia.org/wiki/Unrolled_linked_list: it's a + * linked list of arrays/chunks of {@code T}. + *

    * Differently from an {@code UnrolledLinkedList} this list doesn't optimize addition and removal to achieve a balanced - * utilization among chunks ie a chunk is removed only if empty and chunks can't be merged. - * This list has been optimized for small-sized chunks (ideally <= 32 elements): this allow search/removal to - * be performed with a greedy approach despite a sparse chunk utilization (ie chunks contains few sparse elements).
    - * + * utilization among chunks ie a chunk is removed only if empty and chunks can't be merged. This list has been optimized + * for small-sized chunks (ideally <= 32 elements): this allow search/removal to be performed with a greedy approach + * despite a sparse chunk utilization (ie chunks contains few sparse elements). + *

    * From the memory footprint's point of view, this list won't remove the last remaining array although empty to optimize * the case where its capacity would be enough to hold incoming elements, hence saving a new array allocation. */ @@ -231,21 +232,21 @@ public long clear(Consumer consumer) { } /** - * Returns the number of elements of this list. + * {@return the number of elements of this list} */ public long size() { return size; } /** - * Returns the configured capacity of each sparse array/chunk. + * {@return the configured capacity of each sparse array/chunk} */ public int sparseArrayCapacity() { return sparseArrayCapacity; } /** - * Returns the number of sparse arrays/chunks of this list. + * {@return the number of sparse arrays/chunks of this list} */ public int sparseArraysCount() { return list.size(); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/TypedProperties.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/TypedProperties.java index e2a367ab368..f3c4bea74cd 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/TypedProperties.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/TypedProperties.java @@ -57,9 +57,8 @@ /** * Property Value Conversion. *

    - * This implementation follows section 3.5.4 of the Java Message Service specification - * (Version 1.1 April 12, 2002). - *

    + * This implementation follows section 3.5.4 of the Java Message Service specification (Version 1.1 April 12, + * 2002). */ public class TypedProperties { @@ -498,8 +497,8 @@ private void forEachInternal(BiConsumer action) { } /** - * Performs a search among the valid key properties contained in {@code buffer}, starting from {@code from} - * assuming it to be a valid encoded {@link TypedProperties} content. + * Performs a search among the valid key properties contained in {@code buffer}, starting from {@code from} assuming + * it to be a valid encoded {@link TypedProperties} content. * * @throws IllegalStateException if any not-valid property is found while searching the {@code key} property */ diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/UpdatableIterator.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/UpdatableIterator.java index d475ddf7e30..087542f60bd 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/UpdatableIterator.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/UpdatableIterator.java @@ -30,8 +30,7 @@ public UpdatableIterator(ResettableIterator iterator) { } /** - * This can be called by another thread. - * It sets a new iterator, that will be picked up on the next reset. + * This can be called by another thread. It sets a new iterator, that will be picked up on the next reset. * * @param iterator the new iterator to update to. */ @@ -46,12 +45,12 @@ public void update(ResettableIterator iterator) { */ /** - * When reset is called, then if a new iterator has been provided by another thread via update method, - * then we switch over to using the new iterator. - * - * It is important that on nulling off the changedIterator, we atomically compare and set as the - * changedIterator could be further updated by another thread whilst we are resetting, - * the subsequent update simply would be picked up on the next reset. + * When reset is called, then if a new iterator has been provided by another thread via update method, then we switch + * over to using the new iterator. + *

    + * It is important that on nulling off the changedIterator, we atomically compare and set as the changedIterator + * could be further updated by another thread whilst we are resetting, the subsequent update simply would be picked + * up on the next reset. */ @Override public void reset() { 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 00599b3dcda..0e41034de9f 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 @@ -44,7 +44,8 @@ public class CriticalAnalyzerImpl implements CriticalAnalyzer { public CriticalAnalyzerImpl() { // this will make the scheduled component to start its own pool - /* Important: The scheduled component should have its own thread pool... + /* + * Important: The scheduled component should have its own thread pool... * otherwise in case of a deadlock, or a starvation of the server the analyzer won't pick up any * issues and won't be able to shutdown the server or halt the VM */ diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalCloseable.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalCloseable.java index d02a80aec42..f818091dde9 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalCloseable.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalCloseable.java @@ -20,11 +20,12 @@ public interface CriticalCloseable extends ArtemisCloseable { - - /** This will set something to be called right before closing. - * - * The use case that drove this call was a ReadWriteLock on the journal. - * Imagine that you need to call enterCritical, readWrite.lock() and then unlock and leaveCritical. - * By using this call I could reuse the same instance on the readWriteLock. */ + /** + * This will set something to be called right before closing. + *

    + * The use case that drove this call was a ReadWriteLock on the journal. Imagine that you need to call enterCritical, + * readWrite.lock() and then unlock and leaveCritical. By using this call I could reuse the same instance on the + * readWriteLock. + */ void beforeClose(ArtemisCloseable otherCloseable); } diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalComponent.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalComponent.java index b28d9b9470a..5db5fb5aa4c 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalComponent.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalComponent.java @@ -17,12 +17,11 @@ package org.apache.activemq.artemis.utils.critical; /** - * A Critical component enters and leaves a critical state. - * You update a long every time you enter a critical path - * you update a different long with a System.nanoTime every time you leave that path. - * - * If the enterCritical > leaveCritical at any point, then you need to measure the timeout. - * if the system stops responding, then you have something irresponsive at the system. + * A Critical component enters and leaves a critical state. You update a long every time you enter a critical path you + * update a different long with a System.nanoTime every time you leave that path. + *

    + * If the enterCritical > leaveCritical at any point, then you need to measure the timeout. if the system stops + * responding, then you have something irresponsive at the system. */ public interface CriticalComponent { @@ -32,8 +31,9 @@ public interface CriticalComponent { /** * Check if the component is expired at a given timeout.. on any of its paths. + * * @param timeout - the timeout to check if the component is expired - * @param reset - true to reset the component timer if it is expired + * @param reset - true to reset the component timer if it is expired * @return -1 if it's ok, or the number of the path it failed */ boolean checkExpiration(long timeout, boolean reset); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalComponentImpl.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalComponentImpl.java index ea08ce4bbc3..9daa4763c80 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalComponentImpl.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalComponentImpl.java @@ -17,8 +17,8 @@ package org.apache.activemq.artemis.utils.critical; /** - * This is not abstract as it could be used through aggregations or extensions. - * This is only good for cases where you call leave within the same thread as you called enter. + * This is not abstract as it could be used through aggregations or extensions. This is only good for cases where you + * call leave within the same thread as you called enter. */ public class CriticalComponentImpl implements CriticalComponent { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/pools/MpscPool.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/pools/MpscPool.java index 86e016368ee..8afd521d735 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/pools/MpscPool.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/pools/MpscPool.java @@ -23,13 +23,10 @@ import io.netty.util.internal.PlatformDependent; - /** - * A simple encapsulation of Netty MpscQueue to provide a pool of objects. - * Use this pool only when the borrowing of object (consume) is done on a single thread. - * This is using a Multi Producer Single Consumer queue (MPSC). - * If you need other uses you may create different strategies for ObjectPooling. - * @param + * A simple encapsulation of Netty MpscQueue to provide a pool of objects. Use this pool only when the borrowing of + * object (consume) is done on a single thread. This is using a Multi Producer Single Consumer queue (MPSC). If you need + * other uses you may create different strategies for ObjectPooling. */ public class MpscPool extends Pool { diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/pools/Pool.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/pools/Pool.java index 8f9340efb38..490250fcb8d 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/pools/Pool.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/pools/Pool.java @@ -23,7 +23,6 @@ /** * A simple encapsulation to provide a pool of objects. - * @param */ public abstract class Pool { @@ -40,7 +39,9 @@ public Pool(int maxSize, Consumer cleaner, Supplier supplier) { abstract Queue createQueue(int maxSize); - /** Use this to instantiate or return objects from the pool */ + /** + * Use this to instantiate or return objects from the pool + */ public final T borrow() { if (internalPool == null) { return supplier.get(); @@ -57,7 +58,9 @@ public final T borrow() { return returnObject; } - /** Return objects to the pool, they will be either reused or ignored by the max size */ + /** + * Return objects to the pool, they will be either reused or ignored by the max size + */ public final void release(T object) { if (internalPool != null) { internalPool.offer(object); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URIFactory.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URIFactory.java index 682bcfee70f..1e12b817774 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URIFactory.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URIFactory.java @@ -96,16 +96,14 @@ public URI createSchema(String scheme, T bean) throws Exception { return schemaFactory.newURI(bean); } - /* - * this method is used to change a string with multiple URI's in it into a valid URI. - * for instance it is possible to have the following String - * (tcp://localhost:61616,tcp://localhost:5545,tcp://localhost:5555)?somequery - * This is an invalid URI so will be changed so that the first URI is used and the - * extra ones added as part of the URI fragment, like so - * tcp://localhost:61616?someQuery#tcp://localhost:5545,tcp://localhost:5555. - * - * It is the job of the URISchema implementation to handle these fragments as needed. - * */ + /** + * this method is used to change a string with multiple URI's in it into a valid URI. for instance it is possible to + * have the following String {@literal (tcp://localhost:61616,tcp://localhost:5545,tcp://localhost:5555)?somequery} + * This is an invalid URI so will be changed so that the first URI is used and the extra ones added as part of the + * URI fragment, like so {@literal tcp://localhost:61616?someQuery#tcp://localhost:5545,tcp://localhost:5555}. + *

    + * It is the job of the URISchema implementation to handle these fragments as needed. + */ private URI normalise(String uri) throws URISyntaxException { if (uri.startsWith("(")) { String[] split = uri.split("\\)", 2); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISchema.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISchema.java index 4f83398eec3..3d4c413333c 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISchema.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISchema.java @@ -72,8 +72,8 @@ protected int getPort(URI uri) { } /** - * It will create a new Object for the URI selected schema. - * the propertyOverrides is used to replace whatever was defined on the URL string + * It will create a new Object for the URI selected schema. the propertyOverrides is used to replace whatever was + * defined on the URL string * * @param uri The URI * @param propertyOverrides used to replace whatever was defined on the URL string @@ -87,8 +87,7 @@ public T newObject(URI uri, Map propertyOverrides, P param) thro protected abstract T internalNewObject(URI uri, Map query, P param) throws Exception; /** - * This is the default implementation. - * Sub classes are should provide a proper implementation for their schemas. + * This is the default implementation. Sub classes are should provide a proper implementation for their schemas. */ protected URI internalNewURI(T bean) throws Exception { String query = BeanSupport.getData(null, bean); diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISupport.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISupport.java index 1dc2098e8a7..e9edae50318 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISupport.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/URISupport.java @@ -31,17 +31,17 @@ /** * Utility class that provides methods for parsing URI's - * - * This class can be used to split composite URI's into their component parts and is used to extract any - * URI options from each URI in order to set specific properties on Beans. - * - * (copied from activemq 5) + *

    + * This class can be used to split composite URI's into their component parts and is used to extract any URI options + * from each URI in order to set specific properties on Beans. + *

    + * (copied from ActiveMQ Classic) */ public class URISupport { /** - * A composite URI can be split into one or more CompositeData object which each represent the - * individual URIs that comprise the composite one. + * A composite URI can be split into one or more CompositeData object which each represent the individual URIs that + * comprise the composite one. */ public static class CompositeData { @@ -121,7 +121,7 @@ public static StringBuilder appendParameters(StringBuilder sb, Map parseQuery(String uri) { uri = uri.substring(uri.lastIndexOf("?") + 1); // get only the relevant part of the query @@ -155,13 +155,12 @@ private static void parseParameters(Map rc, String[] parameters) /** * Given a URI parse and extract any URI query options and return them as a Key / Value mapping. - * - * This method differs from the {@link URISupport#parseQuery(String)} method in that it handles composite URI types and - * will extract the URI options from the outermost composite URI. + *

    + * This method differs from the {@link URISupport#parseQuery(String)} method in that it handles composite URI types + * and will extract the URI options from the outermost composite URI. * * @param uri The URI whose query should be extracted and processed. - * @return A Mapping of the URI options. - * @throws java.net.URISyntaxException + * @return A Mapping of the URI options */ public static Map parseParameters(URI uri) throws URISyntaxException { if (!isCompositeURI(uri)) { @@ -190,8 +189,7 @@ public static Map parseParameters(URI uri) throws URISyntaxExcep * * @param uri The source URI that will have the Map entries appended as a URI query value. * @param queryParameters The Key / Value mapping that will be transformed into a URI query string. - * @return A new URI value that combines the given URI and the constructed query string. - * @throws java.net.URISyntaxException + * @return A new URI value that combines the given URI and the constructed query string */ public static URI applyParameters(URI uri, Map queryParameters) throws URISyntaxException { return applyParameters(uri, queryParameters, ""); @@ -205,8 +203,7 @@ public static URI applyParameters(URI uri, Map queryParameters) * @param uri The source URI that will have the Map entries appended as a URI query value. * @param queryParameters The Key / Value mapping that will be transformed into a URI query string. * @param optionPrefix A string value that when not null or empty is used to prefix each query option key. - * @return A new URI value that combines the given URI and the constructed query string. - * @throws java.net.URISyntaxException + * @return A new URI value that combines the given URI and the constructed query string */ public static URI applyParameters(URI uri, Map queryParameters, @@ -235,8 +232,7 @@ private static Map emptyMap() { * Removes any URI query from the given uri and return a new URI that does not contain the query portion. * * @param uri The URI whose query value is to be removed. - * @return a new URI that does not contain a query value. - * @throws java.net.URISyntaxException + * @return a new URI that does not contain a query value */ public static URI removeQuery(URI uri) throws URISyntaxException { return createURIWithQuery(uri, null); @@ -247,8 +243,7 @@ public static URI removeQuery(URI uri) throws URISyntaxException { * * @param uri The source URI whose existing query is replaced with the newly supplied one. * @param query The new URI query string that should be appended to the given URI. - * @return a new URI that is a combination of the original URI and the given query string. - * @throws java.net.URISyntaxException + * @return a new URI that is a combination of the original URI and the given query string */ public static URI createURIWithQuery(URI uri, String query) throws URISyntaxException { String schemeSpecificPart = uri.getRawSchemeSpecificPart(); @@ -268,12 +263,11 @@ public static URI createURIWithQuery(URI uri, String query) throws URISyntaxExce } /** - * Given a composite URI, parse the individual URI elements contained within that URI and return - * a CompositeData instance that contains the parsed URI values. + * Given a composite URI, parse the individual URI elements contained within that URI and return a CompositeData + * instance that contains the parsed URI values. * * @param uri The target URI that should be parsed. - * @return a new CompositeData instance representing the parsed composite URI. - * @throws java.net.URISyntaxException + * @return a new CompositeData instance representing the parsed composite URI */ public static CompositeData parseComposite(URI uri) throws URISyntaxException { @@ -291,7 +285,7 @@ public static CompositeData parseComposite(URI uri) throws URISyntaxException { * Examine a URI and determine if it is a Composite type or not. * * @param uri The URI that is to be examined. - * @return true if the given URI is a Composite type. + * @return true if the given URI is a Composite type */ public static boolean isCompositeURI(URI uri) { String ssp = stripPrefix(uri.getRawSchemeSpecificPart().trim(), "//").trim(); @@ -307,7 +301,7 @@ public static boolean isCompositeURI(URI uri) { * * @param str The string to be searched for a matching parend. * @param first The index in the string of the opening parend whose close value is to be searched. - * @return the index in the string where the closing parend is located. + * @return the index in the string where the closing parend is located * @throws java.net.URISyntaxException fi the string does not contain a matching parend. */ public static int indexOfParenthesisMatch(String str, int first) throws URISyntaxException { @@ -343,13 +337,12 @@ public static int indexOfParenthesisMatch(String str, int first) throws URISynta /** * Given a composite URI and a CompositeData instance and the scheme specific part extracted from the source URI, - * parse the composite URI and populate the CompositeData object with the results. The source URI is used only - * for logging as the ssp should have already been extracted from it and passed here. + * parse the composite URI and populate the CompositeData object with the results. The source URI is used only for + * logging as the ssp should have already been extracted from it and passed here. * * @param uri The original source URI whose ssp is parsed into the composite data. * @param rc The CompositeData instance that will be populated from the given ssp. * @param ssp The scheme specific part from the original string that is a composite or one or more URIs. - * @throws java.net.URISyntaxException */ private static void parseComposite(URI uri, CompositeData rc, String ssp) throws URISyntaxException { String componentString; @@ -401,11 +394,11 @@ private static void parseComposite(URI uri, CompositeData rc, String ssp) throws } /** - * Given the inner portion of a composite URI, split and return each inner URI as a string - * element in a new String array. + * Given the inner portion of a composite URI, split and return each inner URI as a string element in a new String + * array. * * @param str The inner URI elements of a composite URI string. - * @return an array containing each inner URI from the composite one. + * @return an array containing each inner URI from the composite one */ private static String[] splitComponents(String str) { List l = new ArrayList<>(); @@ -447,7 +440,7 @@ private static String[] splitComponents(String str) { * * @param value The string that should be trimmed of the given prefix if present. * @param prefix The prefix to remove from the target string. - * @return either the original string or a new string minus the supplied prefix if present. + * @return either the original string or a new string minus the supplied prefix if present */ public static String stripPrefix(String value, String prefix) { if (value.startsWith(prefix)) { @@ -460,19 +453,18 @@ public static String stripPrefix(String value, String prefix) { * Strip a URI of its scheme element. * * @param uri The URI whose scheme value should be stripped. - * @return The stripped URI value. - * @throws java.net.URISyntaxException + * @return The stripped URI value */ public static URI stripScheme(URI uri) throws URISyntaxException { return new URI(stripPrefix(uri.getSchemeSpecificPart().trim(), "//")); } /** - * Given a key / value mapping, create and return a URI formatted query string that is valid and - * can be appended to a URI. Query parameters in the string are sorted by key. + * Given a key / value mapping, create and return a URI formatted query string that is valid and can be appended to a + * URI. Query parameters in the string are sorted by key. * * @param options The Mapping that will create the new Query string. - * @return a URI formatted query string. + * @return a URI formatted query string */ public static String createQueryString(Map options) { if (!options.isEmpty()) { @@ -500,16 +492,14 @@ public static String createQueryString(Map options) { /** * Creates a URI from the original URI and the remaining parameters. - * - * When the query options of a URI are applied to certain objects the used portion of the query options needs - * to be removed and replaced with those that remain so that other parts of the code can attempt to apply the - * remainder or give an error is unknown values were given. This method is used to update a URI with those - * remainder values. + *

    + * When the query options of a URI are applied to certain objects the used portion of the query options needs to be + * removed and replaced with those that remain so that other parts of the code can attempt to apply the remainder or + * give an error is unknown values were given. This method is used to update a URI with those remainder values. * * @param originalURI The URI whose current parameters are remove and replaced with the given remainder value. * @param params The URI params that should be used to replace the current ones in the target. - * @return a new URI that matches the original one but has its query options replaced with the given ones. - * @throws java.net.URISyntaxException + * @return a new URI that matches the original one but has its query options replaced with the given ones */ public static URI createRemainingURI(URI originalURI, Map params) throws URISyntaxException { String s = createQueryString(params); @@ -520,13 +510,12 @@ public static URI createRemainingURI(URI originalURI, Map params } /** - * Given a URI value create and return a new URI that matches the target one but with the scheme value - * supplied to this method. + * Given a URI value create and return a new URI that matches the target one but with the scheme value supplied to + * this method. * * @param bindAddr The URI whose scheme value should be altered. * @param scheme The new scheme value to use for the returned URI. - * @return a new URI that is a copy of the original except that its scheme matches the supplied one. - * @throws java.net.URISyntaxException + * @return a new URI that is a copy of the original except that its scheme matches the supplied one */ public static URI changeScheme(URI bindAddr, String scheme) throws URISyntaxException { return new URI(scheme, bindAddr.getUserInfo(), bindAddr.getHost(), bindAddr.getPort(), bindAddr.getPath(), bindAddr.getQuery(), bindAddr.getFragment()); @@ -536,7 +525,7 @@ public static URI changeScheme(URI bindAddr, String scheme) throws URISyntaxExce * Examine the supplied string and ensure that all parens appear as matching pairs. * * @param str The target string to examine. - * @return true if the target string has valid paren pairings. + * @return true if the target string has valid paren pairings */ public static boolean checkParenthesis(String str) { boolean result = true; diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java index 5248f5ba48d..1cd92304acd 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/URIParserTest.java @@ -34,8 +34,6 @@ public class URIParserTest { /** * this is just a simple test to validate the model - * - * @throws Throwable */ @Test public void testSchemaFruit() throws Throwable { @@ -53,8 +51,6 @@ public void testSchemaFruit() throws Throwable { /** * this is just a simple test to validate the model - * - * @throws Throwable */ @Test public void testGenerateWithEncoding() throws Throwable { @@ -74,8 +70,6 @@ public void testGenerateWithEncoding() throws Throwable { /** * Even thought there's no host Property on FruitBase.. this should still work fine without throwing any exceptions - * - * @throws Throwable */ @Test public void testSchemaNoHosProperty() throws Throwable { @@ -88,8 +82,6 @@ public void testSchemaNoHosProperty() throws Throwable { /** * Even thought there's no host Property on FruitBase.. this should still work fine without throwing any exceptions - * - * @throws Throwable */ @Test public void testSchemaNoHostOnURL() throws Throwable { diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/ThresholdActorTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/ThresholdActorTest.java index 4a5d8d3588d..07b2749e843 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/ThresholdActorTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/actors/ThresholdActorTest.java @@ -142,9 +142,8 @@ public void testFlow() throws Exception { } /** - * This test will actually not respect the semaphore and keep going. - * The blockers and unblocks should still perform ok. - * @throws Exception + * This test will actually not respect the semaphore and keep going. The blockers and unblocks should still perform + * ok. */ @Test public void testFlow2() throws Exception { diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/collections/LongHashSetTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/collections/LongHashSetTest.java index a953fbab173..ee92f3e1336 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/collections/LongHashSetTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/collections/LongHashSetTest.java @@ -34,8 +34,9 @@ import org.junit.jupiter.api.Test; /** - * These tests are based on Agrona IntHashSetTest - * to guarantee a similar coverage to what's provided for a similar collection. + * These tests are based on Agrona + * IntHashSetTest to guarantee a similar coverage to what's provided for a similar collection. */ public class LongHashSetTest { 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 bb3033ee685..18a76a0e193 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 @@ -101,14 +101,11 @@ public static String getDefaultHapolicyBackupStrategy() { } //shared by client and core/server - // XXX not on schema? private static long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD = 30000; - // XXX not on schema? private static long DEFAULT_FILE_DEPLOYER_SCAN_PERIOD = 5000; - // These defaults are applied depending on whether the journal type - // is NIO or AIO. + // These defaults are applied depending on whether the journal type is NIO or AIO. private static int DEFAULT_JOURNAL_MAX_IO_AIO = 4096; private static int DEFAULT_JOURNAL_POOL_FILES = -1; private static int DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO = ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO; @@ -117,7 +114,6 @@ public static String getDefaultHapolicyBackupStrategy() { private static int DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO = ArtemisConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO; private static int DEFAULT_JOURNAL_BUFFER_SIZE_NIO = ArtemisConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO; - // XXX not on schema. //properties passed to acceptor/connectors. private static String PROP_MASK_PASSWORD = "activemq.usemaskedpassword"; private static String PROP_PASSWORD_CODEC = "activemq.passwordcodec"; @@ -713,21 +709,23 @@ public static String getDefaultHapolicyBackupStrategy() { private static final boolean DEFAULT_MIRROR_PAGE_TRANSACTION = false; /** - * If true then the ActiveMQ Artemis Server will make use of any Protocol Managers that are in available on the classpath. If false then only the core protocol will be available, unless in Embedded mode where users can inject their own Protocol Managers. + * If {@code true} then the ActiveMQ Artemis Server will make use of any Protocol Managers that are in available on + * the classpath. If false then only the core protocol will be available, unless in Embedded mode where users can + * inject their own Protocol Managers. */ public static boolean isDefaultResolveProtocols() { return DEFAULT_RESOLVE_PROTOCOLS; } /** - * true means that the server will load configuration from the configuration files + * {@code true} means that the server will load configuration from the configuration files */ public static boolean isDefaultFileDeploymentEnabled() { return DEFAULT_FILE_DEPLOYMENT_ENABLED; } /** - * true means that the server will use the file based journal for persistence. + * {@code true} means that the server will use the file based journal for persistence. */ public static boolean isDefaultPersistenceEnabled() { return DEFAULT_PERSISTENCE_ENABLED; @@ -756,21 +754,21 @@ public static int getDefaultThreadPoolMaxSize() { } /** - * true means that security is enabled + * {@code true} means that security is enabled */ public static boolean isDefaultSecurityEnabled() { return DEFAULT_SECURITY_ENABLED; } /** - * true means that graceful shutdown is enabled + * {@code true} means that graceful shutdown is enabled */ public static boolean isDefaultGracefulShutdownEnabled() { return DEFAULT_GRACEFUL_SHUTDOWN_ENABLED; } /** - * true means that graceful shutdown is enabled + * {@code true} means that graceful shutdown is enabled */ public static long getDefaultGracefulShutdownTimeout() { return DEFAULT_GRACEFUL_SHUTDOWN_TIMEOUT; @@ -805,7 +803,7 @@ public static long getDefaultJournalLockAcquisitionTimeout() { } /** - * true means that the server supports wild card routing + * {@code true} means that the server supports wild card routing */ public static boolean isDefaultWildcardRoutingEnabled() { return DEFAULT_WILDCARD_ROUTING_ENABLED; @@ -816,7 +814,8 @@ public static String getDefaultAddressPathSeparator() { } /** - * the name of the management address to send management messages to. It is prefixed with "jms.queue" so that JMS clients can send messages to it. + * the name of the management address to send management messages to. It is prefixed with "jms.queue" so that JMS + * clients can send messages to it. */ public static SimpleString getDefaultManagementAddress() { return DEFAULT_MANAGEMENT_ADDRESS; @@ -865,14 +864,15 @@ public static String getDefaultFederationPassword() { } /** - * This option controls whether passwords in server configuration need be masked. If set to "true" the passwords are masked. + * This option controls whether passwords in server configuration need be masked. If set to "true" the passwords are + * masked. */ public static Boolean isDefaultMaskPassword() { return DEFAULT_MASK_PASSWORD; } /** - * true means that the management API is available via JMX + * {@code true} means that the management API is available via JMX */ public static boolean isDefaultJmxManagementEnabled() { return DEFAULT_JMX_MANAGEMENT_ENABLED; @@ -890,7 +890,7 @@ public static boolean isDefaultJMXUseBrokerName() { } /** - * true means that message counters are enabled + * {@code true} means that message counters are enabled */ public static boolean isDefaultMessageCounterEnabled() { return DEFAULT_MESSAGE_COUNTER_ENABLED; @@ -911,14 +911,16 @@ public static int getDefaultMessageCounterMaxDayHistory() { } /** - * if set, this will override how long (in ms) to keep a connection alive without receiving a ping. -1 disables this setting. + * if set, this will override how long (in ms) to keep a connection alive without receiving a ping. -1 disables this + * setting. */ public static long getDefaultConnectionTtlOverride() { return DEFAULT_CONNECTION_TTL_OVERRIDE; } /** - * should certain incoming packets on the server be handed off to a thread from the thread pool for processing or should they be handled on the remoting thread? + * should certain incoming packets on the server be handed off to a thread from the thread pool for processing or + * should they be handled on the remoting thread? */ public static boolean isDefaultAsyncConnectionExecutionEnabled() { return DEFAULT_ASYNC_CONNECTION_EXECUTION_ENABLED; @@ -973,14 +975,15 @@ public static int getDefaultIdCacheSize() { } /** - * true means that ID's are persisted to the journal + * {@code true} means that ID's are persisted to the journal */ public static boolean isDefaultPersistIdCache() { return DEFAULT_PERSIST_ID_CACHE; } /** - * True means that the delivery count is persisted before delivery. False means that this only happens after a message has been cancelled. + * {@code true} means that the delivery count is persisted before delivery. False means that this only happens after + * a message has been cancelled. */ public static boolean isDefaultPersistDeliveryCountBeforeDelivery() { return DEFAULT_PERSIST_DELIVERY_COUNT_BEFORE_DELIVERY; @@ -1001,7 +1004,7 @@ public static String getDefaultBindingsDirectory() { } /** - * true means that the server will create the bindings directory on start up + * {@code true} means that the server will create the bindings directory on start up */ public static boolean isDefaultCreateBindingsDir() { return DEFAULT_CREATE_BINDINGS_DIR; @@ -1034,14 +1037,14 @@ public static String getDefaultDataDir() { } /** - * true means that the journal directory will be created + * {@code true} means that the journal directory will be created */ public static boolean isDefaultCreateJournalDir() { return DEFAULT_CREATE_JOURNAL_DIR; } /** - * if true wait for transaction data to be synchronized to the journal before returning response to client + * if {@code true} wait for transaction data to be synchronized to the journal before returning response to client */ public static boolean isDefaultJournalSyncTransactional() { return DEFAULT_JOURNAL_SYNC_TRANSACTIONAL; @@ -1052,7 +1055,7 @@ public static boolean isDefaultLargeMessageSync() { } /** - * if true wait for non transaction data to be synced to the journal before returning response to client. + * if {@code true} wait for non transaction data to be synced to the journal before returning response to client. */ public static boolean isDefaultJournalSyncNonTransactional() { return DEFAULT_JOURNAL_SYNC_NON_TRANSACTIONAL; @@ -1081,8 +1084,6 @@ public static int getDefaultJournalMinFiles() { /** * How many journal files can be resued - * - * @return */ public static int getDefaultJournalPoolFiles() { return DEFAULT_JOURNAL_POOL_FILES; @@ -1149,14 +1150,16 @@ public static long getDefaultBroadcastPeriod() { } /** - * Period the discovery group waits after receiving the last broadcast from a particular server before removing that servers connector pair entry from its list. + * Period the discovery group waits after receiving the last broadcast from a particular server before removing that + * servers connector pair entry from its list. */ public static int getDefaultBroadcastRefreshTimeout() { return DEFAULT_BROADCAST_REFRESH_TIMEOUT; } /** - * how long to keep a connection alive in the absence of any data arriving from the client. This should be greater than the ping period. + * how long to keep a connection alive in the absence of any data arriving from the client. This should be greater + * than the ping period. */ public static long getDefaultConnectionTtl() { return DEFAULT_CONNECTION_TTL; @@ -1212,14 +1215,16 @@ public static int getDefaultBridgeProducerWindowSize() { } /** - * Upon reconnection this configures the number of time the same node on the topology will be retried before reseting the server locator and using the initial connectors + * Upon reconnection this configures the number of time the same node on the topology will be retried before reseting + * the server locator and using the initial connectors */ public static int getDefaultBridgeConnectSameNode() { return DEFAULT_BRIDGE_CONNECT_SAME_NODE; } /** - * The period (in milliseconds) used to check if the cluster connection has failed to receive pings from another server + * The period (in milliseconds) used to check if the cluster connection has failed to receive pings from another + * server */ public static long getDefaultClusterFailureCheckPeriod() { return DEFAULT_CLUSTER_FAILURE_CHECK_PERIOD; @@ -1349,7 +1354,7 @@ public static String getDefaultBridgeRoutingType() { } /** - * If true then the server will request a backup on another node + * If {@code true} then the server will request a backup on another node */ public static boolean isDefaultHapolicyRequestBackup() { return DEFAULT_HAPOLICY_REQUEST_BACKUP; @@ -1370,7 +1375,7 @@ public static long getDefaultHapolicyBackupRequestRetryInterval() { } /** - * Whether or not this server will accept backup requests from other servers. + * Whether this server will accept backup requests from other servers. */ public static int getDefaultHapolicyMaxBackups() { return DEFAULT_HAPOLICY_MAX_BACKUPS; @@ -1384,14 +1389,17 @@ public static int getDefaultHapolicyBackupPortOffset() { } /** - * Whether to check the cluster for an active server using our own server ID when starting up. This option is only necessary for performing 'fail-back' on replicating servers. Strictly speaking this setting only applies to primary servers and not to backups. + * Whether to check the cluster for an active server using our own server ID when starting up. This option is only + * necessary for performing 'fail-back' on replicating servers. Strictly speaking this setting only applies to + * primary servers and not to backups. */ public static boolean isDefaultCheckForActiveServer() { return DEFAULT_CHECK_FOR_ACTIVE_SERVER; } /** - * This specifies how many times a replicated backup server can restart after moving its files on start. Once there are this number of backup journal files the server will stop permanently after if fails back. + * This specifies how many times a replicated backup server can restart after moving its files on start. Once there + * are this number of backup journal files the server will stop permanently after if fails back. */ public static int getDefaultMaxSavedReplicatedJournalsSize() { return DEFAULT_MAX_SAVED_REPLICATED_JOURNALS_SIZE; @@ -1405,7 +1413,9 @@ public static boolean isDefaultRestartBackup() { } /** - * Whether a server will automatically stop when another places a request to take over its place. The use case is when a regular server stops and its backup takes over its duties, later the main server restarts and requests the server (the former backup) to stop operating. + * Whether a server will automatically stop when another places a request to take over its place. The use case is + * when a regular server stops and its backup takes over its duties, later the main server restarts and requests the + * server (the former backup) to stop operating. */ public static boolean isDefaultAllowAutoFailback() { return DEFAULT_ALLOW_AUTO_FAILBACK; @@ -1454,7 +1464,8 @@ public static boolean isDefaultRejectEmptyValidatedUser() { } /** - * its possible that you only want a server to partake in scale down as a receiver, via a group. In this case set scale-down to false + * its possible that you only want a server to partake in scale down as a receiver, via a group. In this case set + * scale-down to false */ public static boolean isDefaultScaleDownEnabled() { return DEFAULT_SCALE_DOWN_ENABLED; @@ -1468,7 +1479,9 @@ public static int getDefaultGroupingHandlerTimeout() { } /** - * How long a group binding will be used, -1 means for ever. Bindings are removed after this wait elapses. On the remote node this is used to determine how often you should re-query the main coordinator in order to update the last time used accordingly. + * How long a group binding will be used, -1 means for ever. Bindings are removed after this wait elapses. On the + * remote node this is used to determine how often you should re-query the main coordinator in order to update the + * last time used accordingly. */ public static int getDefaultGroupingHandlerGroupTimeout() { return DEFAULT_GROUPING_HANDLER_GROUP_TIMEOUT; @@ -1765,7 +1778,8 @@ public static long getDefaultRetryReplicationWait() { } /** - * The period (in milliseconds) used to check if the federation connection has failed to receive pings from another server + * The period (in milliseconds) used to check if the federation connection has failed to receive pings from another + * server */ public static long getDefaultFederationFailureCheckPeriod() { return DEFAULT_FEDERATION_FAILURE_CHECK_PERIOD; @@ -1828,21 +1842,21 @@ public static long getDefaultFederationCallFailoverTimeout() { } /** - * Whether or not to report JVM memory metrics + * Whether to report JVM memory metrics */ public static boolean getDefaultJvmMemoryMetrics() { return DEFAULT_JVM_MEMORY_METRICS; } /** - * Whether or not to report JVM GC metrics + * Whether to report JVM GC metrics */ public static boolean getDefaultJvmGcMetrics() { return DEFAULT_JVM_GC_METRICS; } /** - * Whether or not to report JVM thread metrics + * Whether to report JVM thread metrics */ public static boolean getDefaultJvmThreadMetrics() { return DEFAULT_JVM_THREAD_METRICS; @@ -1865,42 +1879,42 @@ public static long getDefaultBridgePendingAckTimeout() { } /** - * Whether or not to report Netty pool metrics + * Whether to report Netty pool metrics */ public static Boolean getDefaultNettyPoolMetrics() { return DEFAULT_NETTY_POOL_METRICS; } /** - * Whether or not to report file descriptor metrics + * Whether to report file descriptor metrics */ public static Boolean getDefaultFileDescriptorsMetrics() { return DEFAULT_FILE_DESCRIPTORS_METRICS; } /** - * Whether or not to report processor metrics + * Whether to report processor metrics */ public static Boolean getDefaultProcessorMetrics() { return DEFAULT_PROCESSOR_METRICS; } /** - * Whether or not to report uptime metrics + * Whether to report uptime metrics */ public static Boolean getDefaultUptimeMetrics() { return DEFAULT_UPTIME_METRICS; } /** - * Whether or not to report logging metrics + * Whether to report logging metrics */ public static Boolean getDefaultLoggingMetrics() { return DEFAULT_LOGGING_METRICS; } /** - * Whether or not to report security cache metrics + * Whether to report security cache metrics */ public static Boolean getDefaultSecurityCacheMetrics() { return DEFAULT_SECURITY_CACHE_METRICS; @@ -1945,9 +1959,11 @@ public static boolean getManagementMessagesRbac() { } - /** This configures the Mirror Ack Manager number of attempts on queues before trying page acks. - * It is not intended to be configured through the XML. - * The default value here is 5. */ + /* + * This configures the Mirror Ack Manager number of attempts on queues before trying page acks. + * It is not intended to be configured through the XML. + * The default value here is 5. + */ public static int getMirrorAckManagerQueueAttempts() { return DEFAULT_MIRROR_ACK_MANAGER_QUEUE_ATTEMPTS; } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BaseInterceptor.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BaseInterceptor.java index 200e6b5d03e..4141562bf0a 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BaseInterceptor.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BaseInterceptor.java @@ -26,9 +26,8 @@ public interface BaseInterceptor

    { * * @param packet the packet being received * @param connection the connection the packet was received on - * @return {@code true} to process the next interceptor and handle the packet, - * {@code false} to abort processing of the packet - * @throws ActiveMQException + * @return {@code true} to process the next interceptor and handle the packet, {@code false} to abort processing of + * the packet */ boolean intercept(P packet, RemotingConnection connection) throws ActiveMQException; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BroadcastEndpoint.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BroadcastEndpoint.java index 7a275a478bc..5ff991c0634 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BroadcastEndpoint.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BroadcastEndpoint.java @@ -39,29 +39,21 @@ public interface BroadcastEndpoint { /** - * This method initializes a BroadcastEndpoint as - * a receiving end for broadcasts. After that data can be - * received using one of its receiveBroadcast() methods. - * - * @throws Exception + * This method initializes a BroadcastEndpoint as a receiving end for broadcasts. After that data can be received + * using one of its receiveBroadcast() methods. */ void openClient() throws Exception; /** - * This method initializes a BroadcastEndpint as - * a broadcaster. After that data can be sent - * via its broadcast() method. - * - * @throws Exception + * This method initializes a BroadcastEndpint as a broadcaster. After that data can be sent via its broadcast() + * method. */ void openBroadcaster() throws Exception; /** - * Close the endpoint. Any related resources should - * be cleaned up in this method. + * Close the endpoint. Any related resources should be cleaned up in this method. * * @param isBroadcast : indicates whether this endpoint serves as a broadcast or not. - * @throws Exception */ void close(boolean isBroadcast) throws Exception; @@ -69,7 +61,6 @@ public interface BroadcastEndpoint { * Broadcasting data to the cluster. * * @param data : a byte array containing the data. - * @throws Exception */ void broadcast(byte[] data) throws Exception; @@ -77,20 +68,17 @@ public interface BroadcastEndpoint { * Receives the broadcast data. It blocks until data is * available. * - * @return the received data as byte array. - * @throws Exception + * @return the received data as byte array */ byte[] receiveBroadcast() throws Exception; /** - * Receives the broadcast data with a timeout. It blocks until either - * the data is available or the timeout is reached, whichever comes first. + * Receives the broadcast data with a timeout. It blocks until either the data is available or the timeout is + * reached, whichever comes first. * * @param time : how long the method should wait for the data to arrive. * @param unit : unit of the time. - * @return a byte array if data is arrived within the timeout, or null if no data - * is available after the timeout. - * @throws Exception + * @return a byte array if data is arrived within the timeout, or null if no data is available after the timeout. */ byte[] receiveBroadcast(long time, TimeUnit unit) throws Exception; } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BroadcastGroupConfiguration.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BroadcastGroupConfiguration.java index 168d840b01f..a7bc7720909 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BroadcastGroupConfiguration.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/BroadcastGroupConfiguration.java @@ -22,8 +22,8 @@ import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration; /** - * The basic configuration used to determine how the server will broadcast members - * This is analogous to {@link DiscoveryGroupConfiguration} + * The basic configuration used to determine how the server will broadcast members This is analogous to + * {@link DiscoveryGroupConfiguration} */ public final class BroadcastGroupConfiguration implements Serializable { 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 175bacfa6c7..f9f5f24500b 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 @@ -24,7 +24,7 @@ /** * An implementation of BroadcastEndpointFactory that uses an externally managed JChannel for JGroups clustering. - * + *

    * Note - the underlying JChannel is not closed in this implementation. */ public class ChannelBroadcastEndpointFactory implements BroadcastEndpointFactory { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/DiscoveryGroupConfiguration.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/DiscoveryGroupConfiguration.java index 11985fb8a05..17bf9bb73b5 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/DiscoveryGroupConfiguration.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/DiscoveryGroupConfiguration.java @@ -24,11 +24,12 @@ /** * This file represents how we are using Discovery. *

    - * The discovery configuration could either use plain UDP, or JGroups.
    - * If using UDP, all the UDP properties will be filled and the jgroups properties will be - * {@code null}.
    - * If using JGroups, all the UDP properties will be -1 or {@code null} and the jgroups properties - * will be filled.
    + * The discovery configuration could either use plain UDP or JGroups. + *

    + * If using UDP, all the UDP properties will be filled and the jgroups properties will be {@code null}. + *

    + * If using JGroups, all the UDP properties will be -1 or {@code null} and the jgroups properties will be filled. + *

    * If by any reason, both properties are filled, the JGroups takes precedence. That means, if * {@code jgroupsFile != null} then the Grouping method used will be JGroups. */ @@ -42,9 +43,7 @@ public final class DiscoveryGroupConfiguration implements Serializable { private long discoveryInitialWaitTimeout = ActiveMQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT; - /* - * This is the actual object used by the class, it has to be transient so we can handle deserialization with a 2.2 client - * */ + // This is the actual object used by the class, it has to be transient so we can handle deserialization with a 2.2 client private BroadcastEndpointFactory endpointFactory; public DiscoveryGroupConfiguration() { @@ -58,32 +57,20 @@ public long getRefreshTimeout() { return refreshTimeout; } - /** - * @param name the name to set - */ public DiscoveryGroupConfiguration setName(final String name) { this.name = name; return this; } - /** - * @param refreshTimeout the refreshTimeout to set - */ public DiscoveryGroupConfiguration setRefreshTimeout(final long refreshTimeout) { this.refreshTimeout = refreshTimeout; return this; } - /** - * @return the discoveryInitialWaitTimeout - */ public long getDiscoveryInitialWaitTimeout() { return discoveryInitialWaitTimeout; } - /** - * @param discoveryInitialWaitTimeout the discoveryInitialWaitTimeout to set - */ public DiscoveryGroupConfiguration setDiscoveryInitialWaitTimeout(long discoveryInitialWaitTimeout) { this.discoveryInitialWaitTimeout = discoveryInitialWaitTimeout; return this; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/FilterConstants.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/FilterConstants.java index d50b7217e88..97e9525a2c6 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/FilterConstants.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/FilterConstants.java @@ -17,8 +17,8 @@ package org.apache.activemq.artemis.api.core; /** - * Constants representing pre-defined message attributes that can be referenced in ActiveMQ Artemis core - * filter expressions. + * Constants representing pre-defined message attributes that can be referenced in ActiveMQ Artemis core filter + * expressions. */ public final class FilterConstants { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/ICoreMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/ICoreMessage.java index 75011229b3a..1ee402dcfbb 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/ICoreMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/ICoreMessage.java @@ -28,7 +28,9 @@ */ public interface ICoreMessage extends Message { - /** The buffer will belong to this message, until release is called. */ + /** + * The buffer will belong to this message, until release is called. + */ Message setBuffer(ByteBuf buffer); ByteBuf getBuffer(); @@ -41,45 +43,34 @@ public interface ICoreMessage extends Message { InputStream getBodyInputStream(); /** - * Returns a new Buffer slicing the current Body. + * {@return a new Buffer slicing the current Body} */ ActiveMQBuffer getReadOnlyBodyBuffer(); /** - * Returns the length in bytes of the body buffer. + * {@return the length in bytes of the body buffer} */ int getBodyBufferSize(); /** - * Returns a readOnlyBodyBuffer or a decompressed one if the message is compressed. - * or the large message buffer. - * @return + * {@return a readOnlyBodyBuffer or a decompressed one if the message is compressed or the large message buffer} */ ActiveMQBuffer getDataBuffer(); - /** - * Return the type of the message - */ @Override byte getType(); - /** - * the type of the message - */ @Override CoreMessage setType(byte type); /** * We are really interested if this is a LargeServerMessage. - * - * @return */ boolean isServerMessage(); /** - * The buffer to write the body. - * Warning: If you just want to read the content of a message, use getDataBuffer() or getReadOnlyBuffer(); - * @return + * The buffer to write the body. Warning: If you just want to read the content of a message, use + * {@link #getDataBuffer()} or {@link #getReadOnlyBodyBuffer()} */ @Override ActiveMQBuffer getBodyBuffer(); @@ -87,13 +78,12 @@ public interface ICoreMessage extends Message { int getEndOfBodyPosition(); /** - * Used on large messages treatment. - * this method is used to transfer properties from a temporary CoreMessage to a definitive one. - * This is used when before a Message was defined as a LargeMessages, its properties are then moved from the - * Temporary message to its final LargeMessage object. - * - * Be careful as this will not perform a copy of the Properties. - * For real copy, use the copy methods or copy constructors. + * Used on large messages treatment. this method is used to transfer properties from a temporary CoreMessage to a + * definitive one. This is used when before a Message was defined as a LargeMessages, its properties are then moved + * from the Temporary message to its final LargeMessage object. + *

    + * Be careful as this will not perform a copy of the Properties. For real copy, use the copy methods or copy + * constructors. */ void moveHeadersAndProperties(Message msg); @@ -105,8 +95,7 @@ public interface ICoreMessage extends Message { void receiveBuffer_1X(ByteBuf buffer); /** - * @return Returns the message in Map form, useful when encoding to JSON - * @param valueSizeLimit + * {@inheritDoc} */ @Override default Map toMap(int valueSizeLimit) { @@ -127,7 +116,6 @@ default Map toMap(int valueSizeLimit) { return map; } - default boolean isConfirmed() { return false; } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Interceptor.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Interceptor.java index 9db3df26522..ae3ce7d002a 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Interceptor.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Interceptor.java @@ -22,8 +22,10 @@ * This is class is a simple way to intercepting calls on ActiveMQ Artemis client and servers. *

    * To add an interceptor to ActiveMQ Artemis server, you have to modify the server configuration file - * {@literal broker.xml}.
    - * To add it to a client, use {@link org.apache.activemq.artemis.api.core.client.ServerLocator#addIncomingInterceptor(Interceptor)} + * {@literal broker.xml}. + *

    + * To add it to a client, use + * {@link org.apache.activemq.artemis.api.core.client.ServerLocator#addIncomingInterceptor(Interceptor)} */ public interface Interceptor extends BaseInterceptor { 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 323a598c5ed..4c1bace6421 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 @@ -136,10 +136,8 @@ public synchronized void close(boolean isBroadcast) throws Exception { } /** - * Closes the channel used in this JGroups Broadcast. - * Can be overridden by implementations that use an externally managed channel. - * - * @param channel + * Closes the channel used in this JGroups Broadcast. Can be overridden by implementations that use an externally + * managed channel. */ protected synchronized void internalCloseChannel(JChannelWrapper channel) { channel.close(true); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JGroupsChannelBroadcastEndpoint.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JGroupsChannelBroadcastEndpoint.java index 2317169f33a..0dff8a7ae36 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JGroupsChannelBroadcastEndpoint.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JGroupsChannelBroadcastEndpoint.java @@ -22,7 +22,7 @@ /** * An implementation of JGroupsBroadcastEndpoint that uses an externally managed JChannel for its operations. - * + *

    * Note - this implementation does not close the JChannel, since its externally created. */ public class JGroupsChannelBroadcastEndpoint extends JGroupsBroadcastEndpoint { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java index f7bd4d607f1..7bf8fbfbd77 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java @@ -31,13 +31,13 @@ /** * A Message is a routable instance that has a payload. *

    - * The payload (the "body") is opaque to the messaging system. A Message also has a fixed set of - * headers (required by the messaging system) and properties (defined by the users) that can be used - * by the messaging system to route the message (e.g. to ensure it matches a queue filter). + * The payload (the "body") is opaque to the messaging system. A Message also has a fixed set of headers (required by + * the messaging system) and properties (defined by the users) that can be used by the messaging system to route the + * message (e.g. to ensure it matches a queue filter). *

    Message Properties

    *

    - * Message can contain properties specified by the users. It is possible to convert from some types - * to other types as specified by the following table: + * Message can contain properties specified by the users. It is possible to convert from some types to other types as + * specified by the following table: *

      * |        | boolean byte short int long float double String byte[]
      * |----------------------------------------------------------------
    @@ -52,25 +52,23 @@
      * |byte[]  |                                                   X
      * |-----------------------------------------------------------------
      * 
    + * If conversion is not allowed (for example calling {@code getFloatProperty} on a property set a {@code boolean}), a + * {@link ActiveMQPropertyConversionException} will be thrown. *

    - * If conversion is not allowed (for example calling {@code getFloatProperty} on a property set a - * {@code boolean}), a {@link ActiveMQPropertyConversionException} will be thrown. - * - * * User cases that will be covered by Message - * + *

    * Receiving a buffer: - * + *

    {@code
      * Message encode = new CoreMessage(); // or any other implementation
      * encode.receiveBuffer(buffer);
    - *
    - *
    + * }
    + *

    * Sending to a buffer: - * + *

    {@code
      * Message encode;
      * size = encode.getEncodeSize();
      * encode.encodeDirectly(bufferOutput);
    - *
    + * }
    */ public interface Message { @@ -155,7 +153,8 @@ public interface Message { SimpleString HDR_LAST_VALUE_NAME = SimpleString.of("_AMQ_LVQ_NAME"); /** - * To define the mime-type of body messages. Mainly for stomp but it could be informed on any message for user purposes. + * To define the mime-type of body messages. Mainly for stomp but it could be informed on any message for user + * purposes. */ SimpleString HDR_CONTENT_TYPE = SimpleString.of("_AMQ_CONTENT_TYPE"); @@ -180,8 +179,8 @@ public interface Message { SimpleString HDR_INGRESS_TIMESTAMP = SimpleString.of("_AMQ_INGRESS_TIMESTAMP"); /** - * The prefix used (if any) when sending this message. For protocols (e.g. STOMP) that need to track this and restore - * the prefix when the message is consumed. + * The prefix used (if any) when sending this message. For protocols (e.g. STOMP) that need to track this and + * restore the prefix when the message is consumed. */ SimpleString HDR_PREFIX = SimpleString.of("_AMQ_PREFIX"); @@ -197,10 +196,15 @@ public interface Message { byte STREAM_TYPE = 6; - /** The message will contain another message persisted through {@literal org.apache.activemq.artemis.spi.core.protocol.EmbedMessageUtil}*/ + /** + * The message will contain another message persisted through + * {@code org.apache.activemq.artemis.spi.core.protocol.EmbedMessageUtil} + */ byte EMBEDDED_TYPE = 7; - /** This is to embedd Large Messages from other protocol */ + /** + * This is to embedd Large Messages from other protocol + */ byte LARGE_EMBEDDED_TYPE = 8; default void clearInternalProperties() { @@ -211,8 +215,7 @@ default void clearAMQPProperties() { } /** - * Search for the existence of the property: an implementor can save - * the message to be decoded, if possible. + * Search for the existence of the property: an implementor can save the message to be decoded, if possible. */ default boolean hasScheduledDeliveryTime() { return getScheduledDeliveryTime() != null; @@ -243,18 +246,17 @@ default InputStream getBodyInputStream() { } /** - * @deprecated do not use this, use through ICoreMessage or ClientMessage - * Warning: if you need to read the content of a message use getDataBuffer(). This method is intended for when you - * want to make changes. + * @deprecated do not use this, use through ICoreMessage or ClientMessage Warning: if you need to read the content of + * a message use getDataBuffer(). This method is intended for when you want to make changes. */ @Deprecated default ActiveMQBuffer getBodyBuffer() { return null; } - /** - * @deprecated do not use this, use through ICoreMessage or ClientMessage - */ + /** + * @deprecated do not use this, use through ICoreMessage or ClientMessage + */ @Deprecated default byte getType() { return (byte)0; @@ -273,8 +275,9 @@ default Message setType(byte type) { */ void messageChanged(); - /** Used to calculate what is the delivery time. - * Return null if not scheduled. */ + /** + * Used to calculate what is the delivery time. Return null if not scheduled. + */ Long getScheduledDeliveryTime(); void setPaged(); @@ -318,13 +321,19 @@ default Message setCorrelationID(Object correlationID) { Message setReplyTo(SimpleString address); - /** It will generate a new instance of the message encode, being a deep copy, new properties, new everything */ + /** + * It will generate a new instance of the message encode, being a deep copy, new properties, new everything + */ Message copy(); - /** It will generate a new instance of the message encode, being a deep copy, new properties, new everything */ + /** + * It will generate a new instance of the message encode, being a deep copy, new properties, new everything + */ Message copy(long newID); - /** It will generate a new instance of the message encode, being a deep copy, new properties, new everything */ + /** + * It will generate a new instance of the message encode, being a deep copy, new properties, new everything + */ default Message copy(long newID, boolean isExpiryOrDLQ) { return copy(newID); } @@ -337,9 +346,7 @@ default void rejectConsumer(long uniqueConsumerID) { } /** - * Returns the messageID. - *
    - * The messageID is set when the message is handled by the server. + * {@return the messageID; the messageID is set when the message is handled by the server} */ long getMessageID(); @@ -361,7 +368,7 @@ default boolean isLargeMessage() { } /** - * Returns the expiration time of this message. + * {@return the expiration time of this message} */ long getExpiration(); @@ -373,7 +380,7 @@ default boolean isLargeMessage() { Message setExpiration(long expiration); /** - * Returns whether this message is expired or not. + * {@return whether this message is expired or not} */ default boolean isExpired() { if (getExpiration() == 0) { @@ -383,12 +390,10 @@ default boolean isExpired() { return System.currentTimeMillis() - getExpiration() >= 0; } - /** - * - * This represents historically the JMSMessageID. - * We had in the past used this for the MessageID that was sent on core messages... - * + * This represents historically the JMSMessageID. We had in the past used this for the MessageID that was sent on + * core messages... + *

    * later on when we added AMQP this name clashed with AMQPMessage.getUserID(); * * @return the user id @@ -406,7 +411,7 @@ default Message setValidatedUserID(String validatedUserID) { } /** - * Returns whether this message is durable or not. + * {@return whether this message is durable or not} */ boolean isDurable(); @@ -423,8 +428,6 @@ default Message setValidatedUserID(String validatedUserID) { /** * Look at {@link #setAddress(SimpleString)} for the doc. - * @param address - * @return */ Message setAddress(String address); @@ -432,16 +435,13 @@ default Message setValidatedUserID(String validatedUserID) { /** * This will set the address on CoreMessage. - * - * Note for AMQPMessages: - * in AMQPMessages this will not really change the address on the message. Instead it will add a property - * on extraProperties which only transverse internally at the broker. - * Whatever you change here it won't affect anything towards the received message. - * + *

    + * Note for AMQPMessages: in AMQPMessages this will not really change the address on the message. Instead it will add + * a property on extraProperties which only transverse internally at the broker. Whatever you change here it won't + * affect anything towards the received message. + *

    * If you wish to change AMQPMessages address you will have to do it directly at the AMQP Message, however beware * that AMQPMessages are not supposed to be changed at the broker, so only do it if you know what you are doing. - * @param address - * @return */ Message setAddress(SimpleString address); @@ -450,9 +450,7 @@ default Message setValidatedUserID(String validatedUserID) { Message setTimestamp(long timestamp); /** - * Returns the message priority. - *

    - * Values range from 0 (less priority) to 9 (more priority) inclusive. + * {@return the message priority; values range from 0 (less priority) to 9 (more priority) inclusive} */ byte getPriority(); @@ -465,12 +463,17 @@ default Message setValidatedUserID(String validatedUserID) { */ Message setPriority(byte priority); - /** Used to receive this message from an encoded medium buffer */ + /** + * Used to receive this message from an encoded medium buffer + */ void receiveBuffer(ByteBuf buffer); - /** Used to send this message to an encoded medium buffer. - * @param buffer the buffer used. - * @param deliveryCount Some protocols (AMQP) will have this as part of the message. */ + /** + * Used to send this message to an encoded medium buffer. + * + * @param buffer the buffer used. + * @param deliveryCount Some protocols (AMQP) will have this as part of the message. + */ void sendBuffer(ByteBuf buffer, int deliveryCount); int getPersistSize(); @@ -479,7 +482,9 @@ default Message setValidatedUserID(String validatedUserID) { void reloadPersistence(ActiveMQBuffer record, CoreMessageObjectPools pools); - /** Propagate message modifications to clients. */ + /** + * Propagate message modifications to clients. + */ default void reencode() { // only valid probably on AMQP } @@ -499,7 +504,6 @@ default void referenceOriginalMessage(final Message original, final SimpleString /** * it will translate a property named HDR_DUPLICATE_DETECTION_ID. - * @return */ default byte[] getDuplicateIDBytes() { Object duplicateID = getDuplicateProperty(); @@ -534,59 +538,95 @@ default Object getDuplicateProperty() { return null; } - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putBooleanProperty(String key, boolean value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putByteProperty(String key, byte value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putBytesProperty(String key, byte[] value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putShortProperty(String key, short value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putCharProperty(String key, char value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putIntProperty(String key, int value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putLongProperty(String key, long value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putFloatProperty(String key, float value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putDoubleProperty(String key, double value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putBooleanProperty(SimpleString key, boolean value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putByteProperty(SimpleString key, byte value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putBytesProperty(SimpleString key, byte[] value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putShortProperty(SimpleString key, short value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putCharProperty(SimpleString key, char value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putIntProperty(SimpleString key, int value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putLongProperty(SimpleString key, long value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putFloatProperty(SimpleString key, float value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putDoubleProperty(SimpleString key, double value); /** @@ -599,10 +639,14 @@ default Object getDuplicateProperty() { */ Message putStringProperty(String key, String value); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException; - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ Message putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException; Object removeProperty(String key); @@ -666,14 +710,17 @@ default String getAnnotationString(SimpleString key) { Object getAnnotation(SimpleString key); - /** Callers must call {@link #reencode()} in order to be sent to clients */ + /** + * Callers must call {@link #reencode()} in order to be sent to clients + */ default Message setAnnotation(SimpleString key, Object value) { putObjectProperty(key, value); return this; } - /** To be called by the broker on ocasions such as DLQ and expiry. - * When the broker is adding additional properties. */ + /** + * To be called by the broker on ocasions such as DLQ and expiry. When the broker is adding additional properties. + */ default Message setBrokerProperty(SimpleString key, Object value) { putObjectProperty(key, value); return this; @@ -707,22 +754,21 @@ default Long getIngressTimestamp() { Message putStringProperty(SimpleString key, String value); /** - * Returns the size of the encoded message. + * {@return the size of the encoded message} */ int getEncodeSize(); /** - * Return an estimate of the size of the message on the wire. - * for LargeMessages this will contain whatever is needed to encode properties and the body size of large messages. - * For AMQP this will return the whole body size of the message as the body will contain all the data including properties. - * @return + * Return an estimate of the size of the message on the wire. for LargeMessages this will contain whatever is needed + * to encode properties and the body size of large messages. For AMQP this will return the whole body size of the + * message as the body will contain all the data including properties. */ default long getWholeMessageSize() { return getEncodeSize(); } /** - * Returns all the names of the properties for this message. + * {@return all the names of the properties for this message} */ Set getPropertyNames(); @@ -734,14 +780,16 @@ default long getWholeMessageSize() { int getDurableCount(); - /** this method indicates usage by components such as large message or page cache. - * This method will cause large messages to be held longer after the ack happened for instance. + /** + * This method indicates usage by components such as large message or page cache. This method will cause large + * messages to be held longer after the ack happened for instance. */ int usageUp(); /** + * Opposite of {@link #usageUp()} + * * @see #usageUp() - * @return */ int usageDown(); @@ -754,14 +802,15 @@ default long getWholeMessageSize() { int durableDown(); /** - * @return Returns the message in Map form, useful when encoding to JSON + * {@return Returns the message in Map form, useful when encoding to JSON} */ default Map toMap() { return toMap(-1); } /** - * @return Returns the message in Map form, useful when encoding to JSON + * {@return the message in Map form, useful when encoding to JSON} + * * @param valueSizeLimit that limits [] map values */ default Map toMap(int valueSizeLimit) { @@ -782,14 +831,15 @@ default Map toMap(int valueSizeLimit) { } /** - * @return Returns the message properties in Map form, useful when encoding to JSON + * {@return Returns the message properties in Map form, useful when encoding to JSON} */ default Map toPropertyMap() { return toPropertyMap(-1); } /** - * @return Returns the message properties in Map form, useful when encoding to JSON + * {@return Returns the message properties in Map form, useful when encoding to JSON} + * * @param valueSizeLimit that limits [] map values */ default Map toPropertyMap(int valueSizeLimit) { @@ -806,32 +856,35 @@ default Map toPropertyMap(int valueSizeLimit) { return map; } - /** This should make you convert your message into Core format. */ + /** + * This should make you convert your message into Core format. + */ ICoreMessage toCore(); default CompositeData toCompositeData(int fieldsLimit, int deliveryCount) throws OpenDataException { return null; } - /** This should make you convert your message into Core format. */ + /** + * This should make you convert your message into Core format. + */ ICoreMessage toCore(CoreMessageObjectPools coreMessageObjectPools); int getMemoryEstimate(); - /** The first estimate that's been calculated without any updates. */ + /** + * The first estimate that's been calculated without any updates. + */ default int getOriginalEstimate() { // For Core Protocol we always use the same estimate return getMemoryEstimate(); } /** - * This is the size of the message when persisted on disk which is used for metrics tracking - * Note that even if the message itself is not persisted on disk (ie non-durable) this value is - * still used for metrics tracking - * If a normal message it will be the encoded message size - * If a large message it will be encoded message size + large message body size - * @return - * @throws ActiveMQException + * This is the size of the message when persisted on disk which is used for metrics tracking Note that even if the + * message itself is not persisted on disk (ie non-durable) this value is still used for metrics tracking If a normal + * message it will be the encoded message size If a large message it will be encoded message size + large message + * body size */ long getPersistentSize() throws ActiveMQException; @@ -843,9 +896,13 @@ default String getStringBody() { return null; } - /** Used for user context data. Useful on interceptors. */ + /** + * Used for user context data. Useful on interceptors. + */ Object getUserContext(Object key); - /** Used for user context data. Useful on interceptors. */ + /** + * Used for user context data. Useful on interceptors. + */ void setUserContext(Object key, Object value); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/RefCountMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/RefCountMessage.java index a92f1bb1092..d9333f3b0cb 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/RefCountMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/RefCountMessage.java @@ -33,12 +33,13 @@ import org.slf4j.helpers.MessageFormatter; /** - * RefCountMessage is a base-class for any message intending to do reference counting. Currently it is used for - * large message removal. - * - * Additional validation on reference counting will be done If you set a system property named "ARTEMIS_REF_DEBUG" and enable logging on this class. - * Additional logging output will be written when reference counting is broken and these debug options are applied. - * */ + * RefCountMessage is a base-class for any message intending to do reference counting. Currently it is used for large + * message removal. + *

    + * Additional validation on reference counting will be done If you set a system property named "ARTEMIS_REF_DEBUG" and + * enable logging on this class. Additional logging output will be written when reference counting is broken and these + * debug options are applied. + */ public class RefCountMessage { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -53,8 +54,9 @@ public static boolean isRefTraceEnabled() { return REF_DEBUG && logger.isTraceEnabled(); } - /** Sub classes constructors willing to debug reference counts, - * can register the objectCleaner through this method. */ + /** + * Sub classes constructors willing to debug reference counts, can register the objectCleaner through this method. + */ protected void registerDebug() { if (debugStatus == null) { debugStatus = new DebugState(this.toString()); @@ -73,8 +75,9 @@ private static class DebugState implements Runnable { String description; /** - * Notice: This runnable cannot hold any reference back to message otherwise it won't ever happen and you will get a memory leak. - * */ + * Notice: This runnable cannot hold any reference back to message otherwise it won't ever happen and you will get + * a memory leak. + */ Runnable runWhenLeaked; DebugState(String description) { @@ -82,8 +85,9 @@ private static class DebugState implements Runnable { addDebug("registered"); } - /** this marks the Status as accounted for - * and no need to report an issue when DEBUG hits */ + /** + * this marks the Status as accounted for and no need to report an issue when DEBUG hits + */ void accountedFor() { accounted = true; } @@ -143,7 +147,9 @@ String debugLocations() { private volatile boolean errorCheck = true; - /** has the refCount fired the action already? */ + /** + * has the refCount fired the action already? + */ public boolean isReleased() { return released; } @@ -167,7 +173,9 @@ public static void deferredDebug(RefCountMessage message, String debugMessage, O message.deferredDebug(formattedDebug); } - /** Deferred debug, that will be used in case certain conditions apply to the RefCountMessage */ + /** + * Deferred debug, that will be used in case certain conditions apply to the RefCountMessage + */ public void deferredDebug(String message) { if (parentRef != null) { parentRef.deferredDebug(message); @@ -190,8 +198,8 @@ public int getDurableCount() { } /** - * in certain cases the large message is copied from another LargeServerMessage - * and the ref count needs to be on that place. + * in certain cases the large message is copied from another LargeServerMessage and the ref count needs to be on that + * place. */ private volatile RefCountMessage parentRef; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/RefCountMessageListener.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/RefCountMessageListener.java index 256f0c3e79a..e0e9a583e84 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/RefCountMessageListener.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/RefCountMessageListener.java @@ -17,7 +17,8 @@ package org.apache.activemq.artemis.api.core; /** - * These methods will be called during refCount operations */ + * These methods will be called during refCount operations + */ public interface RefCountMessageListener { void durableUp(Message message, int durableCount); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java index 41a584b36f0..9d2ba4cf013 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java @@ -28,12 +28,10 @@ import org.apache.activemq.artemis.utils.UUIDGenerator; /** - * A TransportConfiguration is used by a client to specify connections to a server and its backup if - * one exists. + * A TransportConfiguration is used by a client to specify connections to a server and its backup if one exists. *

    - * Typically the constructors take the class name and parameters for needed to create the - * connection. These will be different dependent on which connector is being used, i.e. Netty or - * InVM etc. For example: + * Typically the constructors take the class name and parameters for needed to create the connection. These will be + * different dependent on which connector is being used, i.e. Netty or InVM etc. For example: * *

      * HashMap<String, Object> map = new HashMap<String, Object>();
    @@ -98,8 +96,8 @@ public TransportConfiguration() {
        }
     
        /**
    -    * Creates a TransportConfiguration with a specific name providing the class name of the {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory}
    -    * and any parameters needed.
    +    * Creates a TransportConfiguration with a specific name providing the class name of the
    +    * {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory} and any parameters needed.
         *
         * @param className The class name of the ConnectorFactory
         * @param params    The parameters needed by the ConnectorFactory
    @@ -110,8 +108,8 @@ public TransportConfiguration(final String className, final Map
        }
     
        /**
    -    * Creates a TransportConfiguration with a specific name providing the class name of the {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory}
    -    * and any parameters needed.
    +    * Creates a TransportConfiguration with a specific name providing the class name of the
    +    * {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory} and any parameters needed.
         *
         * @param className  The class name of the ConnectorFactory
         * @param params     The parameters needed by the ConnectorFactory
    @@ -139,8 +137,8 @@ public TransportConfiguration newTransportConfig(String newName) {
        }
     
        /**
    -    * Creates a TransportConfiguration providing the class name of the {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory}
    -    * and any parameters needed.
    +    * Creates a TransportConfiguration providing the class name of the
    +    * {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory} and any parameters needed.
         *
         * @param className The class name of the ConnectorFactory
         * @param params    The parameters needed by the ConnectorFactory
    @@ -150,7 +148,8 @@ public TransportConfiguration(final String className, final Map
        }
     
        /**
    -    * Creates a TransportConfiguration providing the class name of the {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory}
    +    * Creates a TransportConfiguration providing the class name of the
    +    * {@link org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory}
         *
         * @param className The class name of the ConnectorFactory
         */
    @@ -159,9 +158,7 @@ public TransportConfiguration(final String className) {
        }
     
        /**
    -    * Returns the name of this TransportConfiguration.
    -    *
    -    * @return the name
    +    * {@return the name of this TransportConfiguration}
         */
        public String getName() {
           return name;
    @@ -172,18 +169,14 @@ public void setName(String name) {
        }
     
        /**
    -    * Returns the class name of ConnectorFactory being used by this TransportConfiguration
    -    *
    -    * @return The factory's class name
    +    * {@return the class name of ConnectorFactory being used by this TransportConfiguration}
         */
        public String getFactoryClassName() {
           return factoryClassName;
        }
     
        /**
    -    * Returns any parameters set for this TransportConfiguration
    -    *
    -    * @return the parameters
    +    * {@return any parameters set for this TransportConfiguration}
         */
        public Map getParams() {
           return params;
    @@ -247,12 +240,10 @@ public boolean isSameParams(TransportConfiguration that) {
        }
     
        /**
    -    * There's a case on ClusterConnections that we need to find an equivalent Connector and we can't
    -    * use a Netty Cluster Connection on an InVM ClusterConnection (inVM used on tests) for that
    -    * reason I need to test if the two instances of the TransportConfiguration are equivalent while
    -    * a test a connector against an acceptor
    +    * There's a case on ClusterConnections that we need to find an equivalent Connector and we can't use a Netty Cluster
    +    * Connection on an InVM ClusterConnection (inVM used on tests) for that reason I need to test if the two instances
    +    * of the TransportConfiguration are equivalent while a test a connector against an acceptor
         *
    -    * @param otherConfig
         * @return {@code true} if the factory class names are equivalents
         */
        public boolean isEquivalent(TransportConfiguration otherConfig) {
    @@ -292,7 +283,7 @@ public static String toStringParameters(Map params, Map This is the member discovery implementation using direct UDP. It was extracted as a refactoring from
    -    * {@link org.apache.activemq.artemis.core.cluster.DiscoveryGroup}

    + * This is the member discovery implementation using direct UDP. It was extracted as a refactoring from + * {@link org.apache.activemq.artemis.core.cluster.DiscoveryGroup} */ private static class UDPBroadcastEndpoint implements BroadcastEndpoint { @@ -197,7 +197,6 @@ public void openBroadcaster() throws Exception { @Override public void openClient() throws Exception { - // HORNETQ-874 if (checkForLinux() || checkForSolaris() || checkForHp()) { try { receivingSocket = new MulticastSocket(new InetSocketAddress(groupAddress, groupPort)); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java index e5b5229f1a8..66e4e9fec23 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java @@ -41,9 +41,9 @@ /** * Utility class for creating ActiveMQ Artemis {@link ClientSessionFactory} objects. *

    - * Once a {@link ClientSessionFactory} has been created, it can be further configured using its - * setter methods before creating the sessions. Once a session is created, the factory can no longer - * be modified (its setter methods will throw a {@link IllegalStateException}. + * Once a {@link ClientSessionFactory} has been created, it can be further configured using its setter methods before + * creating the sessions. Once a session is created, the factory can no longer be modified (its setter methods will + * throw a {@link IllegalStateException}. */ public final class ActiveMQClient { @@ -224,7 +224,8 @@ public static synchronized void clearThreadPools(long time, TimeUnit unit) { } /** - * Warning: This method has to be called before any clients or servers is started on the JVM otherwise previous ServerLocator would be broken after this call. + * Warning: This method has to be called before any clients or servers is started on the JVM otherwise previous + * ServerLocator would be broken after this call. */ public static synchronized void injectPools(ExecutorService globalThreadPool, ScheduledExecutorService scheduledThreadPool, @@ -286,16 +287,16 @@ public static int getGlobalFlowControlThreadPoolSize() { } /** - * Initializes the global thread pools properties from System properties. This method will update the global - * thread pool configuration based on defined System properties (or defaults if they are not set). - * The System properties key names are as follow: - * + * Initializes the global thread pools properties from System properties. This method will update the global thread + * pool configuration based on defined System properties (or defaults if they are not set). The System properties key + * names are as follow: + *

    * ActiveMQClient.THREAD_POOL_MAX_SIZE_PROPERTY_KEY="activemq.artemis.client.global.thread.pool.max.size" * ActiveMQClient.SCHEDULED_THREAD_POOL_SIZE_PROPERTY_KEY="activemq.artemis.client.global.scheduled.thread.pool.core.size - * - * The min value for max thread pool size is 2. If the value is not -1, but lower than 2, it will be ignored and will default to 2. - * A value of -1 configures an unbounded thread pool. - * + *

    + * The min value for max thread pool size is 2. If the value is not -1, but lower than 2, it will be ignored and will + * default to 2. A value of -1 configures an unbounded thread pool. + *

    * Note: If global thread pools have already been created, they will not be updated with these new values. */ public static void initializeGlobalThreadPoolProperties() { @@ -304,13 +305,13 @@ public static void initializeGlobalThreadPoolProperties() { } /** - * Allows programmatical configuration of global thread pools properties. This method will update the global - * thread pool configuration based on the provided values notifying all globalThreadPoolListeners. - * + * Allows programmatical configuration of global thread pools properties. This method will update the global thread + * pool configuration based on the provided values notifying all globalThreadPoolListeners. + *

    * Note: If global thread pools have already been created, they will not be updated with these new values. - * - * The min value for globalThreadMaxPoolSize is 2. If the value is not -1, but lower than 2, it will be ignored and will default to 2. - * A value of -1 configures an unbounded thread pool. + *

    + * The min value for globalThreadMaxPoolSize is 2. If the value is not -1, but lower than 2, it will be ignored and + * will default to 2. A value of -1 configures an unbounded thread pool. */ public static void setGlobalThreadPoolProperties(int globalThreadMaxPoolSize, int globalScheduledThreadPoolSize, int globalFlowControlThreadPoolSize) { @@ -333,10 +334,10 @@ public static ServerLocator createServerLocator(final String url) throws Excepti } /** - * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically - * as the cluster topology changes, and no HA backup information is propagated to the client + * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the + * ServerLocator is not updated automatically as the cluster topology changes, and no HA backup information is + * propagated to the client * - * @param transportConfigurations * @return the ServerLocator */ public static ServerLocator createServerLocatorWithoutHA(TransportConfiguration... transportConfigurations) { @@ -344,11 +345,12 @@ public static ServerLocator createServerLocatorWithoutHA(TransportConfiguration. } /** - * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically - * as the cluster topology changes, and no HA backup information is propagated to the client + * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the + * ServerLocator is not updated automatically as the cluster topology changes, and no HA backup information is + * propagated to the client * - * @param ha The Locator will support topology updates and ha (this required the server to be clustered, otherwise the first connection will timeout) - * @param transportConfigurations + * @param ha The Locator will support topology updates and ha (this required the server to be clustered, otherwise + * the first connection will timeout) * @return the ServerLocator */ public static ServerLocator createServerLocator(final boolean ha, @@ -357,12 +359,11 @@ public static ServerLocator createServerLocator(final boolean ha, } /** - * Create a ServerLocator which creates session factories from a set of active servers, no HA - * backup information is propagated to the client + * Create a ServerLocator which creates session factories from a set of active servers, no HA backup information is + * propagated to the client *

    * The UDP address and port are used to listen for active servers in the cluster * - * @param groupConfiguration * @return the ServerLocator */ public static ServerLocator createServerLocatorWithoutHA(final DiscoveryGroupConfiguration groupConfiguration) { @@ -370,13 +371,11 @@ public static ServerLocator createServerLocatorWithoutHA(final DiscoveryGroupCon } /** - * Create a ServerLocator which creates session factories from a set of active servers, no HA - * backup information is propagated to the client The UDP address and port are used to listen for - * active servers in the cluster + * Create a ServerLocator which creates session factories from a set of active servers, no HA backup information is + * propagated to the client The UDP address and port are used to listen for active servers in the cluster * - * @param ha The Locator will support topology updates and ha (this required the server to be - * clustered, otherwise the first connection will timeout) - * @param groupConfiguration + * @param ha The Locator will support topology updates and ha (this required the server to be clustered, otherwise + * the first connection will timeout) * @return the ServerLocator */ public static ServerLocator createServerLocator(final boolean ha, @@ -385,19 +384,19 @@ public static ServerLocator createServerLocator(final boolean ha, } /** - * Create a ServerLocator which will receive cluster topology updates from the cluster as servers - * leave or join and new backups are appointed or removed. + * Create a ServerLocator which will receive cluster topology updates from the cluster as servers leave or join and + * new backups are appointed or removed. *

    - * The initial list of servers supplied in this method is simply to make an initial connection to - * the cluster, once that connection is made, up to date cluster topology information is - * downloaded and automatically updated whenever the cluster topology changes. + * The initial list of servers supplied in this method is simply to make an initial connection to the cluster, once + * that connection is made, up to date cluster topology information is downloaded and automatically updated whenever + * the cluster topology changes. *

    - * If the topology includes backup servers that information is also propagated to the client so - * that it can know which server to failover onto in case of active server failure. + * If the topology includes backup servers that information is also propagated to the client so that it can know + * which server to failover onto in case of active server failure. * - * @param initialServers The initial set of servers used to make a connection to the cluster. - * Each one is tried in turn until a successful connection is made. Once a connection - * is made, the cluster topology is downloaded and the rest of the list is ignored. + * @param initialServers The initial set of servers used to make a connection to the cluster. Each one is tried in + * turn until a successful connection is made. Once a connection is made, the cluster topology + * is downloaded and the rest of the list is ignored. * @return the ServerLocator */ public static ServerLocator createServerLocatorWithHA(TransportConfiguration... initialServers) { @@ -405,19 +404,17 @@ public static ServerLocator createServerLocatorWithHA(TransportConfiguration... } /** - * Create a ServerLocator which will receive cluster topology updates from the cluster as servers - * leave or join and new backups are appointed or removed. + * Create a ServerLocator which will receive cluster topology updates from the cluster as servers leave or join and + * new backups are appointed or removed. *

    - * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP - * broadcasts which contain connection information for members of the cluster. The broadcasted - * connection information is simply used to make an initial connection to the cluster, once that - * connection is made, up to date cluster topology information is downloaded and automatically - * updated whenever the cluster topology changes. + * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP broadcasts which + * contain connection information for members of the cluster. The broadcasted connection information is simply used + * to make an initial connection to the cluster, once that connection is made, up to date cluster topology + * information is downloaded and automatically updated whenever the cluster topology changes. *

    - * If the topology includes backup servers that information is also propagated to the client so - * that it can know which server to failover onto in case of active server failure. + * If the topology includes backup servers that information is also propagated to the client so that it can know + * which server to failover onto in case of active server failure. * - * @param groupConfiguration * @return the ServerLocator */ public static ServerLocator createServerLocatorWithHA(final DiscoveryGroupConfiguration groupConfiguration) { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientConsumer.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientConsumer.java index 7db6180a93f..91e7705e9b5 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientConsumer.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientConsumer.java @@ -21,23 +21,20 @@ /** * A ClientConsumer receives messages from ActiveMQ Artemis queues. - *
    - * Messages can be consumed synchronously by using the receive() methods - * which will block until a message is received (or a timeout expires) or asynchronously - * by setting a {@link MessageHandler}. - *
    - * These 2 types of consumption are exclusive: a ClientConsumer with a MessageHandler set will - * throw ActiveMQException if its receive() methods are called. + *

    + * Messages can be consumed synchronously by using the {@code receive()} methods which will block until a message is + * received (or a timeout expires) or asynchronously by setting a {@link MessageHandler}. + *

    + * These 2 types of consumption are exclusive: a ClientConsumer with a MessageHandler set will throw ActiveMQException + * if its {@code receive()} methods are called. * * @see ClientSession#createConsumer(String) */ public interface ClientConsumer extends AutoCloseable { /** - * The server's ID associated with this consumer. - * ActiveMQ Artemis implements this as a long but this could be protocol dependent. - * - * @return + * The server's ID associated with this consumer. ActiveMQ Artemis implements this as a long but this could be + * protocol dependent. */ ConsumerContext getConsumerContext(); @@ -67,14 +64,14 @@ public interface ClientConsumer extends AutoCloseable { ClientMessage receive(long timeout) throws ActiveMQException; /** - * Receives a message from a queue. This call will force a network trip to ActiveMQ Artemis server to - * ensure that there are no messages in the queue which can be delivered to this consumer. + * Receives a message from a queue. This call will force a network trip to ActiveMQ Artemis server to ensure that + * there are no messages in the queue which can be delivered to this consumer. *

    - * This call will never wait indefinitely for a message, it will return {@code null} if no - * messages are available for this consumer. + * This call will never wait indefinitely for a message, it will return {@code null} if no messages are available for + * this consumer. *

    - * Note however that there is a performance cost as an additional network trip to the server may - * required to check the queue status. + * Note however that there is a performance cost as an additional network trip to the server may required to check + * the queue status. *

    * Calling this method on a closed consumer will throw an ActiveMQException. * @@ -84,8 +81,6 @@ public interface ClientConsumer extends AutoCloseable { ClientMessage receiveImmediate() throws ActiveMQException; /** - * Returns the MessageHandler associated to this consumer. - *

    * Calling this method on a closed consumer will throw an ActiveMQException. * * @return the MessageHandler associated to this consumer or {@code null} @@ -96,8 +91,8 @@ public interface ClientConsumer extends AutoCloseable { /** * Sets the MessageHandler for this consumer to consume messages asynchronously. *

    - * Note that setting a handler dedicates the parent session, and its child producers - * and consumers, to the session-wide handler delivery thread of control. + * Note that setting a handler dedicates the parent session, and its child producers and consumers, to the + * session-wide handler delivery thread of control. *

    * Calling this method on a closed consumer will throw a ActiveMQException. * @@ -109,25 +104,18 @@ public interface ClientConsumer extends AutoCloseable { /** * Closes the consumer. *

    - * Once this consumer is closed, it can not receive messages, whether synchronously or - * asynchronously. - * - * @throws ActiveMQException + * Once this consumer is closed, it can not receive messages, whether synchronously or asynchronously. */ @Override void close() throws ActiveMQException; /** - * Returns whether the consumer is closed or not. - * - * @return true if this consumer is closed, false else + * {@return {@code true} if this consumer is closed, {@code false} else} */ boolean isClosed(); /** - * Returns the last exception thrown by a call to this consumer's MessageHandler. - * - * @return the last exception thrown by a call to this consumer's MessageHandler or {@code null} + * {@return the last exception thrown by a call to this consumer's MessageHandler or {@code null}} */ Exception getLastException(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientMessage.java index 1af7d91bf82..b6c1287f6c3 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientMessage.java @@ -30,7 +30,7 @@ public interface ClientMessage extends ICoreMessage { /** - * Returns the number of times this message was delivered. + * {@return the number of times this message was delivered.} */ int getDeliveryCount(); @@ -47,9 +47,9 @@ public interface ClientMessage extends ICoreMessage { /** * Acknowledges reception of this message. *

    - * If the session responsible to acknowledge this message has {@code autoCommitAcks} set to - * {@code true}, the transaction will automatically commit the current transaction. Otherwise, - * this acknowledgement will not be committed until the client commits the session transaction. + * If the session responsible to acknowledge this message has {@code autoCommitAcks} set to {@code true}, the + * transaction will automatically commit the current transaction. Otherwise, this acknowledgement will not be + * committed until the client commits the session transaction. * * @throws ActiveMQException if an error occurred while acknowledging the message. * @see ClientSession#isAutoCommitAcks() @@ -59,9 +59,9 @@ public interface ClientMessage extends ICoreMessage { /** * Acknowledges reception of a single message. *

    - * If the session responsible to acknowledge this message has {@code autoCommitAcks} set to - * {@code true}, the transaction will automatically commit the current transaction. Otherwise, - * this acknowledgement will not be committed until the client commits the session transaction. + * If the session responsible to acknowledge this message has {@code autoCommitAcks} set to {@code true}, the + * transaction will automatically commit the current transaction. Otherwise, this acknowledgement will not be + * committed until the client commits the session transaction. * * @throws ActiveMQException if an error occurred while acknowledging the message. * @see ClientSession#isAutoCommitAcks() @@ -69,54 +69,46 @@ public interface ClientMessage extends ICoreMessage { ClientMessage individualAcknowledge() throws ActiveMQException; /** - * This can be optionally used to verify if the entire message has been received. - * It won't have any effect on regular messages but it may be helpful on large messages. - * The use case for this is to make sure there won't be an exception while getting the buffer. - * Using getBodyBuffer directly would have the same effect but you could get a Runtime non checked Exception - * instead - * - * @throws ActiveMQException + * This can be optionally used to verify if the entire message has been received. It won't have any effect on regular + * messages but it may be helpful on large messages. The use case for this is to make sure there won't be an + * exception while getting the buffer. Using getBodyBuffer directly would have the same effect but you could get a + * Runtime non checked Exception instead */ void checkCompletion() throws ActiveMQException; /** - * Returns the size (in bytes) of this message's body + * {@return the size (in bytes) of this message's body} */ int getBodySize(); /** * Sets the OutputStream that will receive the content of a message received in a non blocking way. - *
    + *

    * This method is used when consuming large messages * * @return this ClientMessage - * @throws ActiveMQException */ ClientMessage setOutputStream(OutputStream out) throws ActiveMQException; /** - * Saves the content of the message to the OutputStream. - * It will block until the entire content is transferred to the OutputStream. - *
    - * - * @throws ActiveMQException + * Saves the content of the message to the OutputStream. It will block until the entire content is transferred to the + * OutputStream. */ void saveToOutputStream(OutputStream out) throws ActiveMQException; /** * Wait the outputStream completion of the message. - * + *

    * This method is used when consuming large messages * * @param timeMilliseconds - 0 means wait forever * @return true if it reached the end - * @throws ActiveMQException */ boolean waitOutputStreamCompletion(long timeMilliseconds) throws ActiveMQException; /** * Sets the body's IntputStream. - *
    + *

    * This method is used when sending large messages * * @return this ClientMessage @@ -125,15 +117,13 @@ public interface ClientMessage extends ICoreMessage { /** * Return the bodyInputStream for large messages - * @return */ @Override InputStream getBodyInputStream(); /** - * The buffer to write the body. - * Warning: If you just want to read the content of a message, use getDataBuffer() or getReadOnlyBuffer(); - * @return + * The buffer to write the body. Warning: If you just want to read the content of a message, use getDataBuffer() or + * getReadOnlyBuffer(); */ @Override ActiveMQBuffer getBodyBuffer(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientProducer.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientProducer.java index 4faeba7cb9d..c2b82bbd6fe 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientProducer.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientProducer.java @@ -21,43 +21,33 @@ import org.apache.activemq.artemis.api.core.SimpleString; /** - * A ClientProducer is used to send messages to a specific address. Messages are then routed on the - * server to any queues that are bound to the address. A ClientProducer can either be created with a - * specific address in mind or with none. With the latter the address must be provided using the - * appropriate send() method.
    + * A {@code ClientProducer} is used to send messages to a specific address. Messages are then routed on the server to + * any queues that are bound to the address. A {@code ClientProducer} can either be created with a specific address in + * mind or with none. With the latter the address must be provided using the appropriate {@code send} method. *

    * The sending semantics can change depending on what blocking semantics are set via - * {@link ServerLocator#setBlockOnDurableSend(boolean)} and - * {@link ServerLocator#setBlockOnNonDurableSend(boolean)} . If set to - * true then for each message type, durable and non durable respectively, any exceptions such as the - * address not existing or security exceptions will be thrown at the time of send. Alternatively if - * set to false then exceptions will only be logged on the server.
    + * {@link ServerLocator#setBlockOnDurableSend} and {@link ServerLocator#setBlockOnNonDurableSend}. If set to + * {@code true} then for each message type, durable and non durable respectively, any exceptions such as the address not + * existing or security exceptions will be thrown at the time of send. Alternatively if set to {@code false} then + * exceptions will only be logged on the server. *

    - * The send rate can also be controlled via {@link ServerLocator#setProducerMaxRate(int)} and the - * {@link ServerLocator#setProducerWindowSize(int)}.
    - *
    + * The send rate can also be controlled via {@link ServerLocator#setProducerMaxRate} and the + * {@link ServerLocator#setProducerWindowSize}. */ public interface ClientProducer extends AutoCloseable { /** - * Returns the address where messages will be sent. - * - *

    The address can be {@code null} if the ClientProducer - * - * was creating without specifying an address, that is by using {@link ClientSession#createProducer()}. - * - * @return the address where messages will be sent + * {@return the address where messages will be sent; the address can be {@code null} if the {@code ClientProducer} + * was created without specifying an address, e.g. by using {@link ClientSession#createProducer()}} */ SimpleString getAddress(); /** - * Sends a message to an address. specified in {@link ClientSession#createProducer(String)} or - * similar methods.
    - *
    - * This will block until confirmation that the message has reached the server has been received - * if {@link ServerLocator#setBlockOnDurableSend(boolean)} or - * {@link ServerLocator#setBlockOnNonDurableSend(boolean)} are set to true for the - * specified message type. + * Sends a message to an address. specified in {@link ClientSession#createProducer(String)} or similar methods. + *

    + * This will block until confirmation that the message has reached the server has been received if + * {@link ServerLocator#setBlockOnDurableSend(boolean)} or {@link ServerLocator#setBlockOnNonDurableSend(boolean)} + * are set to {@code true} for the specified message type. * * @param message the message to send * @throws ActiveMQException if an exception occurs while sending the message @@ -65,8 +55,8 @@ public interface ClientProducer extends AutoCloseable { void send(Message message) throws ActiveMQException; /** - * Sends a message to the specified address instead of the ClientProducer's address.
    - *
    + * Sends a message to the specified address instead of the ClientProducer's address. + *

    * This message will be sent asynchronously. *

    * The handler will only get called if {@link ServerLocator#setConfirmationWindowSize(int) -1}. @@ -78,12 +68,11 @@ public interface ClientProducer extends AutoCloseable { void send(Message message, SendAcknowledgementHandler handler) throws ActiveMQException; /** - * Sends a message to the specified address instead of the ClientProducer's address.
    - *
    - * This will block until confirmation that the message has reached the server has been received - * if {@link ServerLocator#setBlockOnDurableSend(boolean)} or - * {@link ServerLocator#setBlockOnNonDurableSend(boolean)} are set to true for the specified - * message type. + * Sends a message to the specified address instead of the ClientProducer's address. + *

    + * This will block until confirmation that the message has reached the server has been received if + * {@link ServerLocator#setBlockOnDurableSend(boolean)} or {@link ServerLocator#setBlockOnNonDurableSend(boolean)} + * are set to true for the specified message type. * * @param address the address where the message will be sent * @param message the message to send @@ -92,8 +81,8 @@ public interface ClientProducer extends AutoCloseable { void send(SimpleString address, Message message) throws ActiveMQException; /** - * Sends a message to the specified address instead of the ClientProducer's address.
    - *
    + * Sends a message to the specified address instead of the ClientProducer's address. + *

    * This message will be sent asynchronously as long as {@link ServerLocator#setConfirmationWindowSize(int)} was set. *

    * Notice that if no confirmationWindowsize is set @@ -106,12 +95,11 @@ public interface ClientProducer extends AutoCloseable { void send(SimpleString address, Message message, SendAcknowledgementHandler handler) throws ActiveMQException; /** - * Sends a message to the specified address instead of the ClientProducer's address.
    - *
    - * This will block until confirmation that the message has reached the server has been received - * if {@link ServerLocator#setBlockOnDurableSend(boolean)} or - * {@link ServerLocator#setBlockOnNonDurableSend(boolean)} are set to true for the specified - * message type. + * Sends a message to the specified address instead of the ClientProducer's address. + *

    + * This will block until confirmation that the message has reached the server has been received if + * {@link ServerLocator#setBlockOnDurableSend(boolean)} or {@link ServerLocator#setBlockOnNonDurableSend(boolean)} + * are set to true for the specified message type. * * @param address the address where the message will be sent * @param message the message to send @@ -128,30 +116,22 @@ public interface ClientProducer extends AutoCloseable { void close() throws ActiveMQException; /** - * Returns whether the producer is closed or not. - * - * @return true if the producer is closed, false else + * {@return {@code true} if the producer is closed, {@code false} else} */ boolean isClosed(); /** - * Returns whether the producer will block when sending durable messages. - * - * @return true if the producer blocks when sending durable, false else + * {@return {@code true} if the producer blocks when sending durable messages, {@code false} else} */ boolean isBlockOnDurableSend(); /** - * Returns whether the producer will block when sending non-durable messages. - * - * @return true if the producer blocks when sending non-durable, false else + * {@return {@code true} if the producer blocks when sending non-durable messages, {@code false} else} */ boolean isBlockOnNonDurableSend(); /** - * Returns the maximum rate at which a ClientProducer can send messages per second. - * - * @return the producers maximum rate + * {@return the maximum rate at which a ClientProducer can send messages per second} */ int getMaxRate(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientRequestor.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientRequestor.java index 83256864041..c02a33d18cf 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientRequestor.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientRequestor.java @@ -24,9 +24,9 @@ /** * The ClientRequestor class helps making requests. - *
    - * The ClientRequestor constructor is given a ClientSession and a request address. - * It creates a temporary queue for the responses and provides a request method that sends the request message and waits for its reply. + *

    + * The ClientRequestor constructor is given a ClientSession and a request address. It creates a temporary queue for the + * responses and provides a request method that sends the request message and waits for its reply. */ public final class ClientRequestor implements AutoCloseable { @@ -40,12 +40,11 @@ public final class ClientRequestor implements AutoCloseable { /** * Constructor for the ClientRequestor. - * + *

    * The implementation expects a ClientSession with automatic commits of sends and acknowledgements * * @param session a ClientSession uses to handle requests and replies * @param requestAddress the address to send request messages to - * @throws Exception */ public ClientRequestor(final ClientSession session, final SimpleString requestAddress) throws Exception { queueSession = session; @@ -64,25 +63,23 @@ public ClientRequestor(final ClientSession session, final String requestAddress) } /** - * Sends a message to the request address and wait indefinitely for a reply. - * The temporary queue is used for the REPLYTO_HEADER_NAME, and only one reply per request is expected + * Sends a message to the request address and wait indefinitely for a reply. The temporary queue is used for the + * REPLYTO_HEADER_NAME, and only one reply per request is expected * * @param request the message to send * @return the reply message - * @throws Exception */ public ClientMessage request(final ClientMessage request) throws Exception { return request(request, 0); } /** - * Sends a message to the request address and wait for the given timeout for a reply. - * The temporary queue is used for the REPLYTO_HEADER_NAME, and only one reply per request is expected + * Sends a message to the request address and wait for the given timeout for a reply. The temporary queue is used for + * the REPLYTO_HEADER_NAME, and only one reply per request is expected * * @param request the message to send * @param timeout the timeout to wait for a reply (in milliseconds) * @return the reply message or {@code null} if no message is replied before the timeout elapses - * @throws Exception */ public ClientMessage request(final ClientMessage request, final long timeout) throws Exception { request.putStringProperty(ClientMessageImpl.REPLYTO_HEADER_NAME, replyQueue); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java index 861f64d693d..cc0b5eea3f7 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java @@ -24,31 +24,28 @@ import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.QueueAttributes; import org.apache.activemq.artemis.api.core.QueueConfiguration; -import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.RoutingType; +import org.apache.activemq.artemis.api.core.SimpleString; /** * A ClientSession is a single-threaded parent object required for producing and consuming messages. *

    - * Only a single thread may be used to operate on the session and its child producers and consumers, - * other than close() methods which may be called from another thread. Setting a MessageHandler on a - * consumer renders the session, and all its child producers and consumers, to be dedicated to the - * session-wide handler delivery thread of control. + * Only a single thread may be used to operate on the session and its child producers and consumers, other than close() + * methods which may be called from another thread. Setting a MessageHandler on a consumer renders the session, and all + * its child producers and consumers, to be dedicated to the session-wide handler delivery thread of control. */ public interface ClientSession extends XAResource, AutoCloseable { /** - * This is used to identify a ClientSession as used by the JMS Layer - * The JMS Layer will add this through Meta-data, so the server or management layers - * can identify session created over core API purely or through the JMS Layer + * This is used to identify a ClientSession as used by the JMS Layer The JMS Layer will add this through Meta-data, + * so the server or management layers can identify session created over core API purely or through the JMS Layer */ String JMS_SESSION_IDENTIFIER_PROPERTY = "jms-session"; /** - * Just like {@link ClientSession.AddressQuery#JMS_SESSION_IDENTIFIER_PROPERTY} this is - * used to identify the ClientID over JMS Session. - * However this is only used when the JMS Session.clientID is set (which is optional). - * With this property management tools and the server can identify the jms-client-id used over JMS + * Just like {@link ClientSession.AddressQuery#JMS_SESSION_IDENTIFIER_PROPERTY} this is used to identify the ClientID + * over JMS Session. However this is only used when the JMS Session.clientID is set (which is optional). With this + * property management tools and the server can identify the jms-client-id used over JMS */ String JMS_SESSION_CLIENT_ID_PROPERTY = "jms-client-id"; @@ -60,22 +57,22 @@ public interface ClientSession extends XAResource, AutoCloseable { interface AddressQuery { /** - * Returns true if the binding exists, false else. + * {@return {@code true} if the binding exists, {@code false} else} */ boolean isExists(); /** - * Returns the names of the queues bound to the binding. + * {@return the names of the queues bound to the binding} */ List getQueueNames(); /** - * Returns true if auto-queue-creation for this address is enabled, false else. + * {@return {@code true} if auto-queue-creation for this address is enabled, {@code false} else} */ boolean isAutoCreateQueues(); /** - * Returns true if auto-address-creation for this address is enabled, false else. + * {@return {@code true} if auto-address-creation for this address is enabled, {@code false} else} */ boolean isAutoCreateAddresses(); @@ -108,50 +105,48 @@ interface AddressQuery { interface QueueQuery { /** - * Returns true if the queue exists, false else. + * {@return {@code true} if the queue exists, {@code false} else} */ boolean isExists(); /** - * Return true if the queue is temporary, false else. + * {@return {@code true} if the queue is temporary, {@code false} else} */ boolean isTemporary(); /** - * Returns true if the queue is durable, false else. + * {@return {@code true} if the queue is durable, {@code false} else} */ boolean isDurable(); /** - * Returns true if auto-creation for this queue is enabled and if the queue queried is a JMS queue, - * false else. + * {@return {@code true} if auto-creation for this queue is enabled and if the queue queried is a JMS queue, + * {@code false} else} */ boolean isAutoCreateQueues(); /** - * Returns the number of consumers attached to the queue. + * {@return the number of consumers attached to the queue} */ int getConsumerCount(); /** - * Returns the number of messages in the queue. + * {@return the number of messages in the queue} */ long getMessageCount(); /** - * Returns the queue's filter string (or {@code null} if the queue has no filter). + * {@return the queue's filter string (or {@code null} if the queue has no filter)} */ SimpleString getFilterString(); /** - * Returns the address that the queue is bound to. + * {@return the address that the queue is bound to} */ SimpleString getAddress(); /** * Return the name of the queue - * - * @return */ SimpleString getName(); @@ -201,16 +196,15 @@ interface QueueQuery { // Lifecycle operations ------------------------------------------ /** - * Starts the session. - * The session must be started before ClientConsumers created by the session can consume messages from the queue. + * Starts the session. The session must be started before ClientConsumers created by the session can consume messages + * from the queue. * * @throws ActiveMQException if an exception occurs while starting the session */ ClientSession start() throws ActiveMQException; /** - * Stops the session. - * ClientConsumers created by the session can not consume messages when the session is stopped. + * Stops the session. ClientConsumers created by the session can not consume messages when the session is stopped. * * @throws ActiveMQException if an exception occurs while stopping the session */ @@ -225,9 +219,7 @@ interface QueueQuery { void close() throws ActiveMQException; /** - * Returns whether the session is closed or not. - * - * @return true if the session is closed, false else + * {@return {@code true} if the session is closed, {@code false} else} */ boolean isClosed(); @@ -242,7 +234,7 @@ interface QueueQuery { * Removes a FailureListener to the session. * * @param listener the listener to remove - * @return true if the listener was removed, false else + * @return {@code true} if the listener was removed, {@code false} else */ boolean removeFailureListener(SessionFailureListener listener); @@ -257,40 +249,28 @@ interface QueueQuery { * Removes a FailoverEventListener to the session. * * @param listener the listener to remove - * @return true if the listener was removed, false else + * @return {@code true} if the listener was removed, {@code false} else */ boolean removeFailoverListener(FailoverEventListener listener); /** - * Returns the server's incrementingVersion. - * - * @return the server's incrementingVersion + * {@return the server's {@code incrementingVersion}} */ int getVersion(); /** * Create Address with a single initial routing type - * @param address - * @param autoCreated - * @throws ActiveMQException */ void createAddress(SimpleString address, EnumSet routingTypes, boolean autoCreated) throws ActiveMQException; /** * Create Address with a single initial routing type - * @param address - * @param autoCreated - * @throws ActiveMQException */ @Deprecated void createAddress(SimpleString address, Set routingTypes, boolean autoCreated) throws ActiveMQException; /** * Create Address with a single initial routing type - * @param address - * @param routingType - * @param autoCreated - * @throws ActiveMQException */ void createAddress(SimpleString address, RoutingType routingType, boolean autoCreated) throws ActiveMQException; @@ -331,7 +311,6 @@ interface QueueQuery { * * * @param queueConfiguration the configuration to use when creating the queue - * @throws ActiveMQException */ void createQueue(QueueConfiguration queueConfiguration) throws ActiveMQException; @@ -362,12 +341,14 @@ interface QueueQuery { * @param queueName the name of the queue * @param durable whether the queue is durable or not * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(SimpleString address, SimpleString queueName, boolean durable) throws ActiveMQException; /** - * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted + * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is + * closed the queue will be deleted *

    * Notice: you will get an exception if the address or the filter doesn't match to an already existent queue * @@ -375,12 +356,14 @@ interface QueueQuery { * @param queueName the name of the queue * @param durable if the queue is durable * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createSharedQueue(QueueConfiguration)} instead */ @Deprecated void createSharedQueue(SimpleString address, SimpleString queueName, boolean durable) throws ActiveMQException; /** - * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted + * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is + * closed the queue will be deleted *

    * Notice: you will get an exception if the address or the filter doesn't match to an already existent queue * @@ -389,6 +372,7 @@ interface QueueQuery { * @param filter whether the queue is durable or not * @param durable if the queue is durable * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createSharedQueue(QueueConfiguration)} instead */ @Deprecated void createSharedQueue(SimpleString address, @@ -403,6 +387,7 @@ void createSharedQueue(SimpleString address, * @param queueName the name of the queue * @param durable whether the queue is durable or not * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(String address, String queueName, boolean durable) throws ActiveMQException; @@ -413,6 +398,7 @@ void createSharedQueue(SimpleString address, * @param address the queue will be bound to this address * @param queueName the name of the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(String address, String queueName) throws ActiveMQException; @@ -423,6 +409,7 @@ void createSharedQueue(SimpleString address, * @param address the queue will be bound to this address * @param queueName the name of the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(SimpleString address, SimpleString queueName) throws ActiveMQException; @@ -435,6 +422,7 @@ void createSharedQueue(SimpleString address, * @param filter only messages which match this filter will be put in the queue * @param durable whether the queue is durable or not * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(SimpleString address, @@ -450,6 +438,7 @@ void createQueue(SimpleString address, * @param durable whether the queue is durable or not * @param filter only messages which match this filter will be put in the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(String address, String queueName, String filter, boolean durable) throws ActiveMQException; @@ -463,6 +452,7 @@ void createQueue(SimpleString address, * @param durable whether the queue is durable or not * @param autoCreated whether to mark this queue as autoCreated or not * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(SimpleString address, @@ -480,6 +470,7 @@ void createQueue(SimpleString address, * @param durable whether the queue is durable or not * @param autoCreated whether to mark this queue as autoCreated or not * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(String address, String queueName, String filter, boolean durable, boolean autoCreated) throws ActiveMQException; @@ -490,6 +481,7 @@ void createQueue(SimpleString address, * @param address the queue will be bound to this address * @param queueName the name of the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createTemporaryQueue(SimpleString address, SimpleString queueName) throws ActiveMQException; @@ -500,6 +492,7 @@ void createQueue(SimpleString address, * @param address the queue will be bound to this address * @param queueName the name of the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createTemporaryQueue(String address, String queueName) throws ActiveMQException; @@ -511,6 +504,7 @@ void createQueue(SimpleString address, * @param queueName the name of the queue * @param filter only messages which match this filter will be put in the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createTemporaryQueue(SimpleString address, @@ -524,50 +518,53 @@ void createTemporaryQueue(SimpleString address, * @param queueName the name of the queue * @param filter only messages which match this filter will be put in the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createTemporaryQueue(String address, String queueName, String filter) throws ActiveMQException; - /** Deprecate **/ - - /** * Creates a non-temporary queue. * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param durable whether the queue is durable or not + * @param queueName the name of the queue + * @param durable whether the queue is durable or not * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable) throws ActiveMQException; /** - * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted + * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is + * closed the queue will be deleted *

    * Notice: you will get an exception if the address or the filter doesn't match to an already existent queue * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param durable if the queue is durable + * @param queueName the name of the queue + * @param durable if the queue is durable * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createSharedQueue(QueueConfiguration)} instead */ @Deprecated void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable) throws ActiveMQException; /** - * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted + * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is + * closed the queue will be deleted *

    * Notice: you will get an exception if the address or the filter doesn't match to an already existent queue * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter whether the queue is durable or not - * @param durable if the queue is durable + * @param queueName the name of the queue + * @param filter whether the queue is durable or not + * @param durable if the queue is durable * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createSharedQueue(QueueConfiguration)} instead */ @Deprecated void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, @@ -576,16 +573,17 @@ void createSharedQueue(SimpleString address, RoutingType routingType, SimpleStri /** * Creates Shared queue. A queue that will exist as long as there are consumers or is durable. * - * @param address the queue will be bound to this address - * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter whether the queue is durable or not - * @param durable if the queue is durable - * @param maxConsumers how many concurrent consumers will be allowed on this queue + * @param address the queue will be bound to this address + * @param routingType the routing type for this queue, MULTICAST or ANYCAST + * @param queueName the name of the queue + * @param filter whether the queue is durable or not + * @param durable if the queue is durable + * @param maxConsumers how many concurrent consumers will be allowed on this queue * @param purgeOnNoConsumers whether to delete the contents of the queue when the last consumer disconnects - * @param exclusive if the queue is exclusive queue - * @param lastValue if the queue is last value queue + * @param exclusive if the queue is exclusive queue + * @param lastValue if the queue is last value queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createSharedQueue(QueueConfiguration)} instead */ @Deprecated void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, @@ -594,23 +592,24 @@ void createSharedQueue(SimpleString address, RoutingType routingType, SimpleStri /** * Creates Shared queue. A queue that will exist as long as there are consumers or is durable. * - * @param address the queue will be bound to this address - * @param queueName the name of the queue + * @param address the queue will be bound to this address + * @param queueName the name of the queue * @param queueAttributes attributes for the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createSharedQueue(QueueConfiguration)} instead */ @Deprecated void createSharedQueue(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes) throws ActiveMQException; - /** * Creates a non-temporary queue. * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param durable whether the queue is durable or not + * @param queueName the name of the queue + * @param durable whether the queue is durable or not * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(String address, RoutingType routingType, String queueName, boolean durable) throws ActiveMQException; @@ -618,10 +617,11 @@ void createSharedQueue(SimpleString address, RoutingType routingType, SimpleStri /** * Creates a non-temporary queue non-durable queue. * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue + * @param queueName the name of the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(String address, RoutingType routingType, String queueName) throws ActiveMQException; @@ -629,10 +629,11 @@ void createSharedQueue(SimpleString address, RoutingType routingType, SimpleStri /** * Creates a non-temporary queue non-durable queue. * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue + * @param queueName the name of the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName) throws ActiveMQException; @@ -640,12 +641,13 @@ void createSharedQueue(SimpleString address, RoutingType routingType, SimpleStri /** * Creates a non-temporary queue. * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not + * @param queueName the name of the queue + * @param filter only messages which match this filter will be put in the queue + * @param durable whether the queue is durable or not * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, @@ -654,12 +656,13 @@ void createQueue(SimpleString address, RoutingType routingType, SimpleString que /** * Creates a non-temporaryqueue. * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not + * @param queueName the name of the queue + * @param filter only messages which match this filter will be put in the queue + * @param durable whether the queue is durable or not * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable) throws ActiveMQException; @@ -674,6 +677,7 @@ void createQueue(SimpleString address, RoutingType routingType, SimpleString que * @param durable whether the queue is durable or not * @param autoCreated whether to mark this queue as autoCreated or not * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, @@ -682,15 +686,15 @@ void createQueue(SimpleString address, RoutingType routingType, SimpleString que /** * Creates a non-temporary queue. * - * @param address the queue will be bound to this address - * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not - * @param autoCreated whether to mark this queue as autoCreated or not - * @param maxConsumers how many concurrent consumers will be allowed on this queue + * @param address the queue will be bound to this address + * @param routingType the routing type for this queue, MULTICAST or ANYCAST + * @param queueName the name of the queue + * @param filter only messages which match this filter will be put in the queue + * @param durable whether the queue is durable or not + * @param autoCreated whether to mark this queue as autoCreated or not + * @param maxConsumers how many concurrent consumers will be allowed on this queue * @param purgeOnNoConsumers whether to delete the contents of the queue when the last consumer disconnects - * @throws ActiveMQException + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, @@ -699,17 +703,17 @@ void createQueue(SimpleString address, RoutingType routingType, SimpleString que /** * Creates a non-temporary queue. * - * @param address the queue will be bound to this address - * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not - * @param autoCreated whether to mark this queue as autoCreated or not - * @param maxConsumers how many concurrent consumers will be allowed on this queue + * @param address the queue will be bound to this address + * @param routingType the routing type for this queue, MULTICAST or ANYCAST + * @param queueName the name of the queue + * @param filter only messages which match this filter will be put in the queue + * @param durable whether the queue is durable or not + * @param autoCreated whether to mark this queue as autoCreated or not + * @param maxConsumers how many concurrent consumers will be allowed on this queue * @param purgeOnNoConsumers whether to delete the contents of the queue when the last consumer disconnects - * @param exclusive whether the queue should be exclusive - * @param lastValue whether the queue should be lastValue - * @throws ActiveMQException + * @param exclusive whether the queue should be exclusive + * @param lastValue whether the queue should be lastValue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, @@ -718,11 +722,11 @@ void createQueue(SimpleString address, RoutingType routingType, SimpleString que /** * Creates a non-temporary queue. * - * @param address the queue will be bound to this address - * @param queueName the name of the queue - * @param autoCreated whether to mark this queue as autoCreated or not + * @param address the queue will be bound to this address + * @param queueName the name of the queue + * @param autoCreated whether to mark this queue as autoCreated or not * @param queueAttributes attributes for the queue - * @throws ActiveMQException + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(SimpleString address, SimpleString queueName, boolean autoCreated, QueueAttributes queueAttributes) throws ActiveMQException; @@ -737,6 +741,7 @@ void createQueue(SimpleString address, RoutingType routingType, SimpleString que * @param durable whether the queue is durable or not * @param autoCreated whether to mark this queue as autoCreated or not * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable, boolean autoCreated) throws ActiveMQException; @@ -744,15 +749,15 @@ void createQueue(SimpleString address, RoutingType routingType, SimpleString que /** * Creates a non-temporaryqueue. * - * @param address the queue will be bound to this address - * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not - * @param autoCreated whether to mark this queue as autoCreated or not - * @param maxConsumers how many concurrent consumers will be allowed on this queue + * @param address the queue will be bound to this address + * @param routingType the routing type for this queue, MULTICAST or ANYCAST + * @param queueName the name of the queue + * @param filter only messages which match this filter will be put in the queue + * @param durable whether the queue is durable or not + * @param autoCreated whether to mark this queue as autoCreated or not + * @param maxConsumers how many concurrent consumers will be allowed on this queue * @param purgeOnNoConsumers whether to delete the contents of the queue when the last consumer disconnects - * @throws ActiveMQException + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable, boolean autoCreated, @@ -761,17 +766,17 @@ void createQueue(String address, RoutingType routingType, String queueName, Stri /** * Creates a non-temporaryqueue. * - * @param address the queue will be bound to this address - * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not - * @param autoCreated whether to mark this queue as autoCreated or not - * @param maxConsumers how many concurrent consumers will be allowed on this queue + * @param address the queue will be bound to this address + * @param routingType the routing type for this queue, MULTICAST or ANYCAST + * @param queueName the name of the queue + * @param filter only messages which match this filter will be put in the queue + * @param durable whether the queue is durable or not + * @param autoCreated whether to mark this queue as autoCreated or not + * @param maxConsumers how many concurrent consumers will be allowed on this queue * @param purgeOnNoConsumers whether to delete the contents of the queue when the last consumer disconnects - * @param exclusive whether the queue should be exclusive - * @param lastValue whether the queue should be lastValue - * @throws ActiveMQException + * @param exclusive whether the queue should be exclusive + * @param lastValue whether the queue should be lastValue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable, boolean autoCreated, @@ -780,10 +785,11 @@ void createQueue(String address, RoutingType routingType, String queueName, Stri /** * Creates a temporary queue. * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue + * @param queueName the name of the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleString queueName) throws ActiveMQException; @@ -791,10 +797,11 @@ void createQueue(String address, RoutingType routingType, String queueName, Stri /** * Creates a temporary queue. * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue + * @param queueName the name of the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createTemporaryQueue(String address, RoutingType routingType, String queueName) throws ActiveMQException; @@ -802,15 +809,16 @@ void createQueue(String address, RoutingType routingType, String queueName, Stri /** * Creates a temporary queue with a filter. * - * @param address the queue will be bound to this address - * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param maxConsumers how many concurrent consumers will be allowed on this queue + * @param address the queue will be bound to this address + * @param routingType the routing type for this queue, MULTICAST or ANYCAST + * @param queueName the name of the queue + * @param filter only messages which match this filter will be put in the queue + * @param maxConsumers how many concurrent consumers will be allowed on this queue * @param purgeOnNoConsumers whether to delete the contents of the queue when the last consumer disconnects - * @param exclusive if the queue is exclusive queue - * @param lastValue if the queue is last value queue + * @param exclusive if the queue is exclusive queue + * @param lastValue if the queue is last value queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, int maxConsumers, @@ -819,10 +827,11 @@ void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleS /** * Creates a temporary queue with a filter. * - * @param address the queue will be bound to this address - * @param queueName the name of the queue + * @param address the queue will be bound to this address + * @param queueName the name of the queue * @param queueAttributes attributes for the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createTemporaryQueue(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes) throws ActiveMQException; @@ -830,11 +839,12 @@ void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleS /** * Creates a temporary queue with a filter. * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue + * @param queueName the name of the queue + * @param filter only messages which match this filter will be put in the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter) throws ActiveMQException; @@ -842,11 +852,12 @@ void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleS /** * Creates a temporary queue with a filter. * - * @param address the queue will be bound to this address + * @param address the queue will be bound to this address * @param routingType the routing type for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue + * @param queueName the name of the queue + * @param filter only messages which match this filter will be put in the queue * @throws ActiveMQException in an exception occurs while creating the queue + * @deprecated use {@link #createQueue(QueueConfiguration)} instead */ @Deprecated void createTemporaryQueue(String address, RoutingType routingType, String queueName, String filter) throws ActiveMQException; @@ -910,13 +921,12 @@ void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleS /** * Creates a ClientConsumer to consume or browse messages from the queue with the given name. *

    - * If browseOnly is true, the ClientConsumer will receive the messages - * from the queue but they will not be consumed (the messages will remain in the queue). Note - * that paged messages will not be in the queue, and will therefore not be visible if - * {@code browseOnly} is {@code true}. + * If {@code browseOnly} is {@code true}, the ClientConsumer will receive the messages from the queue but they will + * not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and + * will therefore not be visible if {@code browseOnly} is {@code true}. *

    - * If browseOnly is false, the ClientConsumer will behave like consume - * the messages from the queue and the messages will effectively be removed from the queue. + * If {@code browseOnly} is {@code false}, the ClientConsumer will behave like consume the messages from the queue + * and the messages will effectively be removed from the queue. * * @param queueName name of the queue to consume messages from * @param browseOnly whether the ClientConsumer will only browse the queue or consume messages. @@ -928,13 +938,12 @@ void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleS /** * Creates a ClientConsumer to consume or browse messages from the queue with the given name. *

    - * If browseOnly is true, the ClientConsumer will receive the messages - * from the queue but they will not be consumed (the messages will remain in the queue). Note - * that paged messages will not be in the queue, and will therefore not be visible if - * {@code browseOnly} is {@code true}. + * If {@code browseOnly} is {@code true}, the ClientConsumer will receive the messages from the queue but they will + * not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and + * will therefore not be visible if {@code browseOnly} is {@code true}. *

    - * If browseOnly is false, the ClientConsumer will behave like consume - * the messages from the queue and the messages will effectively be removed from the queue. + * If {@code browseOnly} is {@code false}, the ClientConsumer will behave like consume the messages from the queue + * and the messages will effectively be removed from the queue. * * @param queueName name of the queue to consume messages from * @param browseOnly whether the ClientConsumer will only browse the queue or consume messages. @@ -944,16 +953,14 @@ void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleS ClientConsumer createConsumer(String queueName, boolean browseOnly) throws ActiveMQException; /** - * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with - * the given name. + * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name. *

    - * If browseOnly is true, the ClientConsumer will receive the messages - * from the queue but they will not be consumed (the messages will remain in the queue). Note - * that paged messages will not be in the queue, and will therefore not be visible if - * {@code browseOnly} is {@code true}. + * If {@code browseOnly} is {@code true}, the ClientConsumer will receive the messages from the queue but they will + * not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and + * will therefore not be visible if {@code browseOnly} is {@code true}. *

    - * If browseOnly is false, the ClientConsumer will behave like consume - * the messages from the queue and the messages will effectively be removed from the queue. + * If {@code browseOnly} is {@code false}, the ClientConsumer will behave like consume the messages from the queue + * and the messages will effectively be removed from the queue. * * @param queueName name of the queue to consume messages from * @param filter only messages which match this filter will be consumed @@ -964,16 +971,14 @@ void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleS ClientConsumer createConsumer(String queueName, String filter, boolean browseOnly) throws ActiveMQException; /** - * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with - * the given name. + * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name. *

    - * If browseOnly is true, the ClientConsumer will receive the messages - * from the queue but they will not be consumed (the messages will remain in the queue). Note - * that paged messages will not be in the queue, and will therefore not be visible if - * {@code browseOnly} is {@code true}. + * If {@code browseOnly} is {@code true}, the ClientConsumer will receive the messages from the queue but they will + * not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and + * will therefore not be visible if {@code browseOnly} is {@code true}. *

    - * If browseOnly is false, the ClientConsumer will behave like consume - * the messages from the queue and the messages will effectively be removed from the queue. + * If {@code browseOnly} is {@code false}, the ClientConsumer will behave like consume the messages from the queue + * and the messages will effectively be removed from the queue. * * @param queueName name of the queue to consume messages from * @param filter only messages which match this filter will be consumed @@ -981,21 +986,17 @@ void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleS * @return a ClientConsumer * @throws ActiveMQException if an exception occurs while creating the ClientConsumer */ - ClientConsumer createConsumer(SimpleString queueName, - SimpleString filter, - boolean browseOnly) throws ActiveMQException; + ClientConsumer createConsumer(SimpleString queueName, SimpleString filter, boolean browseOnly) throws ActiveMQException; /** - * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with - * the given name. + * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name. *

    - * If browseOnly is true, the ClientConsumer will receive the messages - * from the queue but they will not be consumed (the messages will remain in the queue). Note - * that paged messages will not be in the queue, and will therefore not be visible if - * {@code browseOnly} is {@code true}. + * If {@code browseOnly} is {@code true}, the ClientConsumer will receive the messages from the queue but they will + * not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and + * will therefore not be visible if {@code browseOnly} is {@code true}. *

    - * If browseOnly is false, the ClientConsumer will behave like consume - * the messages from the queue and the messages will effectively be removed from the queue. + * If {@code browseOnly} is {@code false}, the ClientConsumer will behave like consume the messages from the queue + * and the messages will effectively be removed from the queue. * * @param queueName name of the queue to consume messages from * @param filter only messages which match this filter will be consumed @@ -1004,22 +1005,17 @@ ClientConsumer createConsumer(SimpleString queueName, * @return a ClientConsumer * @throws ActiveMQException if an exception occurs while creating the ClientConsumer */ - ClientConsumer createConsumer(SimpleString queueName, - SimpleString filter, - int priority, - boolean browseOnly) throws ActiveMQException; + ClientConsumer createConsumer(SimpleString queueName, SimpleString filter, int priority, boolean browseOnly) throws ActiveMQException; /** - * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with - * the given name. + * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name. *

    - * If browseOnly is true, the ClientConsumer will receive the messages - * from the queue but they will not be consumed (the messages will remain in the queue). Note - * that paged messages will not be in the queue, and will therefore not be visible if - * {@code browseOnly} is {@code true}. + * If {@code browseOnly} is {@code true}, the ClientConsumer will receive the messages from the queue but they will + * not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and + * will therefore not be visible if {@code browseOnly} is {@code true}. *

    - * If browseOnly is false, the ClientConsumer will behave like consume - * the messages from the queue and the messages will effectively be removed from the queue. + * If {@code browseOnly} is {@code false}, the ClientConsumer will behave like consume the messages from the queue + * and the messages will effectively be removed from the queue. * * @param queueName name of the queue to consume messages from * @param filter only messages which match this filter will be consumed @@ -1029,24 +1025,17 @@ ClientConsumer createConsumer(SimpleString queueName, * @return a ClientConsumer * @throws ActiveMQException if an exception occurs while creating the ClientConsumer */ - ClientConsumer createConsumer(SimpleString queueName, - SimpleString filter, - int windowSize, - int maxRate, - boolean browseOnly) throws ActiveMQException; - + ClientConsumer createConsumer(SimpleString queueName, SimpleString filter, int windowSize, int maxRate, boolean browseOnly) throws ActiveMQException; /** - * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with - * the given name. + * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name. *

    - * If browseOnly is true, the ClientConsumer will receive the messages - * from the queue but they will not be consumed (the messages will remain in the queue). Note - * that paged messages will not be in the queue, and will therefore not be visible if - * {@code browseOnly} is {@code true}. + * If {@code browseOnly} is {@code true}, the ClientConsumer will receive the messages from the queue but they will + * not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and + * will therefore not be visible if {@code browseOnly} is {@code true}. *

    - * If browseOnly is false, the ClientConsumer will behave like consume - * the messages from the queue and the messages will effectively be removed from the queue. + * If {@code browseOnly} is {@code false}, the ClientConsumer will behave like consume the messages from the queue + * and the messages will effectively be removed from the queue. * * @param queueName name of the queue to consume messages from * @param filter only messages which match this filter will be consumed @@ -1065,16 +1054,14 @@ ClientConsumer createConsumer(SimpleString queueName, boolean browseOnly) throws ActiveMQException; /** - * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with - * the given name. + * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name. *

    - * If browseOnly is true, the ClientConsumer will receive the messages - * from the queue but they will not be consumed (the messages will remain in the queue). Note - * that paged messages will not be in the queue, and will therefore not be visible if - * {@code browseOnly} is {@code true}. + * If {@code browseOnly} is {@code true}, the ClientConsumer will receive the messages from the queue but they will + * not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and + * will therefore not be visible if {@code browseOnly} is {@code true}. *

    - * If browseOnly is false, the ClientConsumer will behave like consume - * the messages from the queue and the messages will effectively be removed from the queue. + * If {@code browseOnly} is {@code false}, the ClientConsumer will behave like consume the messages from the queue + * and the messages will effectively be removed from the queue. * * @param queueName name of the queue to consume messages from * @param filter only messages which match this filter will be consumed @@ -1093,8 +1080,7 @@ ClientConsumer createConsumer(String queueName, // Producer Operations ------------------------------------------- /** - * Creates a producer with no default address. - * Address must be specified every time a message is sent + * Creates a producer with no default address. Address must be specified every time a message is sent * * @return a ClientProducer * @see ClientProducer#send(SimpleString, org.apache.activemq.artemis.api.core.Message) @@ -1183,16 +1169,12 @@ ClientConsumer createConsumer(String queueName, // Transaction operations ---------------------------------------- /** - * Returns the XAResource associated to the session. - * - * @return the XAResource associated to the session + * {@return the XAResource associated to the session} */ XAResource getXAResource(); /** - * Return true if the session supports XA, false else. - * - * @return true if the session supports XA, false else. + * {@return {@code true} if the session supports XA, {@code false} else} */ boolean isXA(); @@ -1227,37 +1209,29 @@ ClientConsumer createConsumer(String queueName, void rollback(boolean considerLastMessageAsDelivered) throws ActiveMQException; /** - * Returns true if the current transaction has been flagged to rollback, false else. - * - * @return true if the current transaction has been flagged to rollback, false else. + * {@return {@code true} if the current transaction has been flagged to rollback, {@code false} else} */ boolean isRollbackOnly(); /** - * Returns whether the session will automatically commit its transaction every time a message is sent - * by a ClientProducer created by this session, false else - * - * @return true if the session automatically commit its transaction every time a message is sent, false else + * {@return whether the session will automatically commit its transaction every time a message is sent by a + * ClientProducer created by this session, {@code false} else} */ boolean isAutoCommitSends(); /** - * Returns whether the session will automatically commit its transaction every time a message is acknowledged - * by a ClientConsumer created by this session, false else - * - * @return true if the session automatically commit its transaction every time a message is acknowledged, false else + * {@return {@code true} if the session automatically commit its transaction every time a message is + * acknowledged by a ClientConsumer created by this session, {@code false} else} */ boolean isAutoCommitAcks(); /** - * Returns whether the ClientConsumer created by the session will block when they acknowledge a message. - * - * @return true if the session's ClientConsumer block when they acknowledge a message, false else + * {@return {@code true} if the session's ClientConsumer block when they acknowledge a message, {@code false} else} */ boolean isBlockOnAcknowledge(); /** - * Sets a SendAcknowledgementHandler for this session. + * Sets a {@code SendAcknowledgementHandler} for this session. * * @param handler a SendAcknowledgementHandler * @return this ClientSession @@ -1266,24 +1240,19 @@ ClientConsumer createConsumer(String queueName, /** * Attach any metadata to the session. - * - * @throws ActiveMQException */ void addMetaData(String key, String data) throws ActiveMQException; /** - * Attach any metadata to the session. Throws an exception if there's already a metadata available. - * You can use this metadata to ensure that there is no other session with the same meta-data you are passing as an argument. - * This is useful to simulate unique client-ids, where you may want to avoid multiple instances of your client application connected. - * - * @throws ActiveMQException + * Attach any metadata to the session. Throws an exception if there's already a metadata available. You can use this + * metadata to ensure that there is no other session with the same meta-data you are passing as an argument. This is + * useful to simulate unique client-ids, where you may want to avoid multiple instances of your client application + * connected. */ void addUniqueMetaData(String key, String data) throws ActiveMQException; /** - * Return the sessionFactory used to created this Session. - * - * @return + * {@return the {@code ClientSessionFactory} used to created this {@code ClientSession}} */ ClientSessionFactory getSessionFactory(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSessionFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSessionFactory.java index e1e18e927e3..494c239acc3 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSessionFactory.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSessionFactory.java @@ -21,10 +21,11 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; /** - * A ClientSessionFactory is the entry point to create and configure ActiveMQ Artemis resources to produce and consume messages. - *
    - * It is possible to configure a factory using the setter methods only if no session has been created. - * Once a session is created, the configuration is fixed and any call to a setter method will throw an IllegalStateException. + * A ClientSessionFactory is the entry point to create and configure ActiveMQ Artemis resources to produce and consume + * messages. + *

    + * It is possible to configure a factory using the setter methods only if no session has been created. Once a session is + * created, the configuration is fixed and any call to a setter method will throw an IllegalStateException. */ public interface ClientSessionFactory extends AutoCloseable { @@ -48,10 +49,9 @@ public interface ClientSessionFactory extends AutoCloseable { ClientSession createTransactedSession() throws ActiveMQException; /** - * Creates a non-transacted session. - * Message sends and acknowledgements are automatically committed by the session. This does not - * mean that messages are automatically acknowledged, only that when messages are acknowledged, - * the session will automatically commit the transaction containing the acknowledgements. + * Creates a non-transacted session. Message sends and acknowledgements are automatically committed by the + * session. This does not mean that messages are automatically acknowledged, only that when messages are + * acknowledged, the session will automatically commit the transaction containing the acknowledgements. * * @return a non-transacted ClientSession * @throws ActiveMQException if an exception occurs while creating the session @@ -61,8 +61,9 @@ public interface ClientSessionFactory extends AutoCloseable { /** * Creates a session. * - * @param autoCommitSends true to automatically commit message sends, false to commit manually - * @param autoCommitAcks true to automatically commit message acknowledgement, false to commit manually + * @param autoCommitSends {@code true} to automatically commit message sends, {@code false} to commit manually + * @param autoCommitAcks {@code true} to automatically commit message acknowledgement, {@code false} to commit + * manually * @return a ClientSession * @throws ActiveMQException if an exception occurs while creating the session */ @@ -71,8 +72,9 @@ public interface ClientSessionFactory extends AutoCloseable { /** * Creates a session. * - * @param autoCommitSends true to automatically commit message sends, false to commit manually - * @param autoCommitAcks true to automatically commit message acknowledgement, false to commit manually + * @param autoCommitSends {@code true} to automatically commit message sends, {@code false} to commit manually + * @param autoCommitAcks {@code true} to automatically commit message acknowledgement, {@code false} to commit + * manually * @param ackBatchSize the batch size of the acknowledgements * @return a ClientSession * @throws ActiveMQException if an exception occurs while creating the session @@ -85,8 +87,9 @@ ClientSession createSession(boolean autoCommitSends, * Creates a session. * * @param xa whether the session support XA transaction semantic or not - * @param autoCommitSends true to automatically commit message sends, false to commit manually - * @param autoCommitAcks true to automatically commit message acknowledgement, false to commit manually + * @param autoCommitSends {@code true} to automatically commit message sends, {@code false} to commit manually + * @param autoCommitAcks {@code true} to automatically commit message acknowledgement, {@code false} to commit + * manually * @return a ClientSession * @throws ActiveMQException if an exception occurs while creating the session */ @@ -95,14 +98,17 @@ ClientSession createSession(boolean autoCommitSends, /** * Creates a session. *

    - * It is possible to pre-acknowledge messages on the server so that the client can avoid additional network trip - * to the server to acknowledge messages. While this increase performance, this does not guarantee delivery (as messages - * can be lost after being pre-acknowledged on the server). Use with caution if your application design permits it. + * It is possible to pre-acknowledge messages on the server so that the client can avoid additional network + * trip to the server to acknowledge messages. While this increase performance, this does not guarantee delivery (as + * messages can be lost after being pre-acknowledged on the server). Use with caution if your application design + * permits it. * * @param xa whether the session support XA transaction semantic or not - * @param autoCommitSends true to automatically commit message sends, false to commit manually - * @param autoCommitAcks true to automatically commit message acknowledgement, false to commit manually - * @param preAcknowledge true to pre-acknowledge messages on the server, false to let the client acknowledge the messages + * @param autoCommitSends {@code true} to automatically commit message sends, {@code false} to commit manually + * @param autoCommitAcks {@code true} to automatically commit message acknowledgement, {@code false} to commit + * manually + * @param preAcknowledge {@code true} to pre-acknowledge messages on the server, {@code false} to let the client + * acknowledge the messages * @return a ClientSession * @throws ActiveMQException if an exception occurs while creating the session */ @@ -114,16 +120,19 @@ ClientSession createSession(boolean xa, /** * Creates an authenticated session. *

    - * It is possible to pre-acknowledge messages on the server so that the client can avoid additional network trip - * to the server to acknowledge messages. While this increase performance, this does not guarantee delivery (as messages - * can be lost after being pre-acknowledged on the server). Use with caution if your application design permits it. + * It is possible to pre-acknowledge messages on the server so that the client can avoid additional network + * trip to the server to acknowledge messages. While this increase performance, this does not guarantee delivery (as + * messages can be lost after being pre-acknowledged on the server). Use with caution if your application design + * permits it. * * @param username the user name * @param password the user password * @param xa whether the session support XA transaction semantic or not - * @param autoCommitSends true to automatically commit message sends, false to commit manually - * @param autoCommitAcks true to automatically commit message acknowledgement, false to commit manually - * @param preAcknowledge true to pre-acknowledge messages on the server, false to let the client acknowledge the messages + * @param autoCommitSends {@code true} to automatically commit message sends, {@code false} to commit manually + * @param autoCommitAcks {@code true} to automatically commit message acknowledgement, {@code false} to commit + * manually + * @param preAcknowledge {@code true} to pre-acknowledge messages on the server, {@code false} to let the client + * acknowledge the messages * @return a ClientSession * @throws ActiveMQException if an exception occurs while creating the session */ @@ -138,16 +147,19 @@ ClientSession createSession(String username, /** * Creates an authenticated session. *

    - * It is possible to pre-acknowledge messages on the server so that the client can avoid additional network trip - * to the server to acknowledge messages. While this increase performance, this does not guarantee delivery (as messages - * can be lost after being pre-acknowledged on the server). Use with caution if your application design permits it. + * It is possible to pre-acknowledge messages on the server so that the client can avoid additional network + * trip to the server to acknowledge messages. While this increase performance, this does not guarantee delivery (as + * messages can be lost after being pre-acknowledged on the server). Use with caution if your application design + * permits it. * * @param username the user name * @param password the user password * @param xa whether the session support XA transaction semantic or not - * @param autoCommitSends true to automatically commit message sends, false to commit manually - * @param autoCommitAcks true to automatically commit message acknowledgement, false to commit manually - * @param preAcknowledge true to pre-acknowledge messages on the server, false to let the client acknowledge the messages + * @param autoCommitSends {@code true} to automatically commit message sends, {@code false} to commit manually + * @param autoCommitAcks {@code true} to automatically commit message acknowledgement, {@code false} to commit + * manually + * @param preAcknowledge {@code true} to pre-acknowledge messages on the server, {@code false} to let the client + * acknowledge the messages * @param clientID the session clientID * @return a ClientSession * @throws ActiveMQException if an exception occurs while creating the session @@ -168,7 +180,7 @@ ClientSession createSession(String username, void close(); /** - * @return {@code true} if the factory is closed, {@code false} otherwise. + * {@return {@code true} if the factory is closed, {@code false} otherwise} */ boolean isClosed(); @@ -184,7 +196,7 @@ ClientSession createSession(String username, * Removes a FailoverEventListener to the session. * * @param listener the listener to remove - * @return true if the listener was removed, false else + * @return {@code true} if the listener was removed, {@code false} else */ boolean removeFailoverListener(FailoverEventListener listener); @@ -194,21 +206,17 @@ ClientSession createSession(String username, void cleanup(); /** - * @return the server locator associated with this session factory + * {@return the server locator associated with this session factory} */ ServerLocator getServerLocator(); /** - * Returns the code connection used by this session factory. - * - * @return the core connection + * {@return the code connection used by this session factory} */ RemotingConnection getConnection(); /** - * Return the configuration used - * - * @return + * {@return the configuration used} */ TransportConfiguration getConnectorConfiguration(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClusterTopologyListener.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClusterTopologyListener.java index 4617e5bd8ba..3e0c7d044d8 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClusterTopologyListener.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClusterTopologyListener.java @@ -19,27 +19,23 @@ /** * A cluster topology listener. *

    - * Used to get notification of topology events. After adding a listener to the cluster connection, - * the listener receives {@link #nodeUP(TopologyMember, boolean)} for all the current topology - * members. + * Used to get notification of topology events. After adding a listener to the cluster connection, the listener receives + * {@link #nodeUP(TopologyMember, boolean)} for all the current topology members. */ public interface ClusterTopologyListener { /** * Triggered when a node joins the cluster. * - * @param member - * @param last if the whole cluster topology is being transmitted (after adding the listener to - * the cluster connection) this parameter will be {@code true} for the last topology - * member. + * @param last if the whole cluster topology is being transmitted (after adding the listener to the cluster + * connection) this parameter will be {@code true} for the last topology member. */ void nodeUP(TopologyMember member, boolean last); /** * Triggered when a node leaves the cluster. * - * @param eventUID - * @param nodeID the id of the node leaving the cluster + * @param nodeID the id of the node leaving the cluster */ void nodeDown(long eventUID, String nodeID); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/FailoverEventListener.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/FailoverEventListener.java index dae0e6a873d..21e5e171417 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/FailoverEventListener.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/FailoverEventListener.java @@ -22,7 +22,8 @@ public interface FailoverEventListener { /** - * Notifies that a connection state has changed according the specified event type.
    + * Notifies that a connection state has changed according the specified event type. + *

    * This method is called when failover is detected, if it fails and when it's completed * * @param eventType The type of event diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/MessageHandler.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/MessageHandler.java index 64fa15d3529..8e488405e89 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/MessageHandler.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/MessageHandler.java @@ -19,8 +19,8 @@ /** * A MessageHandler is used to receive message asynchronously. *

    - * To receive messages asynchronously, a MessageHandler is set on a ClientConsumer. Every time the - * consumer will receive a message, it will call the handler's {@code onMessage()} method. + * To receive messages asynchronously, a MessageHandler is set on a ClientConsumer. Every time the consumer will receive + * a message, it will call the handler's {@code onMessage()} method. * * @see ClientConsumer#setMessageHandler(MessageHandler) */ diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/SendAcknowledgementHandler.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/SendAcknowledgementHandler.java index ad45a5f9e2c..afc9b9f9cac 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/SendAcknowledgementHandler.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/SendAcknowledgementHandler.java @@ -19,19 +19,16 @@ import org.apache.activemq.artemis.api.core.Message; /** - * A SendAcknowledgementHandler notifies a client when a message sent asynchronously has been - * received by the server. + * A SendAcknowledgementHandler notifies a client when a message sent asynchronously has been received by the server. *

    - * If the session is not blocking when sending durable or non-durable messages, the session can set - * a SendAcknowledgementHandler to be notified later when the messages has been received by the - * server. The method {@link #sendAcknowledged(Message)} will be called with the message that was - * sent asynchronously. + * If the session is not blocking when sending durable or non-durable messages, the session can set a + * SendAcknowledgementHandler to be notified later when the messages has been received by the server. The method + * {@link #sendAcknowledged(Message)} will be called with the message that was sent asynchronously. *

    - * The rate of notification can be controlled through - * {@link ServerLocator#setConfirmationWindowSize(int)}. + * The rate of notification can be controlled through {@link ServerLocator#setConfirmationWindowSize(int)}. *

    - * Notice that this notification will only take place if {@code ConfirmationWindowSize} is set to a - * positive value at {@link ServerLocator#setConfirmationWindowSize(int)}. + * Notice that this notification will only take place if {@code ConfirmationWindowSize} is set to a positive value at + * {@link ServerLocator#setConfirmationWindowSize(int)}. */ public interface SendAcknowledgementHandler { @@ -43,10 +40,9 @@ public interface SendAcknowledgementHandler { void sendAcknowledged(Message message); default void sendFailed(Message message, Exception e) { - /** - * By default ignore failures to preserve compatibility with existing implementations. - * If the message makes it to the broker and a failure occurs sendAcknowledge() will - * still be invoked just like it always was. + /* + * By default ignore failures to preserve compatibility with existing implementations. If the message makes it to + * the broker and a failure occurs sendAcknowledge() will still be invoked just like it always was. */ } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ServerLocator.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ServerLocator.java index 8e5f9d1d069..0f6848f8bfd 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ServerLocator.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ServerLocator.java @@ -30,20 +30,17 @@ /** * The serverLocator locates a server, but beyond that it locates a server based on a list. *

    - * If you are using straight TCP on the configuration, and if you configure your serverLocator to be - * HA, the locator will always get an updated list of members to the server, the server will send - * the updated list to the client. + * If you are using straight TCP on the configuration, and if you configure your serverLocator to be HA, the locator + * will always get an updated list of members to the server, the server will send the updated list to the client. *

    - * If you use UDP or JGroups (exclusively JGroups or UDP), the initial discovery is done by the - * grouping finder, after the initial connection is made the server will always send updates to the - * client. But the listeners will listen for updates on grouping. + * If you use UDP or JGroups (exclusively JGroups or UDP), the initial discovery is done by the grouping finder, after + * the initial connection is made the server will always send updates to the client. But the listeners will listen for + * updates on grouping. */ public interface ServerLocator extends AutoCloseable { /** - * Returns true if close was already called - * - * @return {@code true} if closed, {@code false} otherwise. + * {@return {@code true} if closed, {@code false} otherwise} */ boolean isClosed(); @@ -58,63 +55,55 @@ default void disableFinalizeCheck() { * Creates a ClientSessionFactory using whatever load balancing policy is in force * * @return The ClientSessionFactory - * @throws Exception */ ClientSessionFactory createSessionFactory() throws Exception; /** - * Creates a {@link ClientSessionFactory} to a specific server. The server must already be known - * about by this ServerLocator. This method allows the user to make a connection to a specific - * server bypassing any load balancing policy in force + * Creates a {@link ClientSessionFactory} to a specific server. The server must already be known about by this + * ServerLocator. This method allows the user to make a connection to a specific server bypassing any load balancing + * policy in force * - * @param nodeID - * @return a ClientSessionFactory instance or {@code null} if the node is not present on the - * topology - * @throws Exception if a failure happened in creating the ClientSessionFactory or the - * ServerLocator does not know about the passed in transportConfiguration + * @return a ClientSessionFactory instance or {@code null} if the node is not present on the topology + * @throws Exception if a failure happened in creating the ClientSessionFactory or the ServerLocator does not know + * about the passed in transportConfiguration */ ClientSessionFactory createSessionFactory(String nodeID) throws Exception; /** - * Creates a {@link ClientSessionFactory} to a specific server. The server must already be known - * about by this ServerLocator. This method allows the user to make a connection to a specific - * server bypassing any load balancing policy in force + * Creates a {@link ClientSessionFactory} to a specific server. The server must already be known about by this + * ServerLocator. This method allows the user to make a connection to a specific server bypassing any load balancing + * policy in force * - * @param transportConfiguration * @return a {@link ClientSessionFactory} instance - * @throws Exception if a failure happened in creating the ClientSessionFactory or the - * ServerLocator does not know about the passed in transportConfiguration + * @throws Exception if a failure happened in creating the ClientSessionFactory or the ServerLocator does not know + * about the passed in transportConfiguration */ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfiguration) throws Exception; /** - * Creates a {@link ClientSessionFactory} to a specific server. The server must already be known - * about by this ServerLocator. This method allows the user to make a connection to a specific - * server bypassing any load balancing policy in force + * Creates a {@link ClientSessionFactory} to a specific server. The server must already be known about by this + * ServerLocator. This method allows the user to make a connection to a specific server bypassing any load balancing + * policy in force * - * @param transportConfiguration - * @param reconnectAttempts number of attempts of reconnection to perform + * @param reconnectAttempts number of attempts of reconnection to perform * @return a {@link ClientSessionFactory} instance - * @throws Exception if a failure happened in creating the ClientSessionFactory or the - * ServerLocator does not know about the passed in transportConfiguration + * @throws Exception if a failure happened in creating the ClientSessionFactory or the ServerLocator does not know + * about the passed in transportConfiguration */ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfiguration, int reconnectAttempts) throws Exception; /** - * Creates a {@link ClientSessionFactory} to a specific server. The server must already be known - * about by this ServerLocator. This method allows the user to make a connection to a specific - * server bypassing any load balancing policy in force - * - * @deprecated This method is no longer acceptable to create a client session factory. - * Replaced by {@link ServerLocator#createSessionFactory(TransportConfiguration, int)}. + * Creates a {@link ClientSessionFactory} to a specific server. The server must already be known about by this + * ServerLocator. This method allows the user to make a connection to a specific server bypassing any load balancing + * policy in force * - * @param transportConfiguration - * @param reconnectAttempts number of attempts of reconnection to perform - * @param failoverOnInitialConnection + * @param reconnectAttempts number of attempts of reconnection to perform * @return a {@link ClientSessionFactory} instance - * @throws Exception if a failure happened in creating the ClientSessionFactory or the - * ServerLocator does not know about the passed in transportConfiguration + * @throws Exception if a failure happened in creating the ClientSessionFactory or the ServerLocator does not know + * about the passed in transportConfiguration + * @deprecated This method is no longer acceptable to create a client session factory. Replaced by + * {@link ServerLocator#createSessionFactory(TransportConfiguration, int)}. */ @Deprecated ClientSessionFactory createSessionFactory(TransportConfiguration transportConfiguration, @@ -124,16 +113,14 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Returns the period used to check if a client has failed to receive pings from the server. *

    - * Period is in milliseconds, default value is - * {@link ActiveMQClient#DEFAULT_CLIENT_FAILURE_CHECK_PERIOD}. + * Period is in milliseconds, default value is {@link ActiveMQClient#DEFAULT_CLIENT_FAILURE_CHECK_PERIOD}. * * @return the period used to check if a client has failed to receive pings from the server */ long getClientFailureCheckPeriod(); /** - * Sets the period (in milliseconds) used to check if a client has failed to receive pings from - * the server. + * Sets the period (in milliseconds) used to check if a client has failed to receive pings from the server. *

    * Value must be -1 (to disable) or greater than 0. * @@ -143,22 +130,22 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig ServerLocator setClientFailureCheckPeriod(long clientFailureCheckPeriod); /** - * When true, consumers created through this factory will create temporary files to - * cache large messages. + * When {@code true}, consumers created through this factory will create temporary files to cache large messages. *

    * There is 1 temporary file created for each large message. *

    * Default value is {@link ActiveMQClient#DEFAULT_CACHE_LARGE_MESSAGE_CLIENT}. * - * @return true if consumers created through this factory will cache large messages - * in temporary files, false else + * @return {@code true} if consumers created through this factory will cache large messages in temporary files, + * {@code false} else */ boolean isCacheLargeMessagesClient(); /** - * Sets whether large messages received by consumers created through this factory will be cached in temporary files or not. + * Sets whether large messages received by consumers created through this factory will be cached in temporary files + * or not. * - * @param cached true to cache large messages in temporary files, false else + * @param cached {@code true} to cache large messages in temporary files, {@code false} else * @return this ServerLocator */ ServerLocator setCacheLargeMessagesClient(boolean cached); @@ -166,9 +153,8 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Returns the connection time-to-live. *

    - * This TTL determines how long the server will keep a connection alive in the absence of any - * data arriving from the client. Value is in milliseconds, default value is - * {@link ActiveMQClient#DEFAULT_CONNECTION_TTL}. + * This TTL determines how long the server will keep a connection alive in the absence of any data arriving from the + * client. Value is in milliseconds, default value is {@link ActiveMQClient#DEFAULT_CONNECTION_TTL}. * * @return the connection time-to-live in milliseconds */ @@ -188,8 +174,9 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig * Returns the blocking calls timeout. *

    * If client's blocking calls to the server take more than this timeout, the call will throw a - * {@link org.apache.activemq.artemis.api.core.ActiveMQException} with the code {@link org.apache.activemq.artemis.api.core.ActiveMQExceptionType#CONNECTION_TIMEDOUT}. Value - * is in milliseconds, default value is {@link ActiveMQClient#DEFAULT_CALL_TIMEOUT}. + * {@link org.apache.activemq.artemis.api.core.ActiveMQException} with the code + * {@link org.apache.activemq.artemis.api.core.ActiveMQExceptionType#CONNECTION_TIMEDOUT}. Value is in milliseconds, + * default value is {@link ActiveMQClient#DEFAULT_CALL_TIMEOUT}. * * @return the blocking calls timeout */ @@ -206,11 +193,11 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig ServerLocator setCallTimeout(long callTimeout); /** - * Returns the blocking calls failover timeout when the client is awaiting failover, - * this is over and above the normal call timeout. + * Returns the blocking calls failover timeout when the client is awaiting failover, this is over and above the + * normal call timeout. *

    - * If client is in the process of failing over when a blocking call is called then the client will wait this long before - * actually trying the send. + * If client is in the process of failing over when a blocking call is called then the client will wait this long + * before actually trying the send. * * @return the blocking calls failover timeout */ @@ -231,10 +218,10 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Returns the large message size threshold. *

    - * Messages whose size is if greater than this value will be handled as large messages. - * Value is in bytes, default value is {@link ActiveMQClient#DEFAULT_MIN_LARGE_MESSAGE_SIZE}. + * Messages whose size is if greater than this value will be handled as large messages. Value is in bytes, + * default value is {@link ActiveMQClient#DEFAULT_MIN_LARGE_MESSAGE_SIZE}. * - * @return the message size threshold to treat messages as large messages. + * @return the message size threshold to treat messages as large messages */ int getMinLargeMessageSize(); @@ -260,8 +247,8 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Sets the window size for flow control of the consumers created through this factory. *

    - * Value must be -1 (to disable flow control), 0 (to not buffer any messages) or greater than 0 - * (to set the maximum size of the buffer) + * Value must be -1 (to disable flow control), 0 (to not buffer any messages) or greater than 0 (to set the maximum + * size of the buffer) * * @param consumerWindowSize window size (in bytes) used for consumer flow control * @return this ServerLocator @@ -271,10 +258,11 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Returns the maximum rate of message consumption for consumers created through this factory. *

    - * This value controls the rate at which a consumer can consume messages. A consumer will never consume messages at a rate faster than the rate specified. + * This value controls the rate at which a consumer can consume messages. A consumer will never consume messages at a + * rate faster than the rate specified. *

    - * Value is -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate specified in units of messages per second. - * Default value is {@link ActiveMQClient#DEFAULT_CONSUMER_MAX_RATE}. + * Value is -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate + * specified in units of messages per second. Default value is {@link ActiveMQClient#DEFAULT_CONSUMER_MAX_RATE}. * * @return the consumer max rate */ @@ -283,7 +271,8 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Sets the maximum rate of message consumption for consumers created through this factory. *

    - * Value must -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate specified in units of messages per second. + * Value must -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate + * specified in units of messages per second. * * @param consumerMaxRate maximum rate of message consumption (in messages per seconds) * @return this ServerLocator @@ -313,10 +302,11 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Returns the window size for flow control of the producers created through this factory. *

    - * Value must be -1 (to disable flow control) or greater than 0 to determine the maximum amount of bytes at any give time (to prevent overloading the connection). - * Default value is {@link ActiveMQClient#DEFAULT_PRODUCER_WINDOW_SIZE}. + * Value must be -1 (to disable flow control) or greater than 0 to determine the maximum amount of bytes at any give + * time (to prevent overloading the connection). Default value is + * {@link ActiveMQClient#DEFAULT_PRODUCER_WINDOW_SIZE}. * - * @return the window size for flow control of the producers created through this factory. + * @return the window size for flow control of the producers created through this factory */ int getProducerWindowSize(); @@ -333,10 +323,11 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Returns the maximum rate of message production for producers created through this factory. *

    - * This value controls the rate at which a producer can produce messages. A producer will never produce messages at a rate faster than the rate specified. + * This value controls the rate at which a producer can produce messages. A producer will never produce messages at a + * rate faster than the rate specified. *

    - * Value is -1 (to disable) or a positive integer corresponding to the maximum desired message production rate specified in units of messages per second. - * Default value is {@link ActiveMQClient#DEFAULT_PRODUCER_MAX_RATE}. + * Value is -1 (to disable) or a positive integer corresponding to the maximum desired message production rate + * specified in units of messages per second. Default value is {@link ActiveMQClient#DEFAULT_PRODUCER_MAX_RATE}. * * @return maximum rate of message production (in messages per seconds) */ @@ -345,7 +336,8 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Sets the maximum rate of message production for producers created through this factory. *

    - * Value must -1 (to disable) or a positive integer corresponding to the maximum desired message production rate specified in units of messages per second. + * Value must -1 (to disable) or a positive integer corresponding to the maximum desired message production rate + * specified in units of messages per second. * * @param producerMaxRate maximum rate of message production (in messages per seconds) * @return this ServerLocator @@ -353,32 +345,31 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig ServerLocator setProducerMaxRate(int producerMaxRate); /** - * Returns whether consumers created through this factory will block while - * sending message acknowledgments or do it asynchronously. + * Returns whether consumers created through this factory will block while sending message acknowledgments or do it + * asynchronously. *

    * Default value is {@link ActiveMQClient#DEFAULT_BLOCK_ON_ACKNOWLEDGE}. * - * @return whether consumers will block while sending message - * acknowledgments or do it asynchronously + * @return whether consumers will block while sending message acknowledgments or do it asynchronously */ boolean isBlockOnAcknowledge(); /** - * Sets whether consumers created through this factory will block while - * sending message acknowledgments or do it asynchronously. + * Sets whether consumers created through this factory will block while sending message acknowledgments or do it + * asynchronously. * - * @param blockOnAcknowledge true to block when sending message - * acknowledgments or false to send them + * @param blockOnAcknowledge {@code true} to block when sending message acknowledgments or {@code false} to send them * asynchronously * @return this ServerLocator */ ServerLocator setBlockOnAcknowledge(boolean blockOnAcknowledge); /** - * Returns whether producers created through this factory will block while sending durable messages or do it asynchronously. - *
    - * If the session is configured to send durable message asynchronously, the client can set a SendAcknowledgementHandler on the ClientSession - * to be notified once the message has been handled by the server. + * Returns whether producers created through this factory will block while sending durable messages or do it + * asynchronously. + *

    + * If the session is configured to send durable message asynchronously, the client can set a + * SendAcknowledgementHandler on the ClientSession to be notified once the message has been handled by the server. *

    * Default value is {@link ActiveMQClient#DEFAULT_BLOCK_ON_DURABLE_SEND}. * @@ -387,18 +378,21 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig boolean isBlockOnDurableSend(); /** - * Sets whether producers created through this factory will block while sending durable messages or do it asynchronously. + * Sets whether producers created through this factory will block while sending durable messages or do it + * asynchronously. * - * @param blockOnDurableSend true to block when sending durable messages or false to send them asynchronously + * @param blockOnDurableSend {@code true} to block when sending durable messages or {@code false} to send them + * asynchronously * @return this ServerLocator */ ServerLocator setBlockOnDurableSend(boolean blockOnDurableSend); /** - * Returns whether producers created through this factory will block while sending non-durable messages or do it asynchronously. - *
    - * If the session is configured to send non-durable message asynchronously, the client can set a SendAcknowledgementHandler on the ClientSession - * to be notified once the message has been handled by the server. + * Returns whether producers created through this factory will block while sending non-durable messages or + * do it asynchronously. + *

    + * If the session is configured to send non-durable message asynchronously, the client can set a + * SendAcknowledgementHandler on the ClientSession to be notified once the message has been handled by the server. *

    * Default value is {@link ActiveMQClient#DEFAULT_BLOCK_ON_NON_DURABLE_SEND}. * @@ -407,36 +401,40 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig boolean isBlockOnNonDurableSend(); /** - * Sets whether producers created through this factory will block while sending non-durable messages or do it asynchronously. + * Sets whether producers created through this factory will block while sending non-durable messages or do + * it asynchronously. * - * @param blockOnNonDurableSend true to block when sending non-durable messages or false to send them asynchronously + * @param blockOnNonDurableSend {@code true} to block when sending non-durable messages or {@code false} to send them + * asynchronously * @return this ServerLocator */ ServerLocator setBlockOnNonDurableSend(boolean blockOnNonDurableSend); /** - * Returns whether producers created through this factory will automatically - * assign a group ID to the messages they sent. + * Returns whether producers created through this factory will automatically assign a group ID to the messages they + * sent. *

    - * if true, a random unique group ID is created and set on each message for the property - * {@link org.apache.activemq.artemis.api.core.Message#HDR_GROUP_ID}. - * Default value is {@link ActiveMQClient#DEFAULT_AUTO_GROUP}. + * if {@code true}, a random unique group ID is created and set on each message for the property + * {@link org.apache.activemq.artemis.api.core.Message#HDR_GROUP_ID}. Default value is + * {@link ActiveMQClient#DEFAULT_AUTO_GROUP}. * * @return whether producers will automatically assign a group ID to their messages */ boolean isAutoGroup(); /** - * Sets whether producers created through this factory will automatically - * assign a group ID to the messages they sent. + * Sets whether producers created through this factory will automatically assign a group ID to the messages they + * sent. * - * @param autoGroup true to automatically assign a group ID to each messages sent through this factory, false else + * @param autoGroup {@code true} to automatically assign a group ID to each messages sent through this factory, + * {@code false} else * @return this ServerLocator */ ServerLocator setAutoGroup(boolean autoGroup); /** - * Returns the group ID that will be eventually set on each message for the property {@link org.apache.activemq.artemis.api.core.Message#HDR_GROUP_ID}. + * Returns the group ID that will be eventually set on each message for the property + * {@link org.apache.activemq.artemis.api.core.Message#HDR_GROUP_ID}. *

    * Default value is is {@code null} and no group ID will be set on the messages. * @@ -460,12 +458,10 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig boolean isPreAcknowledge(); /** - * Sets to true to pre-acknowledge consumed messages on the - * server before they are sent to consumers, else set to false - * to let clients acknowledge the message they consume. + * Sets to {@code true} to pre-acknowledge consumed messages on the server before they are sent to consumers, else + * set to {@code false} to let clients acknowledge the message they consume. * - * @param preAcknowledge true to enable pre-acknowledgment, - * false else + * @param preAcknowledge {@code true} to enable pre-acknowledgment, {@code false} else * @return this ServerLocator */ ServerLocator setPreAcknowledge(boolean preAcknowledge); @@ -490,8 +486,8 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig ServerLocator setAckBatchSize(int ackBatchSize); /** - * Returns an array of TransportConfigurations representing the static list of servers used - * when creating this object + * Returns an array of TransportConfigurations representing the static list of servers used when creating this + * object * * @return array with all static {@link TransportConfiguration}s */ @@ -503,20 +499,20 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig DiscoveryGroupConfiguration getDiscoveryGroupConfiguration(); /** - * Returns whether this factory will use global thread pools (shared among all the factories in the same JVM) - * or its own pools. + * Returns whether this factory will use global thread pools (shared among all the factories in the same JVM) or its + * own pools. *

    * Default value is {@link ActiveMQClient#DEFAULT_USE_GLOBAL_POOLS}. * - * @return true if this factory uses global thread pools, false else + * @return {@code true} if this factory uses global thread pools, {@code false} else */ boolean isUseGlobalPools(); /** - * Sets whether this factory will use global thread pools (shared among all the factories in the same JVM) - * or its own pools. + * Sets whether this factory will use global thread pools (shared among all the factories in the same JVM) or its own + * pools. * - * @param useGlobalPools true to let this factory uses global thread pools, false else + * @param useGlobalPools {@code true} to let this factory uses global thread pools, {@code false} else * @return this ServerLocator */ ServerLocator setUseGlobalPools(boolean useGlobalPools); @@ -526,15 +522,14 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig *

    * Default value is {@link ActiveMQClient#DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE}. * - * @return the maximum size of the scheduled thread pool. + * @return the maximum size of the scheduled thread pool */ int getScheduledThreadPoolMaxSize(); /** * Sets the maximum size of the scheduled thread pool. *

    - * This setting is relevant only if this factory does not use global pools. - * Value must be greater than 0. + * This setting is relevant only if this factory does not use global pools. Value must be greater than 0. * * @param scheduledThreadPoolMaxSize maximum size of the scheduled thread pool. * @return this ServerLocator @@ -546,15 +541,15 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig *

    * Default value is {@link ActiveMQClient#DEFAULT_THREAD_POOL_MAX_SIZE}. * - * @return the maximum size of the thread pool. + * @return the maximum size of the thread pool */ int getThreadPoolMaxSize(); /** * Sets the maximum size of the thread pool. *

    - * This setting is relevant only if this factory does not use global pools. - * Value must be -1 (for unlimited thread pool) or greater than 0. + * This setting is relevant only if this factory does not use global pools. Value must be -1 (for unlimited thread + * pool) or greater than 0. * * @param threadPoolMaxSize maximum size of the thread pool. * @return this ServerLocator @@ -566,15 +561,15 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig *

    * Default value is {@link ActiveMQClient#DEFAULT_FLOW_CONTROL_THREAD_POOL_MAX_SIZE}. * - * @return the maximum size of the flow-control thread pool. + * @return the maximum size of the flow-control thread pool */ int getFlowControlThreadPoolMaxSize(); /** * Sets the maximum size of the flow-control thread pool. *

    - * This setting is relevant only if this factory does not use global pools. - * Value must be -1 (for unlimited thread pool) or greater than 0. + * This setting is relevant only if this factory does not use global pools. Value must be -1 (for unlimited thread + * pool) or greater than 0. * * @param flowControlThreadPoolMaxSize maximum size of the flow-control thread pool. * @return this ServerLocator @@ -633,8 +628,8 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig *

    * Value must be greater than 0. * - * @param maxRetryInterval maximum retry interval to apply in the case a retry interval multiplier - * has been specified + * @param maxRetryInterval maximum retry interval to apply in the case a retry interval multiplier has been + * specified * @return this ServerLocator */ ServerLocator setMaxRetryInterval(long maxRetryInterval); @@ -644,7 +639,7 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig *

    * Default value is {@link ActiveMQClient#DEFAULT_RECONNECT_ATTEMPTS}. * - * @return the maximum number of attempts to retry connection in case of failure. + * @return the maximum number of attempts to retry connection in case of failure */ int getReconnectAttempts(); @@ -669,12 +664,13 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig ServerLocator setInitialConnectAttempts(int reconnectAttempts); /** - * @return the number of attempts to be made for first initial connection. + * {@return the number of attempts to be made for first initial connection} */ int getInitialConnectAttempts(); /** - * Sets the maximum number of failover attempts to establish a connection to other primary servers after a connection failure. + * Sets the maximum number of failover attempts to establish a connection to other primary servers after a connection + * failure. *

    * Value must be -1 (to retry infinitely), 0 (to never retry connection) or greater than 0. * @@ -684,13 +680,13 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig ServerLocator setFailoverAttempts(int attempts); /** - * @return the number of failover attempts after a connection failure. + * {@return the number of failover attempts after a connection failure} */ int getFailoverAttempts(); /** - * Returns true if the client will automatically attempt to connect to the backup server if the initial - * connection to the primary server fails + * Returns true if the client will automatically attempt to connect to the backup server if the initial connection to + * the primary server fails *

    * Default value is {@link ActiveMQClient#DEFAULT_FAILOVER_ON_INITIAL_CONNECTION}. */ @@ -700,7 +696,6 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Sets the value for FailoverOnInitialReconnection * - * @param failover * @return this ServerLocator */ @Deprecated @@ -709,7 +704,8 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Returns the class name of the connection load balancing policy. *

    - * Default value is "org.apache.activemq.artemis.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy". + * Default value is + * "org.apache.activemq.artemis.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy". * * @return the class name of the connection load balancing policy */ @@ -718,7 +714,8 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Sets the class name of the connection load balancing policy. *

    - * Value must be the name of a class implementing {@link org.apache.activemq.artemis.api.core.client.loadbalance.ConnectionLoadBalancingPolicy}. + * Value must be the name of a class implementing + * {@link org.apache.activemq.artemis.api.core.client.loadbalance.ConnectionLoadBalancingPolicy}. * * @param loadBalancingPolicyClassName class name of the connection load balancing policy * @return this ServerLocator @@ -754,11 +751,13 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig int getOnMessageCloseTimeout(); /** - * Sets the timeout in milliseconds for onMessage completion when closing ClientConsumers created through this factory. + * Sets the timeout in milliseconds for onMessage completion when closing ClientConsumers created through this + * factory. *

    * A value of -1 means wait until the onMessage completes no matter how long it takes. * - * @param onMessageCloseTimeout how long to wait in milliseconds for the ClientConsumer's MessageHandler's onMessage method to finish before closing or stopping the ClientConsumer. + * @param onMessageCloseTimeout how long to wait in milliseconds for the ClientConsumer's MessageHandler's onMessage + * method to finish before closing or stopping the ClientConsumer. * @return this ServerLocator */ ServerLocator setOnMessageCloseTimeout(int onMessageCloseTimeout); @@ -783,7 +782,7 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig * Removes an incoming interceptor. * * @param interceptor interceptor to remove - * @return true if the incoming interceptor is removed from this factory, false else + * @return {@code true} if the incoming interceptor is removed from this factory, {@code false} else */ boolean removeIncomingInterceptor(Interceptor interceptor); @@ -791,7 +790,7 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig * Removes an outgoing interceptor. * * @param interceptor interceptor to remove - * @return true if the outgoing interceptor is removed from this factory, false else + * @return {@code true} if the outgoing interceptor is removed from this factory, {@code false} else */ boolean removeOutgoingInterceptor(Interceptor interceptor); @@ -801,12 +800,6 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig @Override void close(); - /** - * - * - * @param useTopologyForLoadBalancing - * @return - */ ServerLocator setUseTopologyForLoadBalancing(boolean useTopologyForLoadBalancing); boolean getUseTopologyForLoadBalancing(); @@ -819,8 +812,7 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig Topology getTopology(); /** - * Whether this server receives topology notifications from the cluster as servers join or leave - * the cluster. + * Whether this server receives topology notifications from the cluster as servers join or leave the cluster. * * @return {@code true} if the locator receives topology updates from the cluster */ @@ -829,45 +821,36 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig /** * Verify if all of the transports are using inVM. * - * @return {@code true} if the locator has all inVM transports. + * @return {@code true} if the locator has all inVM transports */ boolean allInVM(); /** * Whether to compress large messages. - * - * @return */ boolean isCompressLargeMessage(); /** * Sets whether to compress or not large messages. * - * @param compressLargeMessages * @return this ServerLocator */ ServerLocator setCompressLargeMessage(boolean compressLargeMessages); /** * What compression level is in use - * - * @return */ int getCompressionLevel(); /** - * Sets what compressionLevel to use when compressing messages - * Value must be -1 (default), or 0-9 + * Sets what compressionLevel to use when compressing messages Value must be -1 (default), or 0-9 * - * @param compressionLevel * @return this ServerLocator */ ServerLocator setCompressionLevel(int compressionLevel); - // XXX No javadocs ServerLocator addClusterTopologyListener(ClusterTopologyListener listener); - // XXX No javadocs void removeClusterTopologyListener(ClusterTopologyListener listener); ClientProtocolManagerFactory getProtocolManagerFactory(); @@ -875,20 +858,32 @@ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfig ServerLocator setProtocolManagerFactory(ClientProtocolManagerFactory protocolManager); /** - * @param interceptorList a comma separated string of incoming interceptor class names to be used. Each interceptor needs a default Constructor to be used with this method. + * Set the list of {@link Interceptor}s to use for incoming packets. + * + * @param interceptorList a comma separated string of incoming interceptor class names to be used. Each interceptor + * needs a default Constructor to be used with this method. * @return this */ ServerLocator setIncomingInterceptorList(String interceptorList); String getIncomingInterceptorList(); + /** + * Set the list of {@link Interceptor}s to use for outgoing packets. + * + * @param interceptorList a comma separated string of incoming interceptor class names to be used. Each interceptor + * needs a default Constructor to be used with this method. + * @return this + */ ServerLocator setOutgoingInterceptorList(String interceptorList); String getOutgoingInterceptorList(); boolean setThreadPools(Executor threadPool, ScheduledExecutorService scheduledThreadPoolExecutor, Executor flowControlThreadPool); - /** This will only instantiate internal objects such as the topology */ + /** + * This will only instantiate internal objects such as the topology + */ void initialize() throws ActiveMQException; ServerLocatorConfig getLocatorConfig(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/SessionFailureListener.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/SessionFailureListener.java index 011cee1de04..5a6aa5f0256 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/SessionFailureListener.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/SessionFailureListener.java @@ -26,7 +26,7 @@ public interface SessionFailureListener extends FailureListener { /** * Notifies that a connection has failed due to the specified exception. - *
    + *

    * This method is called before the session attempts to reconnect/failover. * * @param exception exception which has caused the connection to fail diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/TopologyMember.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/TopologyMember.java index da4f4e1f942..603fcd11fc1 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/TopologyMember.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/TopologyMember.java @@ -21,18 +21,17 @@ /** * A member of the topology. - * - * Each TopologyMember represents a single server and possibly any backup server that may take over - * its duties (using the nodeId of the original server). + *

    + * Each TopologyMember represents a single server and possibly any backup server that may take over its duties (using + * the nodeId of the original server). */ public interface TopologyMember { /** - * Returns the {@code backup-group-name} of the primary server and backup servers associated with - * Topology entry. + * Returns the {@code backup-group-name} of the primary server and backup servers associated with Topology entry. *

    - * This is a server configuration value. A (remote) backup will only work with primary servers that - * have a matching {@code backup-group-name}. + * This is a server configuration value. A (remote) backup will only work with primary servers that have a matching + * {@code backup-group-name}. *

    * This value does not apply to "shared-storage" backup and primary pairs. * @@ -43,57 +42,46 @@ public interface TopologyMember { /** * Returns the {@code scale-down-group-name} of the server with this Topology entry. *

    - * This is a server configuration value. An active server will only send its messages to another active server - * with matching {@code scale-down-group-name}. + * This is a server configuration value. An active server will only send its messages to another active server with + * matching {@code scale-down-group-name}. * * @return the {@code scale-down-group-name} */ String getScaleDownGroupName(); /** - * @return configuration relative to the live server + * {@return configuration relative to the live server} */ @Deprecated(forRemoval = true) TransportConfiguration getLive(); /** - * @return configuration relative to the primary server + * {@return configuration relative to the primary server} */ TransportConfiguration getPrimary(); /** - * Returns the TransportConfiguration relative to the backup server if any. - * - * @return a {@link TransportConfiguration} for the backup, or null if the primary server has no - * backup server. + * {@return a {@link TransportConfiguration} for the backup, or null if the primary server has no backup server.} */ TransportConfiguration getBackup(); /** - * Returns the nodeId of the server. - * - * @return the nodeId + * {@return the nodeId of the server} */ String getNodeId(); /** - * @return long value representing a unique event ID + * {@return long value representing a unique event ID} */ long getUniqueEventID(); /** - * Returns true if this TopologyMember is the target of this remoting connection - * - * @param connection - * @return + * {@return {@code true} if this {@code TopologyMember} is the target of this remoting connection} */ boolean isMember(RemotingConnection connection); /** - * Returns true if this configuration is the target of this remoting connection - * - * @param configuration - * @return + * {@return {@code true} if this configuration is the target of this remoting connection} */ boolean isMember(TransportConfiguration configuration); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RandomConnectionLoadBalancingPolicy.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RandomConnectionLoadBalancingPolicy.java index e411c9c2fd9..a7ef7965914 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RandomConnectionLoadBalancingPolicy.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RandomConnectionLoadBalancingPolicy.java @@ -19,8 +19,8 @@ import org.apache.activemq.artemis.utils.RandomUtil; /** - * {@link RandomConnectionLoadBalancingPolicy#select(int)} returns a (pseudo) random integer between - * {@code 0} (inclusive) and {@code max} (exclusive). + * {@link RandomConnectionLoadBalancingPolicy#select(int)} returns a (pseudo) random integer between {@code 0} + * (inclusive) and {@code max} (exclusive). */ public final class RandomConnectionLoadBalancingPolicy implements ConnectionLoadBalancingPolicy { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RandomStickyConnectionLoadBalancingPolicy.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RandomStickyConnectionLoadBalancingPolicy.java index 12c59fd151c..4d6b82e8a31 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RandomStickyConnectionLoadBalancingPolicy.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RandomStickyConnectionLoadBalancingPolicy.java @@ -19,7 +19,8 @@ import org.apache.activemq.artemis.utils.RandomUtil; /** - * {@link RandomConnectionLoadBalancingPolicy#select(int)} chooses a the initial node randomly then subsequent requests return the same node + * {@link RandomConnectionLoadBalancingPolicy#select(int)} chooses a the initial node randomly then subsequent requests + * return the same node */ public final class RandomStickyConnectionLoadBalancingPolicy implements ConnectionLoadBalancingPolicy { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RoundRobinConnectionLoadBalancingPolicy.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RoundRobinConnectionLoadBalancingPolicy.java index 60ad022cd82..41c9ea74d79 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RoundRobinConnectionLoadBalancingPolicy.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/loadbalance/RoundRobinConnectionLoadBalancingPolicy.java @@ -22,10 +22,9 @@ /** * RoundRobinConnectionLoadBalancingPolicy corresponds to a round-robin load-balancing policy. - * - *
    - * The first call to {@link #select(int)} will return a random integer between {@code 0} (inclusive) and {@code max} (exclusive). - * Subsequent calls will then return an integer in a round-robin fashion. + *

    + * The first call to {@link #select(int)} will return a random integer between {@code 0} (inclusive) and {@code max} + * (exclusive). Subsequent calls will then return an integer in a round-robin fashion. */ public final class RoundRobinConnectionLoadBalancingPolicy implements ConnectionLoadBalancingPolicy, Serializable { 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 88a98c09ad7..8f7e099139b 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 @@ -25,11 +25,10 @@ import java.lang.invoke.MethodHandles; /** - * This class maintain a global Map of JChannels wrapped in JChannelWrapper for - * the purpose of reference counting. - * - * Wherever a JChannel is needed it should only get it by calling the getChannel() - * method of this class. The real disconnect of channels are also done here only. + * This class maintain a global Map of JChannels wrapped in JChannelWrapper for the purpose of reference counting. + *

    + * Wherever a JChannel is needed it should only get it by calling the getChannel() method of this class. The real + * disconnect of channels are also done here only. */ public class JChannelManager { 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 3b28912aa93..638ba0ecf32 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 @@ -27,9 +27,8 @@ import java.lang.invoke.MethodHandles; /** - * This class wraps a JChannel with a reference counter. The reference counter - * controls the life of the JChannel. When reference count is zero, the channel - * will be disconnected. + * This class wraps a JChannel with a reference counter. The reference counter controls the life of the JChannel. When + * reference count is zero, the channel will be disconnected. */ public class JChannelWrapper { 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 efaf1310c17..f6df42c7952 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 @@ -26,8 +26,7 @@ import org.jgroups.Receiver; /** - * This class is used to receive messages from a JGroups channel. - * Incoming messages are put into a queue. + * This class is used to receive messages from a JGroups channel. Incoming messages are put into a queue. */ public class JGroupsReceiver implements Receiver { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/AcceptorControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/AcceptorControl.java index a2c0604553d..77da88cc804 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/AcceptorControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/AcceptorControl.java @@ -25,27 +25,26 @@ public interface AcceptorControl extends ActiveMQComponentControl { /** - * Returns the name of the acceptor + * {@return the name of the acceptor} */ @Attribute(desc = "name of the acceptor") String getName(); /** - * Returns the class name of the AcceptorFactory implementation - * used by this acceptor. + * {@return the class name of the AcceptorFactory implementation used by this acceptor} */ @Attribute(desc = "class name of the AcceptorFactory implementation used by this acceptor") String getFactoryClassName(); /** - * Returns the parameters used to configure this acceptor + * {@return the parameters used to configure this acceptor} */ @Attribute(desc = "parameters used to configure this acceptor") Map getParameters(); /** - * Re-create the acceptor with the existing configuration values. Useful, for example, for reloading key/trust - * stores on acceptors which support SSL. + * Re-create the acceptor with the existing configuration values. Useful, for example, for reloading key/trust stores + * on acceptors which support SSL. */ @Operation(desc = "Re-create the acceptor with the existing configuration values. Useful, for example, for reloading key/trust stores on acceptors which support SSL.", impact = MBeanOperationInfo.ACTION) void reload(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQComponentControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQComponentControl.java index 7c98b6b4e37..b402ec942eb 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQComponentControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQComponentControl.java @@ -22,7 +22,7 @@ public interface ActiveMQComponentControl { /** - * Returns {@code true} if this component is started, {@code false} else. + * {@return {@code true} if this component is started, {@code false} else.} */ @Attribute(desc = "whether this component is started") boolean isStarted(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java index 6f4e1e66f54..9f6387675f8 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java @@ -39,7 +39,7 @@ public interface ActiveMQServerControl { String AUTHORIZATION_FAILURE_COUNT = "Number of failed authorization attempts"; /** - * Returns this server's name. + * {@return this server's name.} */ @Attribute(desc = "Server's name") String getName(); @@ -48,7 +48,7 @@ public interface ActiveMQServerControl { long getCurrentTimeMillis(); /** - * Returns this server's version. + * {@return this server's version.} */ @Attribute(desc = "Server's version") String getVersion(); @@ -58,37 +58,37 @@ public interface ActiveMQServerControl { boolean isActive(); /** - * Returns the number of clients connected to this server. + * {@return the number of clients connected to this server.} */ @Attribute(desc = CONNECTION_COUNT_DESCRIPTION) int getConnectionCount(); /** - * Returns the number of clients which have connected to this server since it was started. + * {@return the number of clients which have connected to this server since it was started.} */ @Attribute(desc = TOTAL_CONNECTION_COUNT_DESCRIPTION) long getTotalConnectionCount(); /** - * Returns the number of messages in all queues currently on the server. + * {@return the number of messages in all queues currently on the server.} */ @Attribute(desc = "Number of messages in all queues currently on the server") long getTotalMessageCount(); /** - * Returns the number of messages sent to all queues currently on the server since they were created. + * {@return the number of messages sent to all queues currently on the server since they were created.} */ @Attribute(desc = "Number of messages sent to all queues currently on the server since they were created") long getTotalMessagesAdded(); /** - * Returns the number of messages acknowledged from all the queues currently on this server since they were created. + * {@return the number of messages acknowledged from all the queues currently on this server since they were created.} */ @Attribute(desc = "Number of messages acknowledged from all the queues currently on this server since they were created") long getTotalMessagesAcknowledged(); /** - * Returns the number of consumers on all the queues currently on this server. + * {@return the number of consumers on all the queues currently on this server.} */ @Attribute(desc = "Number of consumers on all the queues currently on this server") long getTotalConsumerCount(); @@ -100,7 +100,7 @@ public interface ActiveMQServerControl { boolean isStarted(); /** - * Returns the list of interceptors used by this server for incoming messages. + * {@return the list of interceptors used by this server for incoming messages.} * * @see org.apache.activemq.artemis.api.core.Interceptor */ @@ -108,7 +108,7 @@ public interface ActiveMQServerControl { String[] getIncomingInterceptorClassNames(); /** - * Returns the list of interceptors used by this server for outgoing messages. + * {@return the list of interceptors used by this server for outgoing messages.} * * @see org.apache.activemq.artemis.api.core.Interceptor */ @@ -120,85 +120,85 @@ public interface ActiveMQServerControl { String[] getBrokerPluginClassNames(); /** - * Returns whether this server is clustered. + * {@return whether this server is clustered.} */ @Attribute(desc = "Whether this server is clustered") boolean isClustered(); /** - * Returns the maximum number of threads in the scheduled thread pool. + * {@return the maximum number of threads in the scheduled thread pool.} */ @Attribute(desc = "Maximum number of threads in the scheduled thread pool") int getScheduledThreadPoolMaxSize(); /** - * Returns the maximum number of threads in the thread pool. + * {@return the maximum number of threads in the thread pool.} */ @Attribute(desc = "Maximum number of threads in the thread pool") int getThreadPoolMaxSize(); /** - * Returns the interval time (in milliseconds) to invalidate security credentials. + * {@return the interval time (in milliseconds) to invalidate security credentials.} */ @Attribute(desc = "Interval time (in milliseconds) to invalidate security credentials") long getSecurityInvalidationInterval(); /** - * Returns whether security is enabled for this server. + * {@return whether security is enabled for this server.} */ @Attribute(desc = "Whether security is enabled for this server") boolean isSecurityEnabled(); /** - * Returns the file system directory used to store bindings. + * {@return the file system directory used to store bindings.} */ @Attribute(desc = "File system directory used to store bindings") String getBindingsDirectory(); /** - * Returns the file system directory used to store journal log. + * {@return the file system directory used to store journal log.} */ @Attribute(desc = "File system directory used to store journal log") String getJournalDirectory(); /** - * Returns the type of journal used by this server (either {@code NIO} or {@code ASYNCIO}). + * {@return the type of journal used by this server (either {@code NIO} or {@code ASYNCIO}).} */ @Attribute(desc = "Type of journal used by this server") String getJournalType(); /** - * Returns whether the journal is synchronized when receiving transactional data. + * {@return whether the journal is synchronized when receiving transactional data.} */ @Attribute(desc = "Whether the journal is synchronized when receiving transactional data") boolean isJournalSyncTransactional(); /** - * Returns whether the journal is synchronized when receiving non-transactional data. + * {@return whether the journal is synchronized when receiving non-transactional data.} */ @Attribute(desc = "Whether the journal is synchronized when receiving non-transactional datar") boolean isJournalSyncNonTransactional(); /** - * Returns the size (in bytes) of each journal files. + * {@return the size (in bytes) of each journal files.} */ @Attribute(desc = "Size (in bytes) of each journal files") int getJournalFileSize(); /** - * Returns the number of journal files to pre-create. + * {@return the number of journal files to pre-create.} */ @Attribute(desc = "Number of journal files to pre-create") int getJournalMinFiles(); /** - * Returns the maximum number of write requests that can be in the AIO queue at any given time. + * {@return the maximum number of write requests that can be in the AIO queue at any given time.} */ @Attribute(desc = "Maximum number of write requests that can be in the AIO queue at any given time") int getJournalMaxIO(); /** - * Returns the size of the internal buffer on the journal. + * {@return the size of the internal buffer on the journal.} */ @Attribute(desc = "Size of the internal buffer on the journal") int getJournalBufferSize(); @@ -210,7 +210,7 @@ public interface ActiveMQServerControl { int getJournalPoolFiles(); /** - * Returns the timeout (in nanoseconds) used to flush internal buffers on the journal. + * {@return the timeout (in nanoseconds) used to flush internal buffers on the journal.} */ @Attribute(desc = "Timeout (in nanoseconds) used to flush internal buffers on the journal") int getJournalBufferTimeout(); @@ -222,13 +222,13 @@ public interface ActiveMQServerControl { void setFailoverOnServerShutdown(boolean failoverOnServerShutdown) throws Exception; /** - * returns if clients failover on a server shutdown + * {@return if clients failover on a server shutdown} */ @Attribute(desc = "If clients failover on a server shutdown") boolean isFailoverOnServerShutdown(); /** - * Returns the minimal number of journal files before compacting. + * {@return the minimal number of journal files before compacting.} */ @Attribute(desc = "Minimal number of journal files before compacting") int getJournalCompactMinFiles(); @@ -240,31 +240,31 @@ public interface ActiveMQServerControl { int getJournalCompactPercentage(); /** - * Returns whether this server is using persistence and store data. + * {@return whether this server is using persistence and store data.} */ @Attribute(desc = "Whether this server is using persistence and store data") boolean isPersistenceEnabled(); /** - * Returns whether the bindings directory is created on this server startup. + * {@return whether the bindings directory is created on this server startup.} */ @Attribute(desc = "Whether the bindings directory is created on this server startup") boolean isCreateBindingsDir(); /** - * Returns whether the journal directory is created on this server startup. + * {@return whether the journal directory is created on this server startup.} */ @Attribute(desc = "Whether the journal directory is created on this server startup") boolean isCreateJournalDir(); /** - * Returns whether message counter is enabled for this server. + * {@return whether message counter is enabled for this server.} */ @Attribute(desc = "Whether message counter is enabled for this server") boolean isMessageCounterEnabled(); /** - * Returns the maximum number of days kept in memory for message counter. + * {@return the maximum number of days kept in memory for message counter.} */ @Attribute(desc = "Maximum number of days kept in memory for message counter") int getMessageCounterMaxDayCount(); @@ -278,7 +278,7 @@ public interface ActiveMQServerControl { void setMessageCounterMaxDayCount(int count) throws Exception; /** - * Returns the sample period (in milliseconds) to take message counter snapshot. + * {@return the sample period (in milliseconds) to take message counter snapshot.} */ @Attribute(desc = "Sample period (in milliseconds) to take message counter snapshot") long getMessageCounterSamplePeriod(); @@ -292,229 +292,221 @@ public interface ActiveMQServerControl { void setMessageCounterSamplePeriod(long newPeriod) throws Exception; /** - * Returns {@code true} if this server is a backup, {@code false} if it is a primary server. - *
    - * If a backup server has been activated, returns {@code false}. + * {@return {@code true} if this server is a backup, {@code false} if it is a primary server or if it is a backup + * server and has been activated} */ @Attribute(desc = "Whether this server is a backup") boolean isBackup(); /** - * Returns whether this server shares its data store with a corresponding primary or backup server. + * {@return whether this server shares its data store with a corresponding primary or backup server.} */ @Attribute(desc = "Whether this server shares its data store with a corresponding primary or backup serve") boolean isSharedStore(); /** - * Returns the file system directory used to store paging files. + * {@return the file system directory used to store paging files.} */ @Attribute(desc = "File system directory used to store paging files") String getPagingDirectory(); /** - * Returns whether delivery count is persisted before messages are delivered to the consumers. + * {@return whether delivery count is persisted before messages are delivered to the consumers.} */ @Attribute(desc = "Whether delivery count is persisted before messages are delivered to the consumers") boolean isPersistDeliveryCountBeforeDelivery(); /** - * Returns the connection time to live. - *
    - * This value overrides the connection time to live sent by the client. + * {@return the connection time to live; this value overrides the connection time to live sent by the client} */ @Attribute(desc = "Connection time to live") long getConnectionTTLOverride(); /** - * Returns the management address of this server. - *
    - * Clients can send management messages to this address to manage this server. + * {@return the management address of this server; clients can send management messages to this address to manage + * this server} */ @Attribute(desc = "Management address of this server") String getManagementAddress(); /** - * Returns the node ID of this server. - *
    - * Clients can send management messages to this address to manage this server. + * {@return the node ID of this server.} */ @Attribute(desc = "Node ID of this server") String getNodeID(); /** - * Returns the current activation sequence number of this server. - *
    - * When replicated, peers may coordinate activation with this monotonic sequence + * {@return the current activation sequence number of this server; when replicated, peers may coordinate activation + * with this monotonic sequence} */ @Attribute(desc = "Activation sequence of this server instance") long getActivationSequence(); /** - * Returns the management notification address of this server. - *
    - * Clients can bind queues to this address to receive management notifications emitted by this server. + * {@return the management notification address of this server; clients can bind queues to this address to receive + * management notifications emitted by this server} */ @Attribute(desc = "Management notification address of this server") String getManagementNotificationAddress(); /** - * Returns the size of the cache for pre-creating message IDs. + * {@return the size of the cache for pre-creating message IDs.} */ @Attribute(desc = "Size of the cache for pre-creating message IDs") int getIDCacheSize(); /** - * Returns whether message ID cache is persisted. + * {@return whether message ID cache is persisted.} */ @Attribute(desc = "Whether message ID cache is persisted") boolean isPersistIDCache(); /** - * Returns the file system directory used to store large messages. + * {@return the file system directory used to store large messages.} */ @Attribute(desc = "File system directory used to store large messages") String getLargeMessagesDirectory(); /** - * Returns whether wildcard routing is supported by this server. + * {@return whether wildcard routing is supported by this server.} */ @Attribute(desc = "Whether wildcard routing is supported by this server") boolean isWildcardRoutingEnabled(); /** - * Returns the timeout (in milliseconds) after which transactions is removed + * {@return the timeout (in milliseconds) after which transactions is removed} * from the resource manager after it was created. */ @Attribute(desc = "Timeout (in milliseconds) after which transactions is removed from the resource manager after it was created") long getTransactionTimeout(); /** - * Returns the frequency (in milliseconds) to scan transactions to detect which transactions + * {@return the frequency (in milliseconds) to scan transactions to detect which transactions} * have timed out. */ @Attribute(desc = "Frequency (in milliseconds) to scan transactions to detect which transactions have timed out") long getTransactionTimeoutScanPeriod(); /** - * Returns the frequency (in milliseconds) to scan messages to detect which messages + * {@return the frequency (in milliseconds) to scan messages to detect which messages} * have expired. */ @Attribute(desc = "Frequency (in milliseconds) to scan messages to detect which messages have expired") long getMessageExpiryScanPeriod(); /** - * Returns the priority of the thread used to scan message expiration. + * {@return the priority of the thread used to scan message expiration.} */ @Attribute(desc = "Priority of the thread used to scan message expiration") @Deprecated long getMessageExpiryThreadPriority(); /** - * Returns whether code coming from connection is executed asynchronously or not. + * {@return whether code coming from connection is executed asynchronously or not.} */ @Attribute(desc = "Whether code coming from connection is executed asynchronously or not") boolean isAsyncConnectionExecutionEnabled(); /** - * Returns the connectors configured for this server. + * {@return the connectors configured for this server.} */ @Attribute(desc = "Connectors configured for this server") Object[] getConnectors() throws Exception; /** - * Returns the connectors configured for this server using JSON serialization. + * {@return the connectors configured for this server using JSON serialization.} */ @Attribute(desc = "Connectors configured for this server using JSON serialization") String getConnectorsAsJSON() throws Exception; /** - * Returns the acceptors configured for this server. + * {@return the acceptors configured for this server.} */ @Attribute(desc = "Connectors configured for this server") Object[] getAcceptors() throws Exception; /** - * Returns the acceptors configured for this server using JSON serialization. + * {@return the acceptors configured for this server using JSON serialization.} */ @Attribute(desc = "Acceptors configured for this server using JSON serialization") String getAcceptorsAsJSON() throws Exception; /** - * Returns the number of addresses created on this server. + * {@return the number of addresses created on this server.} */ @Attribute(desc = "Number of addresses created on this server") int getAddressCount(); /** - * Returns the names of the addresses created on this server. + * {@return the names of the addresses created on this server.} */ @Attribute(desc = "Names of the addresses created on this server") String[] getAddressNames(); /** - * Returns the number of queues created on this server. + * {@return the number of queues created on this server.} */ @Attribute(desc = "Number of queues created on this server") int getQueueCount(); /** - * Returns the names of the queues created on this server. + * {@return the names of the queues created on this server.} */ @Attribute(desc = "Names of the queues created on this server") String[] getQueueNames(); /** - * Returns the uptime of this server. + * {@return the uptime of this server.} */ @Attribute(desc = "Uptime of this server") String getUptime(); /** - * Returns the uptime of this server. + * {@return the uptime of this server.} */ @Attribute(desc = "Uptime of this server in milliseconds") long getUptimeMillis(); /** - * Returns whether the initial replication synchronization process with the backup server is complete; applicable for - * either the primary or backup server. + * {@return whether the initial replication synchronization process with the backup server is complete; applicable + * for either the primary or backup server} */ @Attribute(desc = REPLICA_SYNC_DESCRIPTION) boolean isReplicaSync(); /** - * Returns how often the server checks for disk space usage. + * {@return how often the server checks for disk space usage.} */ @Attribute(desc = "How often to check for disk space usage, in milliseconds") int getDiskScanPeriod(); /** - * Returns the disk use max limit. + * {@return the disk use max limit.} */ @Attribute(desc = "Maximum limit for disk use, in percentage") int getMaxDiskUsage(); /** - * Returns the global max bytes limit for in-memory messages. + * {@return the global max bytes limit for in-memory messages.} */ @Attribute(desc = "Global maximum limit for in-memory messages, in bytes") long getGlobalMaxSize(); /** - * Returns the memory used by all the addresses on broker for in-memory messages + * {@return the memory used by all the addresses on broker for in-memory messages} */ @Attribute(desc = ADDRESS_MEMORY_USAGE_DESCRIPTION) long getAddressMemoryUsage(); /** - * Returns the percentage of total disk store use + * {@return the percentage of total disk store use} */ @Attribute(desc = DISK_STORE_USAGE_DESCRIPTION) double getDiskStoreUsage(); /** - * Returns the memory used by all the addresses on broker as a percentage of the global-max-size + * {@return the memory used by all the addresses on broker as a percentage of the global-max-size} */ @Attribute(desc = ADDRESS_MEMORY_USAGE_PERCENTAGE_DESCRIPTION) int getAddressMemoryUsagePercentage(); @@ -523,13 +515,13 @@ public interface ActiveMQServerControl { String getHAPolicy(); /** - * Returns the runtime size of the authentication cache + * {@return the runtime size of the authentication cache} */ @Attribute(desc = "The runtime size of the authentication cache") long getAuthenticationCacheSize(); /** - * Returns the runtime size of the authorization cache + * {@return the runtime size of the authorization cache} */ @Attribute(desc = "The runtime size of the authorization cache") long getAuthorizationCacheSize(); @@ -558,10 +550,11 @@ void deleteAddress(@Parameter(name = "name", desc = "The name of the address") S /** * Create a durable queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exits. * * @param address address to bind the queue to * @param name name of the queue @@ -573,10 +566,11 @@ void createQueue(@Parameter(name = "address", desc = "Address of the queue") Str /** * Create a durable queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exits. * * @param address address to bind the queue to * @param name name of the queue @@ -590,10 +584,11 @@ void createQueue(@Parameter(name = "address", desc = "Address of the queue") Str /** * Create a queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exits. * * @param address address to bind the queue to * @param name name of the queue @@ -607,10 +602,11 @@ void createQueue(@Parameter(name = "address", desc = "Address of the queue") Str /** * Create a queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exits. * * @param address address to bind the queue to * @param name name of the queue @@ -624,13 +620,13 @@ void createQueue(@Parameter(name = "address", desc = "Address of the queue") Str @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable, @Parameter(name = "routingType", desc = "The routing type used for this address, MULTICAST or ANYCAST") String routingType) throws Exception; - /** * Create a queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exits. * * @param address address to bind the queue to * @param name name of the queue @@ -646,10 +642,11 @@ void createQueue(@Parameter(name = "address", desc = "Address of the queue") Str /** * Create a queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exits. * * @param address address to bind the queue to * @param name name of the queue @@ -667,25 +664,25 @@ void createQueue(@Parameter(name = "address", desc = "Address of the queue") Str /** * Create a queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exits. * - * @param address address to bind the queue to - * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} - * @param name name of the queue - * @param filterStr filter of the queue - * @param durable is the queue durable? - * @param maxConsumers the maximum number of consumers allowed on this queue at any one time - * @param purgeOnNoConsumers delete this queue when the last consumer disconnects - * @param exclusive if the queue should route exclusively to one consumer - * @param lastValue use last-value semantics + * @param address address to bind the queue to + * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} + * @param name name of the queue + * @param filterStr filter of the queue + * @param durable is the queue durable? + * @param maxConsumers the maximum number of consumers allowed on this queue at any one time + * @param purgeOnNoConsumers delete this queue when the last consumer disconnects + * @param exclusive if the queue should route exclusively to one consumer + * @param lastValue use last-value semantics * @param consumersBeforeDispatch number of consumers needed before dispatch can start - * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met - * @param autoCreateAddress create an address with default values should a matching address not be found + * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met + * @param autoCreateAddress create an address with default values should a matching address not be found * @return a textual summary of the queue - * @throws Exception */ @Deprecated @Operation(desc = "Create a queue", impact = MBeanOperationInfo.ACTION) @@ -706,28 +703,27 @@ String createQueue(@Parameter(name = "address", desc = "Address of the queue") S @Parameter(name = "delayBeforeDispatch", desc = "Delay to wait before dispatching if number of consumers before dispatch is not met") long delayBeforeDispatch, @Parameter(name = "autoCreateAddress", desc = "Create an address with default values should a matching address not be found") boolean autoCreateAddress) throws Exception; - /** * Create a queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exits. * - * @param address address to bind the queue to - * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} - * @param name name of the queue - * @param filterStr filter of the queue - * @param durable is the queue durable? - * @param maxConsumers the maximum number of consumers allowed on this queue at any one time - * @param purgeOnNoConsumers delete this queue when the last consumer disconnects - * @param exclusive if the queue should route exclusively to one consumer - * @param lastValue use last-value semantics + * @param address address to bind the queue to + * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} + * @param name name of the queue + * @param filterStr filter of the queue + * @param durable is the queue durable? + * @param maxConsumers the maximum number of consumers allowed on this queue at any one time + * @param purgeOnNoConsumers delete this queue when the last consumer disconnects + * @param exclusive if the queue should route exclusively to one consumer + * @param lastValue use last-value semantics * @param consumersBeforeDispatch number of consumers needed before dispatch can start - * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met - * @param autoCreateAddress create an address with default values should a matching address not be found + * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met + * @param autoCreateAddress create an address with default values should a matching address not be found * @return a textual summary of the queue - * @throws Exception */ @Deprecated @Operation(desc = "Create a queue", impact = MBeanOperationInfo.ACTION) @@ -753,25 +749,25 @@ String createQueue(@Parameter(name = "address", desc = "Address of the queue") S /** * Create a queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exits. * - * @param address address to bind the queue to - * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} - * @param name name of the queue - * @param filterStr filter of the queue - * @param durable is the queue durable? - * @param maxConsumers the maximum number of consumers allowed on this queue at any one time - * @param purgeOnNoConsumers delete this queue when the last consumer disconnects - * @param exclusive if the queue should route exclusively to one consumer - * @param lastValue use last-value semantics + * @param address address to bind the queue to + * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} + * @param name name of the queue + * @param filterStr filter of the queue + * @param durable is the queue durable? + * @param maxConsumers the maximum number of consumers allowed on this queue at any one time + * @param purgeOnNoConsumers delete this queue when the last consumer disconnects + * @param exclusive if the queue should route exclusively to one consumer + * @param lastValue use last-value semantics * @param consumersBeforeDispatch number of consumers needed before dispatch can start - * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met - * @param autoCreateAddress create an address with default values should a matching address not be found + * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met + * @param autoCreateAddress create an address with default values should a matching address not be found * @return a textual summary of the queue - * @throws Exception */ @Deprecated @Operation(desc = "Create a queue", impact = MBeanOperationInfo.ACTION) @@ -798,26 +794,26 @@ String createQueue(@Parameter(name = "address", desc = "Address of the queue") S /** * Create a queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exits. * - * @param address address to bind the queue to - * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} - * @param name name of the queue - * @param filterStr filter of the queue - * @param durable is the queue durable? - * @param maxConsumers the maximum number of consumers allowed on this queue at any one time - * @param purgeOnNoConsumers delete this queue when the last consumer disconnects - * @param exclusive if the queue should route exclusively to one consumer - * @param lastValue use last-value semantics + * @param address address to bind the queue to + * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} + * @param name name of the queue + * @param filterStr filter of the queue + * @param durable is the queue durable? + * @param maxConsumers the maximum number of consumers allowed on this queue at any one time + * @param purgeOnNoConsumers delete this queue when the last consumer disconnects + * @param exclusive if the queue should route exclusively to one consumer + * @param lastValue use last-value semantics * @param consumersBeforeDispatch number of consumers needed before dispatch can start - * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met - * @param autoCreateAddress create an address with default values should a matching address not be found - * @param ringSize the size this queue should maintain according to ring semantics + * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met + * @param autoCreateAddress create an address with default values should a matching address not be found + * @param ringSize the size this queue should maintain according to ring semantics * @return a textual summary of the queue - * @throws Exception */ @Deprecated @Operation(desc = "Create a queue", impact = MBeanOperationInfo.ACTION) @@ -845,10 +841,11 @@ String createQueue(@Parameter(name = "address", desc = "Address of the queue") S /** * Create a queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exits. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exits. * * @param address address to bind the queue to * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} @@ -859,7 +856,6 @@ String createQueue(@Parameter(name = "address", desc = "Address of the queue") S * @param purgeOnNoConsumers delete this queue when the last consumer disconnects * @param autoCreateAddress create an address with default values should a matching address not be found * @return a textual summary of the queue - * @throws Exception */ @Deprecated @Operation(desc = "Create a queue", impact = MBeanOperationInfo.ACTION) @@ -871,39 +867,38 @@ String createQueue(@Parameter(name = "address", desc = "Address of the queue") S @Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") int maxConsumers, @Parameter(name = "purgeOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") boolean purgeOnNoConsumers, @Parameter(name = "autoCreateAddress", desc = "Create an address with default values should a matching address not be found") boolean autoCreateAddress) throws Exception; + /** * Create a queue. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exists. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exists. * * @param queueConfiguration the configuration of the queue in JSON format * @return the configuration of the created queue in JSON format - * @throws Exception */ @Operation(desc = "Create a queue", impact = MBeanOperationInfo.ACTION) String createQueue(@Parameter(name = "queueConfiguration", desc = "the configuration of the queue in JSON format") String queueConfiguration) throws Exception; /** * Create a queue. - *
    - * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the queue already exists and {@code ignoreIfExists} is {@code false}. + *

    + * This method throws a {@link org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException}) exception if the + * queue already exists and {@code ignoreIfExists} is {@code false}. * * @param queueConfiguration the configuration of the queue in JSON format - * @param ignoreIfExists whether or not to simply return without an exception if the queue exists + * @param ignoreIfExists whether to simply return without an exception if the queue exists * @return the configuration of the created queue in JSON format - * @throws Exception */ @Operation(desc = "Create a queue", impact = MBeanOperationInfo.ACTION) String createQueue(@Parameter(name = "queueConfiguration", desc = "the configuration of the queue in JSON format") String queueConfiguration, @Parameter(name = "ignoreIfExists", desc = "whether or not to try to create the queue if it exists already") boolean ignoreIfExists) throws Exception; - /** * Update a queue. * * @param queueConfiguration the configuration of the queue in JSON format * @return the configuration of the created queue in JSON format - * @throws Exception */ @Operation(desc = "Update a queue", impact = MBeanOperationInfo.ACTION) String updateQueue(@Parameter(name = "queueConfiguration", desc = "the configuration of the queue in JSON format") String queueConfiguration) throws Exception; @@ -916,7 +911,6 @@ String createQueue(@Parameter(name = "queueConfiguration", desc = "the configura * @param maxConsumers the maximum number of consumers allowed on this queue at any one time * @param purgeOnNoConsumers delete this queue when the last consumer disconnects * @return a textual summary of the queue - * @throws Exception */ @Deprecated @Operation(desc = "Update a queue", impact = MBeanOperationInfo.ACTION) @@ -934,7 +928,6 @@ String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String * @param purgeOnNoConsumers delete this queue when the last consumer disconnects * @param exclusive if the queue should route exclusively to one consumer * @return a textual summary of the queue - * @throws Exception */ @Deprecated @Operation(desc = "Update a queue", impact = MBeanOperationInfo.ACTION) @@ -953,8 +946,6 @@ String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String * @param purgeOnNoConsumers delete this queue when the last consumer disconnects * @param exclusive if the queue should route exclusively to one consumer * @param user the user associated with this queue - * @return - * @throws Exception */ @Deprecated @Operation(desc = "Update a queue", impact = MBeanOperationInfo.ACTION) @@ -968,20 +959,19 @@ String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String /** * Update a queue * - * @param name name of the queue - * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} - * @param filter the filter to use on the queue - * @param maxConsumers the maximum number of consumers allowed on this queue at any one time - * @param purgeOnNoConsumers delete this queue when the last consumer disconnects - * @param exclusive if the queue should route exclusively to one consumer - * @param groupRebalance if the queue should rebalance groups when a consumer is added - * @param groupBuckets number of buckets that should be used for message groups, -1 (default) is unlimited, and groups by raw key instead - * @param nonDestructive If the queue is non-destructive + * @param name name of the queue + * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} + * @param filter the filter to use on the queue + * @param maxConsumers the maximum number of consumers allowed on this queue at any one time + * @param purgeOnNoConsumers delete this queue when the last consumer disconnects + * @param exclusive if the queue should route exclusively to one consumer + * @param groupRebalance if the queue should rebalance groups when a consumer is added + * @param groupBuckets number of buckets that should be used for message groups, -1 (default) is + * unlimited, and groups by raw key instead + * @param nonDestructive If the queue is non-destructive * @param consumersBeforeDispatch number of consumers needed before dispatch can start - * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met - * @param user the user associated with this queue - * @return - * @throws Exception + * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met + * @param user the user associated with this queue */ @Deprecated @Operation(desc = "Update a queue", impact = MBeanOperationInfo.ACTION) @@ -1001,21 +991,20 @@ String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String /** * Update a queue * - * @param name name of the queue - * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} - * @param filter the filter to use on the queue - * @param maxConsumers the maximum number of consumers allowed on this queue at any one time - * @param purgeOnNoConsumers delete this queue when the last consumer disconnects - * @param exclusive if the queue should route exclusively to one consumer - * @param groupRebalance if the queue should rebalance groups when a consumer is added - * @param groupBuckets number of buckets that should be used for message groups, -1 (default) is unlimited, and groups by raw key instead - * @param groupFirstKey key used to mark a message is first in a group for a consumer - * @param nonDestructive If the queue is non-destructive + * @param name name of the queue + * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} + * @param filter the filter to use on the queue + * @param maxConsumers the maximum number of consumers allowed on this queue at any one time + * @param purgeOnNoConsumers delete this queue when the last consumer disconnects + * @param exclusive if the queue should route exclusively to one consumer + * @param groupRebalance if the queue should rebalance groups when a consumer is added + * @param groupBuckets number of buckets that should be used for message groups, -1 (default) is + * unlimited, and groups by raw key instead + * @param groupFirstKey key used to mark a message is first in a group for a consumer + * @param nonDestructive If the queue is non-destructive * @param consumersBeforeDispatch number of consumers needed before dispatch can start - * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met - * @param user the user associated with this queue - * @return - * @throws Exception + * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met + * @param user the user associated with this queue */ @Deprecated @Operation(desc = "Update a queue", impact = MBeanOperationInfo.ACTION) @@ -1036,22 +1025,21 @@ String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String /** * Update a queue * - * @param name name of the queue - * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} - * @param filter the filter to use on the queue - * @param maxConsumers the maximum number of consumers allowed on this queue at any one time - * @param purgeOnNoConsumers delete this queue when the last consumer disconnects - * @param exclusive if the queue should route exclusively to one consumer - * @param groupRebalance if the queue should rebalance groups when a consumer is added - * @param groupBuckets number of buckets that should be used for message groups, -1 (default) is unlimited, and groups by raw key instead - * @param groupFirstKey key used to mark a message is first in a group for a consumer - * @param nonDestructive If the queue is non-destructive + * @param name name of the queue + * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} + * @param filter the filter to use on the queue + * @param maxConsumers the maximum number of consumers allowed on this queue at any one time + * @param purgeOnNoConsumers delete this queue when the last consumer disconnects + * @param exclusive if the queue should route exclusively to one consumer + * @param groupRebalance if the queue should rebalance groups when a consumer is added + * @param groupBuckets number of buckets that should be used for message groups, -1 (default) is + * unlimited, and groups by raw key instead + * @param groupFirstKey key used to mark a message is first in a group for a consumer + * @param nonDestructive If the queue is non-destructive * @param consumersBeforeDispatch number of consumers needed before dispatch can start - * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met - * @param user the user associated with this queue - * @param ringSize the size this queue should maintain according to ring semantics - * @return - * @throws Exception + * @param delayBeforeDispatch delay to wait before dispatching if number of consumers before dispatch is not met + * @param user the user associated with this queue + * @param ringSize the size this queue should maintain according to ring semantics */ @Deprecated @Operation(desc = "Update a queue", impact = MBeanOperationInfo.ACTION) @@ -1072,9 +1060,9 @@ String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String /** * Deploy a durable queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    + *

    * This method will do nothing if the queue with the given name already exists on the server. * * @param address address to bind the queue to @@ -1089,9 +1077,9 @@ void deployQueue(@Parameter(name = "address", desc = "Address of the queue") Str /** * Deploy a queue. - *
    + *

    * If {@code address} is {@code null} it will be defaulted to {@code name}. - *
    + *

    * This method will do nothing if the queue with the given name already exists on the server. * * @param address address to bind the queue to @@ -1153,9 +1141,9 @@ void destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy /** * List all the prepared transaction, sorted by date, oldest first. - *
    - * The Strings are Base-64 representation of the transaction XID and can be - * used to heuristically commit or rollback the transactions. + *

    + * The Strings are Base-64 representation of the transaction XID and can be used to heuristically commit or rollback + * the transactions. * * @see #commitPreparedTransaction(String) * @see #rollbackPreparedTransaction(String) @@ -1164,15 +1152,13 @@ void destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy String[] listPreparedTransactions() throws Exception; /** - * List all the prepared transaction, sorted by date, - * oldest first, with details, in text format. + * List all the prepared transaction, sorted by date, oldest first, with details, in text format. */ @Operation(desc = "List all the prepared transaction, sorted by date, oldest first, with details, in JSON format") String listPreparedTransactionDetailsAsJSON() throws Exception; /** - * List all the prepared transaction, sorted by date, - * oldest first, with details, in HTML format + * List all the prepared transaction, sorted by date, oldest first, with details, in HTML format */ @Deprecated @Operation(desc = "List all the prepared transaction, sorted by date, oldest first, with details, in HTML format") @@ -1278,8 +1264,8 @@ boolean closeConsumerWithID(@Parameter(desc = "The session ID", name = "sessionI String listProducersInfoAsJSON() throws Exception; /** - * Lists all the connections connected to this server. - * The returned String is a JSON string containing details about each connection, e.g.: + * Lists all the connections connected to this server. The returned String is a JSON string containing details about + * each connection, e.g.: *

         * [
         *   {
    @@ -1296,8 +1282,8 @@ boolean closeConsumerWithID(@Parameter(desc = "The session ID", name = "sessionI
        String listConnectionsAsJSON() throws Exception;
     
        /**
    -    * Lists all the consumers which belongs to the connection specified by the connectionID.
    -    * The returned String is a JSON string containing details about each consumer, e.g.:
    +    * Lists all the consumers which belongs to the connection specified by the connectionID. The returned String is a
    +    * JSON string containing details about each consumer, e.g.:
         * 
         * [
         *   {
    @@ -1317,8 +1303,8 @@ boolean closeConsumerWithID(@Parameter(desc = "The session ID", name = "sessionI
        String listConsumersAsJSON(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
     
        /**
    -    * Lists all the consumers connected to this server.
    -    * The returned String is a JSON string containing details about each consumer, e.g.:
    +    * Lists all the consumers connected to this server. The returned String is a JSON string containing details about
    +    * each consumer, e.g.:
         * 
         * [
         *   {
    @@ -1337,8 +1323,8 @@ boolean closeConsumerWithID(@Parameter(desc = "The session ID", name = "sessionI
        String listAllConsumersAsJSON() throws Exception;
     
        /**
    -    * Lists details about all the sessions for the specified connection ID.
    -    * The returned String is a JSON string containing details about each session associated with the specified ID, e.g.:
    +    * Lists details about all the sessions for the specified connection ID. The returned String is a JSON string
    +    * containing details about each session associated with the specified ID, e.g.:
         * 
         * [
         *   {
    @@ -1354,8 +1340,8 @@ boolean closeConsumerWithID(@Parameter(desc = "The session ID", name = "sessionI
        String listSessionsAsJSON(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
     
        /**
    -    * Lists details about all sessions.
    -    * The returned String is a JSON string containing details about each and every session, e.g.:
    +    * Lists details about all sessions. The returned String is a JSON string containing details about each and every
    +    * session, e.g.:
         * 
         * [
         *   {
    @@ -1691,7 +1677,7 @@ void addAddressSettings(@Parameter(desc = "an address match", name = "addressMat
        void removeAddressSettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
     
        /**
    -    * returns the address settings as a JSON string
    +    * {@return the address settings as a JSON string}
         */
        @Operation(desc = "Returns the address settings as a JSON string for an address match", impact = MBeanOperationInfo.INFO)
        String getAddressSettingsAsJSON(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
    @@ -1700,8 +1686,7 @@ void addAddressSettings(@Parameter(desc = "an address match", name = "addressMat
        String[] getDivertNames();
     
        /**
    -    * Jon plugin doesn't recognize an Operation whose name is in
    -    * form getXXXX(), so add this one.
    +    * Jon plugin doesn't recognize an Operation whose name is in form getXXXX(), so add this one.
         */
        @Operation(desc = "names of the diverts deployed on this server", impact = MBeanOperationInfo.INFO)
        default String[] listDivertNames() {
    @@ -1981,24 +1966,19 @@ String listQueues(@Parameter(name = "options", desc = "Options") String options,
                          @Parameter(name = "pageSize", desc = "Page Size") int pageSize) throws Exception;
     
        /**
    -    * Returns the names of the queues created on this server with the given routing-type.
    +    * {@return the names of the queues created on this server with the given routing-type.}
         */
        @Operation(desc = "Names of the queues created on this server with the given routing-type (i.e. ANYCAST or MULTICAST)", impact = MBeanOperationInfo.INFO)
        String[] getQueueNames(@Parameter(name = "routingType", desc = "The routing type, MULTICAST or ANYCAST") String routingType) throws Exception;
     
        /**
    -    * Returns the names of the cluster-connections deployed on this server.
    +    * {@return the names of the cluster-connections deployed on this server.}
         */
        @Operation(desc = "Names of the cluster-connections deployed on this server", impact = MBeanOperationInfo.INFO)
        String[] getClusterConnectionNames();
     
        /**
         * Add a user (only applicable when using the JAAS PropertiesLoginModule or the ActiveMQBasicSecurityManager)
    -    *
    -    * @param username
    -    * @param password
    -    * @param roles
    -    * @throws Exception
         */
        @Operation(desc = "add a user (only applicable when using the JAAS PropertiesLoginModule or the ActiveMQBasicSecurityManager)", impact = MBeanOperationInfo.ACTION)
        void addUser(@Parameter(name = "username", desc = "Name of the user") String username,
    @@ -2007,46 +1987,33 @@ void addUser(@Parameter(name = "username", desc = "Name of the user") String use
                     @Parameter(name = "plaintext", desc = "whether or not to store the password in plaintext or hash it") boolean plaintext) throws Exception;
     
        /**
    -    * List the information about a user or all users if no username is supplied (only applicable when using the JAAS PropertiesLoginModule or the ActiveMQBasicSecurityManager).
    +    * List the information about a user or all users if no username is supplied (only applicable when using the JAAS
    +    * PropertiesLoginModule or the ActiveMQBasicSecurityManager).
         *
    -    * @param username
         * @return JSON array of user and role information
    -    * @throws Exception
         */
        @Operation(desc = "list info about a user or all users if no username is supplied (only applicable when using the JAAS PropertiesLoginModule or the ActiveMQBasicSecurityManager)", impact = MBeanOperationInfo.ACTION)
        String listUser(@Parameter(name = "username", desc = "Name of the user; leave null to list all known users") String username) throws Exception;
     
        /**
         * Remove a user (only applicable when using the JAAS PropertiesLoginModule or the ActiveMQBasicSecurityManager).
    -    *
    -    * @param username
    -    * @throws Exception
         */
        @Operation(desc = "remove a user (only applicable when using the JAAS PropertiesLoginModule or the ActiveMQBasicSecurityManager)", impact = MBeanOperationInfo.ACTION)
        void removeUser(@Parameter(name = "username", desc = "Name of the user") String username) throws Exception;
     
        /**
    -    * Set new properties on an existing user (only applicable when using the JAAS PropertiesLoginModule or the ActiveMQBasicSecurityManager).
    -    *
    -    * @param username
    -    * @param password
    -    * @param roles
    -    * @throws Exception
    +    * Set new properties on an existing user (only applicable when using the JAAS PropertiesLoginModule or the
    +    * ActiveMQBasicSecurityManager).
         */
        @Operation(desc = "set new properties on an existing user (only applicable when using the JAAS PropertiesLoginModule or the ActiveMQBasicSecurityManager)", impact = MBeanOperationInfo.ACTION)
        void resetUser(@Parameter(name = "username", desc = "Name of the user") String username,
                       @Parameter(name = "password", desc = "User's password") String password,
                       @Parameter(name = "roles", desc = "User's role (comma separated)") String roles) throws Exception;
    +
        /**
    -    * Set new properties on an existing user (only applicable when using the JAAS PropertiesLoginModule or the ActiveMQBasicSecurityManager).
    -    *
    -    * @param username
    -    * @param password
    -    * @param roles
    -    * @param plaintext
    -    * @throws Exception
    +    * Set new properties on an existing user (only applicable when using the JAAS PropertiesLoginModule or the
    +    * ActiveMQBasicSecurityManager).
         */
    -
        @Operation(desc = "set new properties on an existing user (only applicable when using the JAAS PropertiesLoginModule or the ActiveMQBasicSecurityManager)", impact = MBeanOperationInfo.ACTION)
        void resetUser(@Parameter(name = "username", desc = "Name of the user") String username,
                       @Parameter(name = "password", desc = "User's password") String password,
    @@ -2058,10 +2025,6 @@ void resetUser(@Parameter(name = "username", desc = "Name of the user") String u
     
        /**
         * Replays messages from all files in the retention folder that match an address and filter.
    -    * @param address
    -    * @param target
    -    * @param filter
    -    * @throws Exception
         */
        @Operation(desc = "Replays messages from all files in the retention folder that match an address and filter.", impact = MBeanOperationInfo.ACTION)
        void replay(@Parameter(name = "address", desc = "Name of the address to replay") String address,
    @@ -2070,12 +2033,6 @@ void replay(@Parameter(name = "address", desc = "Name of the address to replay")
     
        /**
         * Replays messages from a configurable subset of the files in the retention folder that match an address and filter.
    -    * @param startScan
    -    * @param endScan
    -    * @param address
    -    * @param target
    -    * @param filter
    -    * @throws Exception
         */
        @Operation(desc = "Replays messages from a configurable subset of the files in the retention folder that match an address and filter.", impact = MBeanOperationInfo.ACTION)
        void replay(@Parameter(name = "startScanDate", desc = "Start date where we will start scanning for journals to replay. Format YYYYMMDDHHMMSS") String startScan,
    diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/AddressControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/AddressControl.java
    index cabb21291aa..ee8f407187c 100644
    --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/AddressControl.java
    +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/AddressControl.java
    @@ -30,54 +30,66 @@ public interface AddressControl {
        String LIMIT_PERCENT_DESCRIPTION = "the % of memory limit (global or local) that is in use by this address";
     
        /**
    -    * Returns the managed address.
    +    * {@return the managed address}
         */
        @Attribute(desc = "managed address")
        String getAddress();
     
    -   /*
    -   * Whether multicast routing is enabled for this address
    -   * */
    +   /**
    +    * {@return whether multicast routing is enabled for this address}
    +    */
        @Attribute(desc = "Get the routing types enabled on this address")
        String[] getRoutingTypes();
     
    -   /*
    -   * Whether multicast routing is enabled for this address
    -   * */
    +   /**
    +    * {@return the routing types enabled on this address as JSON}
    +    */
        @Attribute(desc = "Get the routing types enabled on this address as JSON")
        String getRoutingTypesAsJSON() throws Exception;
     
        /**
    -    * Returns the roles (name and permissions) associated with this address.
    +    * {@return the roles (name and permissions) associated with this address}
         */
        @Attribute(desc = "roles (name and permissions) associated with this address")
        Object[] getRoles() throws Exception;
     
        /**
    -    * Returns the roles  (name and permissions) associated with this address
    -    * using JSON serialization.
    -    * 
    - * Java objects can be recreated from JSON serialization using {@link RoleInfo#from(String)}. + * {@return the roles (name and permissions) associated with this address using JSON serialization. + *

    + * Java objects can be recreated from JSON serialization using {@link RoleInfo#from(String)}}. */ @Attribute(desc = "roles (name and permissions) associated with this address using JSON serialization") String getRolesAsJSON() throws Exception; /** - * Returns the number of estimated bytes being used by all the queue(s) bound to this address; used to control paging and blocking. + * {@return the number of estimated bytes being used by all the queue(s) bound to this address; used to control + * paging and blocking} */ @Attribute(desc = ADDRESS_SIZE_DESCRIPTION) long getAddressSize(); + /** + * {@return the maximum number of bytes that can be read into memory from paged files} + */ @Attribute(desc = "The maximum number of bytes that can be read into memory from paged files") int getMaxPageReadBytes(); + /** + * {@return the maximum number of messages that can be read into memory from paged files} + */ @Attribute(desc = "The maximum number of messages that can be read into memory from paged files") int getMaxPageReadMessages(); + /** + * {@return the number of bytes to prefetch from storage into memory before reching maxReadBytes} + */ @Attribute(desc = "The number of bytes to prefetch from storage into memory before reching maxReadBytes") int getPrefetchPageBytes(); + /** + * {@return the number of messages prefetch from storage into memory before reching maxReadBytes} + */ @Attribute(desc = "The number of messages prefetch from storage into memory before reching maxReadBytes") int getPrefetchPageMessages(); @@ -85,54 +97,52 @@ public interface AddressControl { void schedulePageCleanup() throws Exception; /** - * Returns the sum of messages on queue(s), including messages in delivery. + * {@return the sum of messages on queue(s), including messages in delivery} */ @Deprecated @Attribute(desc = "the sum of messages on queue(s), including messages in delivery; DEPRECATED: use getMessageCount() instead") long getNumberOfMessages(); /** - * Returns the names of the remote queue(s) bound to this address. + * {@return the names of the remote queue(s) bound to this address} */ @Attribute(desc = "names of the remote queue(s) bound to this address") String[] getRemoteQueueNames(); /** - * Returns the names of the local queue(s) bound to this address. + * {@return the names of the local queue(s) bound to this address} */ @Attribute(desc = "names of the local queue(s) bound to this address") String[] getQueueNames(); /** - * Returns the names of both the local and remote queue(s) bound to this address. + * {@return the names of both the local and remote queue(s) bound to this address} */ @Attribute(desc = "names of both the local & remote queue(s) bound to this address") String[] getAllQueueNames(); /** - * Returns the number of pages used by this address. + * {@return the number of pages used by this address} */ @Attribute(desc = NUMBER_OF_PAGES_DESCRIPTION) long getNumberOfPages(); /** - * Returns whether this address is paging. - * - * @throws Exception + * {@return whether this address is paging} */ @Attribute(desc = "whether this address is paging") boolean isPaging() throws Exception; /** - * Returns the % of memory limit that is currently in use + * {@return the % of memory limit that is currently in use} */ @Attribute(desc = LIMIT_PERCENT_DESCRIPTION) int getAddressLimitPercent(); /** * Blocks message production to this address by limiting credit - * @return true if production is blocked - * @throws Exception + * + * @return {@code true} if production is blocked */ @Operation(desc = "Stops message production to this address, typically with flow control.", impact = MBeanOperationInfo.ACTION) boolean block() throws Exception; @@ -141,13 +151,13 @@ public interface AddressControl { void unblock() throws Exception; /** - * Returns the number of bytes used by each page for this address. + * {@return the number of bytes used by each page for this address} */ @Attribute(desc = "number of bytes used by each page for this address") long getNumberOfBytesPerPage() throws Exception; /** - * Returns the names of all bindings (both queues and diverts) bound to this address + * {@return the names of all bindings (both queues and diverts) bound to this address} */ @Attribute(desc = "names of all bindings (both queues and diverts) bound to this address") String[] getBindingNames() throws Exception; @@ -156,26 +166,22 @@ public interface AddressControl { long getMessageCount(); /** - * Returns the number of messages routed to one or more bindings + * {@return the number of messages routed to one or more bindings} */ @Attribute(desc = ROUTED_MESSAGE_COUNT_DESCRIPTION) long getRoutedMessageCount(); /** - * Returns the number of messages not routed to any bindings + * {@return the number of messages not routed to any bindings} */ @Attribute(desc = UNROUTED_MESSAGE_COUNT_DESCRIPTION) long getUnRoutedMessageCount(); - /** - * @param headers the message headers and properties to set. Can only - * container Strings maped to primitive types. - * @param body the text to send - * @param durable - * @param user - * @param password @return - * @throws Exception + * Sends a TextMessage to a password-protected address. + * + * @param headers the message headers and properties to set. Can only container Strings maped to primitive types. + * @param body the text to send */ @Operation(desc = "Sends a TextMessage to a password-protected address.", impact = MBeanOperationInfo.ACTION) String sendMessage(@Parameter(name = "headers", desc = "The headers to add to the message") Map headers, @@ -186,14 +192,12 @@ String sendMessage(@Parameter(name = "headers", desc = "The headers to add to th @Parameter(name = "password", desc = "The users password to authenticate with") String password) throws Exception; /** - * @param headers the message headers and properties to set. Can only - * container Strings maped to primitive types. - * @param body the text to send - * @param durable - * @param user - * @param password @return - * @param createMessageId whether or not to auto generate a Message ID - * @throws Exception + * Sends a TextMessage to a password-protected address. + * + * @param headers the message headers and properties to set. Can only container Strings maped to primitive + * types. + * @param body the text to send + * @param createMessageId whether to auto generate a Message ID */ @Operation(desc = "Sends a TextMessage to a password-protected address.", impact = MBeanOperationInfo.ACTION) String sendMessage(@Parameter(name = "headers", desc = "The headers to add to the message") Map headers, @@ -204,26 +208,24 @@ String sendMessage(@Parameter(name = "headers", desc = "The headers to add to th @Parameter(name = "password", desc = "The users password to authenticate with") String password, @Parameter(name = "createMessageId", desc = "whether or not to auto generate a Message ID") boolean createMessageId) throws Exception; - /** - * Pauses all the queues bound to this address. Messages are no longer delivered to all its bounded queues. - * Newly added queue will be paused too until resume is called. - * @throws java.lang.Exception + * Pauses all the queues bound to this address. Messages are no longer delivered to all its bounded queues. Newly + * added queue will be paused too until resume is called. */ @Operation(desc = "Pauses the queues bound to this address", impact = MBeanOperationInfo.ACTION) void pause() throws Exception; /** - * Pauses all the queues bound to this address. Messages are no longer delivered to all its bounded queues. Newly added queue will be paused too until resume is called. - * @param persist if true, the pause state will be persisted. - * @throws java.lang.Exception + * Pauses all the queues bound to this address. Messages are no longer delivered to all its bounded queues. Newly + * added queue will be paused too until resume is called. + * + * @param persist if {@code true}, the pause state will be persisted. */ @Operation(desc = "Pauses the queues bound to this address", impact = MBeanOperationInfo.ACTION) void pause(@Parameter(name = "persist", desc = "if true, the pause state will be persisted.") boolean persist) throws Exception; /** * Resume all the queues bound of this address. Messages are delivered again to all its bounded queues. - * @throws java.lang.Exception */ @Operation(desc = "Resumes the queues bound to this address", impact = MBeanOperationInfo.ACTION) void resume() throws Exception; @@ -241,26 +243,25 @@ String sendMessage(@Parameter(name = "headers", desc = "The headers to add to th boolean clearDuplicateIdCache() throws Exception; /** - * Returns whether this address was created automatically in response to client action. + * {@return whether this address was created automatically in response to client action} */ @Attribute(desc = "whether this address was created automatically in response to client action") boolean isAutoCreated(); /** - * Returns whether this address was created for the broker's internal use. + * {@return whether this address was created for the broker's internal use} */ @Attribute(desc = "whether this address was created for the broker's internal use") boolean isInternal(); /** - * Returns whether this address is temporary. + * {@return whether this address is temporary} */ @Attribute(desc = "whether this address is temporary") boolean isTemporary(); /** * Purge all the queues bound of this address. Returns the total number of messages purged. - * @throws java.lang.Exception */ @Operation(desc = "Purges the queues bound to this address. Returns the total number of messages purged.", impact = MBeanOperationInfo.ACTION) long purge() throws Exception; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Attribute.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Attribute.java index 824b2f72b42..7cf7bd5f067 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Attribute.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Attribute.java @@ -24,8 +24,7 @@ /** * Info for a MBean Attribute. *

    - * This annotation is used only for attributes which can be seen - * through a GUI. + * This annotation is used only for attributes which can be seen through a GUI. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BaseBroadcastGroupControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BaseBroadcastGroupControl.java index c87d075166b..73b0eaa5d76 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BaseBroadcastGroupControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BaseBroadcastGroupControl.java @@ -22,25 +22,25 @@ public interface BaseBroadcastGroupControl extends ActiveMQComponentControl { /** - * Returns the configuration name of this broadcast group. + * {@return the configuration name of this broadcast group} */ @Attribute(desc = "name of this broadcast group") String getName(); /** - * Returns the period used by this broadcast group. + * {@return the period used by this broadcast group} */ @Attribute(desc = "period used by this broadcast group") long getBroadcastPeriod(); /** - * Returns the pairs of live-backup connectors that are broadcasted by this broadcast group. + * {@return the pairs of live-backup connectors that are broadcasted by this broadcast group} */ @Attribute(desc = "pairs of live-backup connectors that are broadcasted by this broadcast group") Object[] getConnectorPairs(); /** - * Returns the pairs of live-backup connectors that are broadcasted by this broadcast group + * {@return the pairs of live-backup connectors that are broadcasted by this broadcast group} * using JSON serialization. */ @Attribute(desc = "pairs of live-backup connectors that are broadcasted by this broadcast group using JSON serialization") diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BridgeControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BridgeControl.java index cbe741c9a3f..e056f040d48 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BridgeControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BridgeControl.java @@ -24,119 +24,118 @@ public interface BridgeControl extends ActiveMQComponentControl { /** - * Returns the name of this bridge + * {@return the name of this bridge} */ @Attribute(desc = "name of this bridge") String getName(); /** - * Returns the name of the queue this bridge is consuming messages from. + * {@return the name of the queue this bridge is consuming messages from} */ @Attribute(desc = "name of the queue this bridge is consuming messages from") String getQueueName(); /** - * Returns the address this bridge will forward messages to. + * {@return the address this bridge will forward messages to} */ @Attribute(desc = "address this bridge will forward messages to") String getForwardingAddress(); /** - * Returns the filter string associated with this bridge. + * {@return the filter string associated with this bridge} */ @Attribute(desc = "filter string associated with this bridge") String getFilterString(); /** - * Return the name of the org.apache.activemq.artemis.core.server.cluster.Transformer implementation associated with this bridge. + * {@return the name of the org.apache.activemq.artemis.core.server.cluster.Transformer implementation associated + * with this bridge} */ @Attribute(desc = "name of the org.apache.activemq.artemis.core.server.cluster.Transformer implementation associated with this bridge") String getTransformerClassName(); /** - * Returns a map of the properties configured for the transformer. + * {@return a map of the properties configured for the transformer} */ @Attribute(desc = "map of key, value pairs used to configure the transformer in JSON form") String getTransformerPropertiesAsJSON() throws Exception; /** - * Returns a map of the properties configured for the transformer. + * {@return a map of the properties configured for the transformer} */ @Attribute(desc = "map of key, value pairs used to configure the transformer") Map getTransformerProperties() throws Exception; /** - * Returns any list of static connectors used by this bridge + * {@return any list of static connectors used by this bridge} */ @Attribute(desc = "list of static connectors used by this bridge") String[] getStaticConnectors() throws Exception; /** - * Returns the name of the discovery group used by this bridge. + * {@return the name of the discovery group used by this bridge} */ @Attribute(desc = "name of the discovery group used by this bridge") String getDiscoveryGroupName(); /** - * Returns the retry interval used by this bridge. + * {@return the retry interval used by this bridge} */ @Attribute(desc = "retry interval used by this bridge") long getRetryInterval(); /** - * Returns the retry interval multiplier used by this bridge. + * {@return the retry interval multiplier used by this bridge} */ @Attribute(desc = "retry interval multiplier used by this bridge") double getRetryIntervalMultiplier(); /** - * Returns the max retry interval used by this bridge. + * {@return the max retry interval used by this bridge} */ @Attribute(desc = "max retry interval used by this bridge") long getMaxRetryInterval(); /** - * Returns the number of reconnection attempts used by this bridge. + * {@return the number of reconnection attempts used by this bridge} */ @Attribute(desc = "number of reconnection attempts used by this bridge") int getReconnectAttempts(); /** - * Returns whether this bridge is using duplicate detection. + * {@return whether this bridge is using duplicate detection} */ @Attribute(desc = "whether this bridge is using duplicate detection") boolean isUseDuplicateDetection(); /** - * Returns whether this bridge is using high availability + * {@return whether this bridge is using high availability} */ @Attribute(desc = "whether this bridge is using high availability") boolean isHA(); /** - * The messagesPendingAcknowledgement counter is incremented when the bridge is has forwarded a message but - * is waiting acknowledgement from the other broker. This is a cumulative total and the number of outstanding - * pending messages can be computed by subtracting messagesAcknowledged from messagesPendingAcknowledgement. - * + * The messagesPendingAcknowledgement counter is incremented when the bridge is has forwarded a message but is + * waiting acknowledgement from the other broker. This is a cumulative total and the number of outstanding pending + * messages can be computed by subtracting messagesAcknowledged from messagesPendingAcknowledgement. */ @Attribute(desc = "The messagesPendingAcknowledgement counter is incremented when the bridge is has forwarded a message but is waiting acknowledgement from the remote broker.") long getMessagesPendingAcknowledgement(); /** - * The messagesAcknowledged counter is the number of messages actually received by the remote broker. - * This is a cumulative total and the number of outstanding pending messages can be computed by subtracting + * The messagesAcknowledged counter is the number of messages actually received by the remote broker. This is a + * cumulative total and the number of outstanding pending messages can be computed by subtracting * messagesAcknowledged from messagesPendingAcknowledgement. - * */ @Attribute(desc = "The messagesAcknowledged counter is the number of messages actually received by the remote broker.") long getMessagesAcknowledged(); /** * The bridge metrics for this bridge - * - * The messagesPendingAcknowledgement counter is incremented when the bridge is has forwarded a message but is waiting acknowledgement from the other broker. - * The messagesAcknowledged counter is the number of messages actually received by the remote broker. - * + *

    + * The messagesPendingAcknowledgement counter is incremented when the bridge is has forwarded a message but is + * waiting acknowledgement from the other broker. The messagesAcknowledged counter is the number of messages actually + * received by the remote broker. */ @Attribute(desc = "The metrics for this bridge. The messagesPendingAcknowledgement counter is incremented when the bridge is has forwarded a message but is waiting acknowledgement from the remote broker. The messagesAcknowledged counter is the number of messages actually received by the remote broker.") Map getMetrics(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BroadcastGroupControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BroadcastGroupControl.java index efc8e493b64..4debfcbbfec 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BroadcastGroupControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BroadcastGroupControl.java @@ -22,19 +22,19 @@ public interface BroadcastGroupControl extends BaseBroadcastGroupControl { /** - * Returns the local port this broadcast group is bound to. + * {@return the local port this broadcast group is bound to} */ @Attribute(desc = "local port this broadcast group is bound to") int getLocalBindPort() throws Exception; /** - * Returns the address this broadcast group is broadcasting to. + * {@return the address this broadcast group is broadcasting to} */ @Attribute(desc = "address this broadcast group is broadcasting to") String getGroupAddress() throws Exception; /** - * Returns the port this broadcast group is broadcasting to. + * {@return the port this broadcast group is broadcasting to} */ @Attribute(desc = "port this broadcast group is broadcasting to") int getGroupPort() throws Exception; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BrokerConnectionControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BrokerConnectionControl.java index a71ddfbb024..7030e0d43dc 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BrokerConnectionControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/BrokerConnectionControl.java @@ -22,43 +22,43 @@ public interface BrokerConnectionControl extends ActiveMQComponentControl { /** - * Returns if this broker connection is currently connected to the remote. + * {@return if this broker connection is currently connected to the remote} */ @Attribute(desc = "whether this broker connection is currently connected to the remote") boolean isConnected(); /** - * Returns the name of this broker connection + * {@return the name of this broker connection} */ @Attribute(desc = "name of this broker connection") String getName(); /** - * Returns the connection URI for this broker connection. + * {@return the connection URI for this broker connection} */ @Attribute(desc = "connection URI for this broker connection") String getUri(); /** - * Returns the user this broker connection is using. + * {@return the user this broker connection is using} */ @Attribute(desc = "the user this broker connection is using") String getUser(); /** - * Returns the wire protocol this broker connection is using. + * {@return the wire protocol this broker connection is using} */ @Attribute(desc = "the wire protocol this broker connection is using") String getProtocol(); /** - * Returns the retry interval configured for this broker connection. + * {@return the retry interval configured for this broker connection} */ @Attribute(desc = "Configured retry interval of this broker connection") long getRetryInterval(); /** - * Returns the number of reconnection attempts configured for this broker connection. + * {@return the number of reconnection attempts configured for this broker connection} */ @Attribute(desc = "Configured number of reconnection attempts of this broker connection") int getReconnectAttempts(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ClusterConnectionControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ClusterConnectionControl.java index 50bcc37ec13..26f35e4f456 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ClusterConnectionControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ClusterConnectionControl.java @@ -24,122 +24,116 @@ public interface ClusterConnectionControl extends ActiveMQComponentControl { /** - * Returns the configuration name of this cluster connection. + * {@return the configuration name of this cluster connection} */ @Attribute(desc = "name of this cluster connection") String getName(); /** - * Returns the address used by this cluster connection. + * {@return the address used by this cluster connection} */ @Attribute(desc = "address used by this cluster connection") String getAddress(); /** - * Returns the node ID used by this cluster connection. + * {@return the node ID used by this cluster connection} */ @Attribute(desc = "node ID used by this cluster connection") String getNodeID(); /** - * Return whether this cluster connection use duplicate detection. + * {@return whether this cluster connection use duplicate detection} */ @Attribute(desc = "whether this cluster connection use duplicate detection") boolean isDuplicateDetection(); /** - * Return the type of message load balancing strategy this bridge will use. + * {@return the type of message load balancing strategy this bridge will use} */ @Attribute(desc = "type of message load balancing strategy this bridge will use") String getMessageLoadBalancingType(); /** - * Return the Topology that this Cluster Connection knows about + * {@return the Topology that this Cluster Connection knows about} */ @Attribute(desc = "Topology that this Cluster Connection knows about") String getTopology(); /** - * Returns the maximum number of hops used by this cluster connection. + * {@return the maximum number of hops used by this cluster connection} */ @Attribute(desc = "maximum number of hops used by this cluster connection") int getMaxHops(); /** - * Returns the list of static connectors + * {@return the list of static connectors} */ @Attribute(desc = "list of static connectors") Object[] getStaticConnectors(); /** - * Returns the list of static connectors as JSON + * {@return the list of static connectors as JSON} */ @Attribute(desc = "list of static connectors as JSON") String getStaticConnectorsAsJSON() throws Exception; /** - * Returns the name of the discovery group used by this cluster connection. + * {@return the name of the discovery group used by this cluster connection} */ @Attribute(desc = "name of the discovery group used by this cluster connection") String getDiscoveryGroupName(); /** - * Returns the connection retry interval used by this cluster connection. + * {@return the connection retry interval used by this cluster connection} */ @Attribute(desc = "connection retry interval used by this cluster connection") long getRetryInterval(); /** - * Returns a map of the nodes connected to this cluster connection. - *
    - * keys are node IDs, values are the addresses used to connect to the nodes. + * {@return a map of the nodes connected to this cluster connection; keys are node IDs, values are the addresses used + * to connect to the nodes} */ @Attribute(desc = "map of the nodes connected to this cluster connection (keys are node IDs, values are the addresses used to connect to the nodes)") Map getNodes() throws Exception; /** - * The messagesPendingAcknowledgement counter is incremented when any bridge in the cluster connection has - * forwarded a message and is waiting acknowledgement from the other broker. (aggregate over all bridges) - * - * This is a cumulative total and the number of outstanding pending messages for the cluster connection - * can be computed by subtracting messagesAcknowledged from messagesPendingAcknowledgement. - * + * The messagesPendingAcknowledgement counter is incremented when any bridge in the cluster connection has forwarded + * a message and is waiting acknowledgement from the other broker. (aggregate over all bridges) + *

    + * This is a cumulative total and the number of outstanding pending messages for the cluster connection can be + * computed by subtracting messagesAcknowledged from messagesPendingAcknowledgement. */ @Attribute(desc = "The messagesPendingAcknowledgement counter is incremented when any bridge in the cluster connection has forwarded a message and is waiting acknowledgement from the other broker. (aggregate over all bridges)") long getMessagesPendingAcknowledgement(); /** - * The messagesAcknowledged counter is the number of messages actually received by a remote broker for all - * bridges in this cluster connection - * - * This is a cumulative total and the number of outstanding pending messages for the cluster connection - * can be computed by subtracting messagesAcknowledged from messagesPendingAcknowledgement. - * + * The messagesAcknowledged counter is the number of messages actually received by a remote broker for all bridges in + * this cluster connection + *

    + * This is a cumulative total and the number of outstanding pending messages for the cluster connection can be + * computed by subtracting messagesAcknowledged from messagesPendingAcknowledgement. */ @Attribute(desc = "The messagesAcknowledged counter is the number of messages actually received by a remote broker for all bridges in this cluster connection") long getMessagesAcknowledged(); /** * The current metrics for this cluster connection (aggregate over all bridges to other nodes) - * - * The messagesPendingAcknowledgement counter is incremented when any bridge in the cluster connection has - * forwarded a message and is waiting acknowledgement from the other broker. - * - * The messagesAcknowledged counter is the number of messages actually received by a remote broker for all - * bridges in this cluster connection - * - * @return + *

    + * The messagesPendingAcknowledgement counter is incremented when any bridge in the cluster connection has forwarded + * a message and is waiting acknowledgement from the other broker. + *

    + * The messagesAcknowledged counter is the number of messages actually received by a remote broker for all bridges in + * this cluster connection */ @Attribute(desc = "The metrics for this cluster connection. The messagesPendingAcknowledgement counter is incremented when any bridge in the cluster connection has forwarded a message and is waiting acknowledgement from the other broker. The messagesAcknowledged counter is the number of messages actually received by a remote broker for all bridges in this cluster connection") Map getMetrics(); /** * The bridge metrics for the given node in the cluster connection - * - * The messagesPendingAcknowledgement counter is incremented when the bridge is has forwarded a message but is waiting acknowledgement from the other broker. - * The messagesAcknowledged counter is the number of messages actually received by the remote broker for this bridge. - * - * @throws Exception + *

    + * The messagesPendingAcknowledgement counter is incremented when the bridge is has forwarded a message but is + * waiting acknowledgement from the other broker. The messagesAcknowledged counter is the number of messages actually + * received by the remote broker for this bridge. */ @Operation(desc = "The metrics for the bridge by nodeId. The messagesPendingAcknowledgement counter is incremented when the bridge is has forwarded a message but is waiting acknowledgement from the other broker. The messagesAcknowledged counter is the number of messages actually received by the remote broker for this bridge.") Map getBridgeMetrics(@Parameter(name = "nodeId", desc = "The target node ID") String nodeId) throws Exception; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DayCounterInfo.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DayCounterInfo.java index 36885ea836d..6db13fe2fb6 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DayCounterInfo.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DayCounterInfo.java @@ -25,8 +25,8 @@ import org.apache.activemq.artemis.utils.JsonLoader; /** - * Helper class to create Java Objects from the - * JSON serialization returned by {@link QueueControl#listMessageCounterHistory()}. + * Helper class to create Java Objects from the JSON serialization returned by + * {@link QueueControl#listMessageCounterHistory()}. */ public final class DayCounterInfo { @@ -51,8 +51,8 @@ public static String toJSON(final DayCounterInfo[] infos) { } /** - * Returns an array of RoleInfo corresponding to the JSON serialization returned - * by {@link QueueControl#listMessageCounterHistory()}. + * {@return an array of RoleInfo corresponding to the JSON serialization returned by {@link + * QueueControl#listMessageCounterHistory()}} */ public static DayCounterInfo[] fromJSON(final String jsonString) { JsonObject json = JsonUtil.readJsonObject(jsonString); @@ -78,16 +78,13 @@ public DayCounterInfo(final String date, final long[] counters) { this.counters = counters; } - /** - * Returns the date of the counter. - */ public String getDate() { return date; } /** - * Returns a 24-length array corresponding to the number of messages added to the queue - * for the given hour of the day. + * {@return a 24-length array corresponding to the number of messages added to the queue + * for the given hour of the day} */ public long[] getCounters() { return counters; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DivertControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DivertControl.java index fb15fe1c419..16c2e95755f 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DivertControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/DivertControl.java @@ -24,64 +24,63 @@ public interface DivertControl { /** - * Returns the filter used by this divert. + * {@return the filter used by this divert} */ @Attribute(desc = "filter used by this divert") String getFilter(); /** - * Returns whether this divert is exclusive. - *
    - * if {@code true} messages will be exclusively diverted and will not be routed to the origin address, - * else messages will be routed both to the origin address and the forwarding address. + * {@return {@code true} if messages will be exclusively diverted and will not be routed to the origin address; + * otherwise {@code false} if messages will be routed both to the origin address and the forwarding address} */ @Attribute(desc = "whether this divert is exclusive") boolean isExclusive(); /** - * Returns the cluster-wide unique name of this divert. + * {@return the cluster-wide unique name of this divert} */ @Attribute(desc = "cluster-wide unique name of this divert") String getUniqueName(); /** - * Returns the routing name of this divert. + * {@return the routing name of this divert} */ @Attribute(desc = "routing name of this divert") String getRoutingName(); /** - * Returns the origin address used by this divert. + * {@return the origin address used by this divert} */ @Attribute(desc = "origin address used by this divert") String getAddress(); /** - * Returns the forwarding address used by this divert. + * {@return the forwarding address used by this divert} */ @Attribute(desc = "forwarding address used by this divert") String getForwardingAddress(); /** - * Return the name of the org.apache.activemq.artemis.core.server.cluster.Transformer implementation associated with this divert. + * {@return the name of the {@code org.apache.activemq.artemis.core.server.transformer.Transformer} implementation + * associated with this divert} */ - @Attribute(desc = "name of the org.apache.activemq.artemis.core.server.cluster.Transformer implementation associated with this divert") + @Attribute(desc = "name of the org.apache.activemq.artemis.core.server.transformer.Transformer implementation associated with this divert") String getTransformerClassName(); /** - * Returns a map of the properties configured for the transformer. + * {@return a map of key/value pairs used to configure the transformer in JSON form} */ - @Attribute(desc = "map of key, value pairs used to configure the transformer in JSON form") + @Attribute(desc = "map of key/value pairs used to configure the transformer in JSON form") String getTransformerPropertiesAsJSON(); /** - * Returns a map of the properties configured for the transformer. + * {@return a map of the key/value pairs used to configure the transformer} */ - @Attribute(desc = "map of key, value pairs used to configure the transformer") + @Attribute(desc = "map of key/value pairs used to configure the transformer") Map getTransformerProperties() throws Exception; /** - * Returns the routing type used by this divert. + * {@return the routing type used by this divert} */ @Attribute(desc = "routing type used by this divert") String getRoutingType(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/JGroupsChannelBroadcastGroupControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/JGroupsChannelBroadcastGroupControl.java index b3a8b0fe32d..22ff2acb3c8 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/JGroupsChannelBroadcastGroupControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/JGroupsChannelBroadcastGroupControl.java @@ -22,7 +22,7 @@ public interface JGroupsChannelBroadcastGroupControl extends BaseBroadcastGroupControl { /** - * Returns the JGroups channel name + * {@return the JGroups channel name} */ @Attribute(desc = "Returns the JGroups channel name") String getChannelName() throws Exception; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/JGroupsFileBroadcastGroupControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/JGroupsFileBroadcastGroupControl.java index 7f39a829e44..cad49557d6d 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/JGroupsFileBroadcastGroupControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/JGroupsFileBroadcastGroupControl.java @@ -22,19 +22,19 @@ public interface JGroupsFileBroadcastGroupControl extends BaseBroadcastGroupControl { /** - * Returns jgroups channel name + * {@return jgroups channel name} */ @Attribute(desc = "Returns jgroups channel name") String getChannelName(); /** - * Returns the jgroups file name + * {@return the jgroups file name} */ @Attribute(desc = "Returns the jgroups file name") String getFile(); /** - * Returns the contents of the jgroups file + * {@return the contents of the jgroups file} */ @Attribute(desc = "Returns the contents of the jgroups file") String getFileContents() throws Exception; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ManagementHelper.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ManagementHelper.java index 8892a630f0c..bf633d25926 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ManagementHelper.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ManagementHelper.java @@ -112,7 +112,9 @@ public static void doManagement(ServerLocator locator, String user, String passw } } - /** Utility function to reuse a ClientSessionConnection and perform a single management operation via core. */ + /** + * Utility function to reuse a ClientSessionConnection and perform a single management operation via core. + */ public static void doManagement(ClientSession session, MessageAcceptor setup, MessageAcceptor ok, MessageAcceptor failed) throws Exception { session.start(); ClientRequestor requestor = new ClientRequestor(session, "activemq.management"); @@ -147,7 +149,8 @@ public static void putAttribute(final ICoreMessage message, final String resourc } /** - * Stores an operation invocation in a message to invoke the corresponding operation the value from the server resource. + * Stores an operation invocation in a message to invoke the corresponding operation the value from the server + * resource. * * @param message message * @param resourceName the name of the resource @@ -161,7 +164,8 @@ public static void putOperationInvocation(final ICoreMessage message, } /** - * Stores an operation invocation in a message to invoke the corresponding operation the value from the server resource. + * Stores an operation invocation in a message to invoke the corresponding operation the value from the server + * resource. * * @param message message * @param resourceName the name of the server resource @@ -209,14 +213,14 @@ public static Object[] retrieveOperationParameters(final Message message) throws } /** - * Returns whether the JMS message corresponds to the result of a management operation invocation. + * {@return whether the JMS message corresponds to the result of a management operation invocation} */ public static boolean isOperationResult(final Message message) { return message.containsProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED); } /** - * Returns whether the JMS message corresponds to the result of a management attribute value. + * {@return whether the JMS message corresponds to the result of a management attribute value} */ public static boolean isAttributesResult(final Message message) { return !ManagementHelper.isOperationResult(message); @@ -242,10 +246,9 @@ public static void storeResult(final CoreMessage message, final Object result) t } /** - * Returns the result of an operation invocation or an attribute value. - *
    - * If an error occurred on the server, {@link #hasOperationSucceeded(Message)} will return {@code false}. - * and the result will be a String corresponding to the server exception. + * {@return the result of an operation invocation or an attribute value; if an error occurred on the server {@link + * #hasOperationSucceeded(Message)} will return {@code false} and the result will be a {@code String} corresponding + * to the server exception} */ public static Object[] getResults(final ICoreMessage message) throws Exception { SimpleString sstring = message.getReadOnlyBodyBuffer().readNullableSimpleString(); @@ -260,20 +263,18 @@ public static Object[] getResults(final ICoreMessage message) throws Exception { } /** - * Returns the result of an operation invocation or an attribute value. - *
    - * If an error occurred on the server, {@link #hasOperationSucceeded(Message)} will return {@code false}. - * and the result will be a String corresponding to the server exception. + * {@return the result of an operation invocation or an attribute value; if an error occurred on the server {@link + * #hasOperationSucceeded(Message)} will return {@code false} and the result will be a {@code String} corresponding + * to the server exception} */ public static Object getResult(final ICoreMessage message) throws Exception { return getResult(message, null); } /** - * Returns the result of an operation invocation or an attribute value. - *
    - * If an error occurred on the server, {@link #hasOperationSucceeded(Message)} will return {@code false}. - * and the result will be a String corresponding to the server exception. + * {@return the result of an operation invocation or an attribute value; if an error occurred on the server {@link + * #hasOperationSucceeded(Message)} will return {@code false} and the result will be a {@code String} corresponding + * to the server exception} */ public static Object getResult(final ICoreMessage message, Class desiredType) throws Exception { Object[] res = ManagementHelper.getResults(message); @@ -286,7 +287,7 @@ public static Object getResult(final ICoreMessage message, Class desiredType) th } /** - * Returns whether the invocation of the management operation on the server resource succeeded. + * {@return whether the invocation of the management operation on the server resource succeeded} */ public static boolean hasOperationSucceeded(final Message message) { if (message == null) { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/MessageCounterInfo.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/MessageCounterInfo.java index e5c3cc964e7..2fa64643109 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/MessageCounterInfo.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/MessageCounterInfo.java @@ -21,8 +21,8 @@ import org.apache.activemq.artemis.api.core.JsonUtil; /** - * Helper class to create Java Objects from the - * JSON serialization returned by {@link QueueControl#listMessageCounter()}. + * Helper class to create Java Objects from the JSON serialization returned by + * {@link QueueControl#listMessageCounter()}. */ public final class MessageCounterInfo { @@ -47,8 +47,8 @@ public final class MessageCounterInfo { private final String updateTimestamp; /** - * Returns a MessageCounterInfo corresponding to the JSON serialization returned - * by {@link QueueControl#listMessageCounter()}. + * {@return a MessageCounterInfo corresponding to the JSON serialization returned by {@link + * QueueControl#listMessageCounter()}} */ public static MessageCounterInfo fromJSON(final String jsonString) throws Exception { JsonObject data = JsonUtil.readJsonObject(jsonString); @@ -90,70 +90,70 @@ public MessageCounterInfo(final String name, } /** - * Returns the name of the queue. + * {@return the name of the queue} */ public String getName() { return name; } /** - * Returns the name of the subscription. + * {@return the name of the subscription} */ public String getSubscription() { return subscription; } /** - * Returns whether the queue is durable. + * {@return whether the queue is durable} */ public boolean isDurable() { return durable; } /** - * Returns the number of messages added to the queue since it was created. + * {@return the number of messages added to the queue since it was created} */ public long getCount() { return count; } /** - * Returns the number of messages added to the queue since the last counter sample. + * {@return the number of messages added to the queue since the last counter sample} */ public long getCountDelta() { return countDelta; } /** - * Returns the number of messages currently in the queue. + * {@return the number of messages currently in the queue} */ public int getDepth() { return depth; } /** - * Returns the number of messages in the queue since last counter sample. + * {@return the number of messages in the queue since last counter sample} */ public int getDepthDelta() { return depthDelta; } /** - * Returns the timestamp of the last time a message was added to the queue. + * {@return the timestamp of the last time a message was added to the queue} */ public String getLastAddTimestamp() { return lastAddTimestamp; } /** - * Returns the timestamp of the last time a message from the queue was acknolwedged. + * {@return the timestamp of the last time a message from the queue was acknolwedged} */ public String getLastAckTimestamp() { return lastAckTimestamp; } /** - * Returns the timestamp of the last time the queue was updated. + * {@return the timestamp of the last time the queue was updated} */ public String getUpdateTimestamp() { return updateTimestamp; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/NodeInfo.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/NodeInfo.java index a6a53e20553..b17bfbc93cd 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/NodeInfo.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/NodeInfo.java @@ -22,8 +22,8 @@ import org.apache.activemq.artemis.api.core.JsonUtil; /** - * Helper class to create Java Objects from the - * JSON serialization returned by {@link ActiveMQServerControl#listNetworkTopology()}. + * Helper class to create Java Objects from the JSON serialization returned by + * {@link ActiveMQServerControl#listNetworkTopology()}. */ public class NodeInfo { private final String id; @@ -43,8 +43,8 @@ public String getBackup() { } /** - * Returns an array of NodeInfo corresponding to the JSON serialization returned - * by {@link ActiveMQServerControl#listNetworkTopology()}. + * {@return an array of NodeInfo corresponding to the JSON serialization returned by {@link + * ActiveMQServerControl#listNetworkTopology()}} */ public static NodeInfo[] from(final String jsonString) throws Exception { JsonArray array = JsonUtil.readJsonArray(jsonString); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java index 73221629a6e..1ef8d0474d3 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java @@ -74,14 +74,14 @@ private ObjectNameBuilder(final String domain, final String brokerName, boolean } /** - * Returns the ObjectName used by the single {@link ActiveMQServerControl}. + * {@return the ObjectName used by the single {@link ActiveMQServerControl}} */ public ObjectName getActiveMQServerObjectName() throws Exception { return ObjectName.getInstance(getActiveMQServerName()); } /** - * Returns the ObjectName used by AddressControl. + * {@return the ObjectName used by AddressControl} * * @see AddressControl */ @@ -90,7 +90,7 @@ public ObjectName getAddressObjectName(final SimpleString address) throws Except } /** - * Returns the ObjectName used by QueueControl. + * {@return the ObjectName used by QueueControl} * * @see QueueControl */ @@ -100,7 +100,7 @@ public ObjectName getQueueObjectName(final SimpleString address, final SimpleStr /** - * Returns the ObjectName used by DivertControl. + * {@return the ObjectName used by DivertControl} * * @see DivertControl */ @@ -109,7 +109,7 @@ public ObjectName getDivertObjectName(final String name, String address) throws } /** - * Returns the ObjectName used by AcceptorControl. + * {@return the ObjectName used by AcceptorControl} * * @see AcceptorControl */ @@ -118,7 +118,7 @@ public ObjectName getAcceptorObjectName(final String name) throws Exception { } /** - * Returns the ObjectName used by BroadcastGroupControl. + * {@return the ObjectName used by BroadcastGroupControl} * * @see BroadcastGroupControl */ @@ -127,7 +127,7 @@ public ObjectName getBroadcastGroupObjectName(final String name) throws Exceptio } /** - * Returns the ObjectName used by broker connection management objects for outgoing connections. + * {@return the ObjectName used by broker connection management objects for outgoing connections} * * @see BrokerConnectionControl */ @@ -136,16 +136,13 @@ public ObjectName getBrokerConnectionObjectName(String name) throws Exception { } /** - * Returns the base ObjectName string used by for outgoing broker connections and possibly broker connection - * services that are registered by broker connection specific features. This value is pre-quoted and ready - * for use in an ObjectName.getIstnace call but is intended for use by broker connection components to create - * names specific to a broker connection feature that registers its own object for management. - * - * @param name - * The broker connection name - * - * @return the base object name string that is used for broker connection Object names. + * Returns the base ObjectName string used by for outgoing broker connections and possibly broker connection services + * that are registered by broker connection specific features. This value is pre-quoted and ready for use in an + * ObjectName.getIstnace call but is intended for use by broker connection components to create names specific to a + * broker connection feature that registers its own object for management. * + * @param name The broker connection name + * @return the base object name string that is used for broker connection Object names * @see BrokerConnectionControl */ public String getBrokerConnectionBaseObjectNameString(String name) throws Exception { @@ -153,7 +150,7 @@ public String getBrokerConnectionBaseObjectNameString(String name) throws Except } /** - * Returns the ObjectName used by remote broker connection management objects for incoming connections. + * {@return the ObjectName used by remote broker connection management objects for incoming connections} * * @see RemoteBrokerConnectionControl */ @@ -162,17 +159,14 @@ public ObjectName getRemoteBrokerConnectionObjectName(String nodeId, String name } /** - * Returns the base ObjectName string used by for incoming broker connections and possibly broker connection - * services that are registered by broker connection specific features. This value is pre-quoted and ready - * for use in an ObjectName.getIstnace call but is intended for use by broker connection components to create - * names specific to a broker connection feature that registers its own object for management. - * - * @param nodeId - * The node ID of the remote broker that initiated the broker connection. - * @param name - * The broker connection name configured on the initiating broker. + * Returns the base ObjectName string used by for incoming broker connections and possibly broker connection services + * that are registered by broker connection specific features. This value is pre-quoted and ready for use in an + * ObjectName.getIstnace call but is intended for use by broker connection components to create names specific to a + * broker connection feature that registers its own object for management. * - * @return the base object name string that is used for broker connection Object names. + * @param nodeId The node ID of the remote broker that initiated the broker connection. + * @param name The broker connection name configured on the initiating broker. + * @return the base object name string that is used for broker connection Object names */ public String getRemoteBrokerConnectionBaseObjectNameString(String nodeId, String name) throws Exception { return getActiveMQServerName() + @@ -182,7 +176,7 @@ public String getRemoteBrokerConnectionBaseObjectNameString(String nodeId, Strin } /** - * Returns the ObjectName used by BridgeControl. + * {@return the ObjectName used by BridgeControl} * * @see BridgeControl */ @@ -191,7 +185,7 @@ public ObjectName getBridgeObjectName(final String name) throws Exception { } /** - * Returns the ObjectName used by ClusterConnectionControl. + * {@return the ObjectName used by ClusterConnectionControl} * * @see ClusterConnectionControl */ @@ -200,7 +194,7 @@ public ObjectName getClusterConnectionObjectName(final String name) throws Excep } /** - * Returns the ObjectName used by ConnectionRouterControl. + * {@return the ObjectName used by ConnectionRouterControl} * * @see ConnectionRouterControl */ diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Operation.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Operation.java index 9e03b11f1d2..e95dd58c302 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Operation.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Operation.java @@ -26,8 +26,7 @@ /** * Info for a MBean Operation. *

    - * This annotation is used only for methods which can be invoked - * through a GUI. + * This annotation is used only for methods which can be invoked through a GUI. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Parameter.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Parameter.java index 24a7b1f24f1..25d56441c89 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Parameter.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/Parameter.java @@ -24,8 +24,7 @@ /** * Info for a MBean Operation Parameter. *

    - * This annotation is used only for methods which can be invoked - * through a GUI. + * This annotation is used only for methods which can be invoked through a GUI. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java index 8fd14b2eead..c3cc843a8fe 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java @@ -46,43 +46,43 @@ public interface QueueControl { String MESSAGES_KILLED_DESCRIPTION = "number of messages removed from this queue since it was created due to exceeding the max delivery attempts"; /** - * Returns the name of this queue. + * {@return the name of this queue} */ @Attribute(desc = "name of this queue") String getName(); /** - * Returns the address this queue is bound to. + * {@return the address this queue is bound to} */ @Attribute(desc = "address this queue is bound to") String getAddress(); /** - * Returns this queue ID. + * {@return this queue ID} */ @Attribute(desc = "ID of this queue") long getID(); /** - * Returns whether this queue is temporary. + * {@return whether this queue is temporary} */ @Attribute(desc = "whether this queue is temporary") boolean isTemporary(); /** - * Returns whether this queue is used for a retroactive address. + * {@return whether this queue is used for a retroactive address} */ @Attribute(desc = "whether this queue is used for a retroactive address") boolean isRetroactiveResource(); /** - * Returns whether this queue is durable. + * {@return whether this queue is durable} */ @Attribute(desc = "whether this queue is durable") boolean isDurable(); /** - * Returns the user that is associated with creating the queue. + * {@return the user that is associated with creating the queue} */ @Attribute(desc = "the user that created the queue") String getUser(); @@ -94,175 +94,167 @@ public interface QueueControl { String getRoutingType(); /** - * Returns the filter associated with this queue. + * {@return the filter associated with this queue} */ @Attribute(desc = "filter associated with this queue") String getFilter(); /** - * Returns the number of messages currently in this queue. + * {@return the number of messages currently in this queue} */ @Attribute(desc = MESSAGE_COUNT_DESCRIPTION) long getMessageCount(); /** - * Returns the persistent size of all messages currently in this queue. The persistent size of a message - * is the amount of space the message would take up on disk which is used to track how much data there - * is to consume on this queue + * {@return the persistent size of all messages currently in this queue; the persistent size of a message is the + * amount of space the message would take up on disk which is used to track how much data there is to consume on this + * queue} */ @Attribute(desc = PERSISTENT_SIZE_DESCRIPTION) long getPersistentSize(); /** - * Returns the number of durable messages currently in this queue. + * {@return the number of durable messages currently in this queue} */ @Attribute(desc = DURABLE_MESSAGE_COUNT_DESCRIPTION) long getDurableMessageCount(); /** - * Returns the persistent size of durable messages currently in this queue. The persistent size of a message - * is the amount of space the message would take up on disk which is used to track how much data there - * is to consume on this queue + * {@return the persistent size of durable messages currently in this queue; the persistent size of a message is the + * amount of space the message would take up on disk which is used to track how much data there is to consume on this + * queue} */ @Attribute(desc = DURABLE_PERSISTENT_SIZE_DESCRIPTION) long getDurablePersistentSize(); /** - * Returns whether this queue was created for the broker's internal use. + * {@return whether this queue was created for the broker's internal use} */ @Attribute(desc = "whether this queue was created for the broker's internal use") boolean isInternalQueue(); /** - * Returns the number of scheduled messages in this queue. + * {@return the number of scheduled messages in this queue} */ @Attribute(desc = SCHEDULED_MESSAGE_COUNT_DESCRIPTION) long getScheduledCount(); /** - * Returns the size of scheduled messages in this queue. + * {@return the size of scheduled messages in this queue} */ @Attribute(desc = SCHEDULED_SIZE_DESCRIPTION) long getScheduledSize(); /** - * Returns the number of durable scheduled messages in this queue. + * {@return the number of durable scheduled messages in this queue} */ @Attribute(desc = DURABLE_SCHEDULED_MESSAGE_COUNT_DESCRIPTION) long getDurableScheduledCount(); /** - * Returns the size of durable scheduled messages in this queue. + * {@return the size of durable scheduled messages in this queue} */ @Attribute(desc = DURABLE_SCHEDULED_SIZE_DESCRIPTION) long getDurableScheduledSize(); /** - * Returns the number of consumers consuming messages from this queue. + * {@return the number of consumers consuming messages from this queue} */ @Attribute(desc = CONSUMER_COUNT_DESCRIPTION) int getConsumerCount(); /** - * Returns the number of messages that this queue is currently delivering to its consumers. + * {@return the number of messages that this queue is currently delivering to its consumers} */ @Attribute(desc = DELIVERING_MESSAGE_COUNT_DESCRIPTION) int getDeliveringCount(); /** - * Returns the persistent size of messages that this queue is currently delivering to its consumers. + * {@return the persistent size of messages that this queue is currently delivering to its consumers} */ @Attribute(desc = DELIVERING_SIZE_DESCRIPTION) long getDeliveringSize(); /** - * Returns the number of durable messages that this queue is currently delivering to its consumers. + * {@return the number of durable messages that this queue is currently delivering to its consumers} */ @Attribute(desc = DURABLE_DELIVERING_MESSAGE_COUNT_DESCRIPTION) int getDurableDeliveringCount(); /** - * Returns the size of durable messages that this queue is currently delivering to its consumers. + * {@return the size of durable messages that this queue is currently delivering to its consumers} */ @Attribute(desc = DURABLE_DELIVERING_SIZE_DESCRIPTION) long getDurableDeliveringSize(); /** - * Returns the number of messages added to this queue since it was created. + * {@return the number of messages added to this queue since it was created} */ @Attribute(desc = MESSAGES_ADDED_DESCRIPTION) long getMessagesAdded(); /** - * Returns the number of messages added to this queue since it was created. + * {@return the number of messages added to this queue since it was created} */ @Attribute(desc = MESSAGES_ACKNOWLEDGED_DESCRIPTION) long getMessagesAcknowledged(); /** - * Returns the number of messages added to this queue since it was created. + * {@return the number of messages added to this queue since it was created} */ @Attribute(desc = "number of messages acknowledged attempts from this queue since it was created") long getAcknowledgeAttempts(); /** - * Returns the number of messages expired from this queue since it was created. + * {@return the number of messages expired from this queue since it was created} */ @Attribute(desc = MESSAGES_EXPIRED_DESCRIPTION) long getMessagesExpired(); /** - * Returns the number of messages removed from this queue since it was created due to exceeding the max delivery attempts. + * {@return the number of messages removed from this queue since it was created due to exceeding the max delivery + * attempts} */ @Attribute(desc = MESSAGES_KILLED_DESCRIPTION) long getMessagesKilled(); /** - * Returns the first message on the queue as JSON + * {@return the first message on the queue as JSON} */ @Attribute(desc = "first message on the queue as JSON") String getFirstMessageAsJSON() throws Exception; /** - * Returns the timestamp of the first message in milliseconds. + * {@return the timestamp of the first message in milliseconds} */ @Attribute(desc = "timestamp of the first message in milliseconds") Long getFirstMessageTimestamp() throws Exception; /** - * Returns the age of the first message in milliseconds. + * {@return the age of the first message in milliseconds} */ @Attribute(desc = "age of the first message in milliseconds") Long getFirstMessageAge() throws Exception; /** - * Returns the expiry address associated with this queue. + * {@return the expiry address associated with this queue} */ @Attribute(desc = "expiry address associated with this queue") String getExpiryAddress(); /** - * Returns the dead-letter address associated with this queue. + * {@return the dead-letter address associated with this queue} */ @Attribute(desc = "dead-letter address associated with this queue") String getDeadLetterAddress(); - /** - * - */ @Attribute(desc = "maximum number of consumers allowed on this queue at any one time") int getMaxConsumers(); - /** - * - */ @Attribute(desc = "purge this queue when the last consumer disconnects") boolean isPurgeOnNoConsumers(); - /** - * - */ @Attribute(desc = "if the queue is enabled, default it is enabled, when disabled messages will not be routed to the queue") boolean isEnabled(); @@ -278,49 +270,38 @@ public interface QueueControl { @Operation(desc = "Disables routing of messages to the Queue", impact = MBeanOperationInfo.ACTION) void disable() throws Exception; - /** - * - */ @Attribute(desc = "is this queue managed by configuration (broker.xml)") boolean isConfigurationManaged(); - /** - * - */ @Attribute(desc = "If the queue should route exclusively to one consumer") boolean isExclusive(); - /** - * - */ @Attribute(desc = "is this queue a last value queue") boolean isLastValue(); /** - *The key used for the last value queues + * {@return key used for the last value queues} */ @Attribute(desc = "last value key") String getLastValueKey(); /** - *Return the Consumers Before Dispatch - * @return + * {@return the Consumers Before Dispatch} */ @Attribute(desc = "Return the Consumers Before Dispatch") int getConsumersBeforeDispatch(); /** - *Return the Consumers Before Dispatch - * @return + * {@return the Delay Before Dispatch} */ - @Attribute(desc = "Return the Consumers Before Dispatch") + @Attribute(desc = "Return the Delay Before Dispatch") long getDelayBeforeDispatch(); // Operations ---------------------------------------------------- /** * Lists all the messages scheduled for delivery for this queue. - *
    + *

    * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values. */ @Operation(desc = "List the messages scheduled for delivery", impact = MBeanOperationInfo.INFO) @@ -334,26 +315,24 @@ public interface QueueControl { /** * Lists all the messages being deliver per consumer. - *
    - * The Map's key is a toString representation for the consumer. Each consumer will then return a {@code Map[]} same way is returned by {@link #listScheduledMessages()} + *

    + * The Map's key is a toString representation for the consumer. Each consumer will then return a + * {@code Map[]} same way is returned by {@link #listScheduledMessages()} */ @Operation(desc = "List all messages being delivered per consumer") Map[]> listDeliveringMessages() throws Exception; /** * Executes a conversion of {@link #listDeliveringMessages()} to JSON - * - * @return - * @throws Exception */ @Operation(desc = "list all messages being delivered per consumer using JSON form") String listDeliveringMessagesAsJSON() throws Exception; /** * Lists all the messages in this queue matching the specified filter. - *
    + *

    * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values. - *
    + *

    * Using {@code null} or an empty filter will list all messages from this queue. */ @Operation(desc = "List all the messages in the queue matching the given filter", impact = MBeanOperationInfo.INFO) @@ -361,7 +340,7 @@ public interface QueueControl { /** * Lists all the messages in this queue matching the specified filter using JSON serialization. - *
    + *

    * Using {@code null} or an empty filter will list all messages from this queue. */ @Operation(desc = "List all the messages in the queue matching the given filter and returns them using JSON", impact = MBeanOperationInfo.INFO) @@ -369,7 +348,7 @@ public interface QueueControl { /** * Counts the number of messages in this queue matching the specified filter. - *
    + *

    * Using {@code null} or an empty filter will count all messages from this queue. */ @Operation(desc = "Returns the number of the messages in the queue matching the given filter", impact = MBeanOperationInfo.INFO) @@ -381,7 +360,7 @@ public interface QueueControl { /** * Counts the number of messages in this queue matching the specified filter, grouped by the given property field. * In case of null property will be grouped in "null" - *
    + *

    * Using {@code null} or an empty filter will count all messages from this queue. */ @Operation(desc = "Returns the number of the messages in the queue matching the given filter, grouped by the given property field", impact = MBeanOperationInfo.INFO) @@ -389,16 +368,16 @@ public interface QueueControl { /** * Counts the number of delivering messages in this queue matching the specified filter. - *
    + *

    * Using {@code null} or an empty filter will count all messages from this queue. */ @Operation(desc = "Returns the number of the messages in the queue matching the given filter") long countDeliveringMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception; /** - * Counts the number of delivering messages in this queue matching the specified filter, grouped by the given property field. - * In case of null property will be grouped in "null" - *
    + * Counts the number of delivering messages in this queue matching the specified filter, grouped by the given + * property field. In case of null property will be grouped in "null" + *

    * Using {@code null} or an empty filter will count all messages from this queue. */ @Operation(desc = "Returns the number of the messages in the queue matching the given filter, grouped by the given property field") @@ -414,7 +393,7 @@ public interface QueueControl { /** * Removes all the message corresponding to the specified filter. - *
    + *

    * Using {@code null} or an empty filter will remove all messages from this queue. * * @return the number of removed messages @@ -424,7 +403,7 @@ public interface QueueControl { /** * Removes all the message corresponding to the specified filter. - *
    + *

    * Using {@code null} or an empty filter will remove all messages from this queue. * * @return the number of removed messages @@ -443,7 +422,7 @@ int removeMessages(@Parameter(name = "flushLimit", desc = "Limit to flush transa /** * Expires all the message corresponding to the specified filter. - *
    + *

    * Using {@code null} or an empty filter will expire all messages from this queue. * * @return the number of expired messages @@ -460,12 +439,10 @@ int removeMessages(@Parameter(name = "flushLimit", desc = "Limit to flush transa boolean expireMessage(@Parameter(name = "messageID", desc = "A message ID") long messageID) throws Exception; /** - * Retries the message corresponding to the given messageID to the original queue. - * This is appropriate on dead messages on Dead letter queues only. + * Retries the message corresponding to the given messageID to the original queue. This is appropriate on dead + * messages on Dead letter queues only. * - * @param messageID - * @return {@code true} if the message was retried, {@code false} else - * @throws Exception + * @return {@code true} if the message was retried, {@code false} else */ @Operation(desc = "Retry the message corresponding to the given messageID to the original queue", impact = MBeanOperationInfo.ACTION) boolean retryMessage(@Parameter(name = "messageID", desc = "A message ID") long messageID) throws Exception; @@ -474,8 +451,7 @@ int removeMessages(@Parameter(name = "flushLimit", desc = "Limit to flush transa * Retries all messages on a DLQ to their respective original queues. * This is appropriate on dead messages on Dead letter queues only. * - * @return the number of retried messages. - * @throws Exception + * @return the number of retried messages */ @Operation(desc = "Retry all messages on a DLQ to their respective original queues", impact = MBeanOperationInfo.ACTION) int retryMessages() throws Exception; @@ -502,7 +478,7 @@ boolean moveMessage(@Parameter(name = "messageID", desc = "A message ID") long m /** * Moves all the message corresponding to the specified filter to the specified other queue. * RejectDuplicates = false on this case - *
    + *

    * Using {@code null} or an empty filter will move all messages from this queue. * * @return the number of moved messages @@ -513,7 +489,7 @@ int moveMessages(@Parameter(name = "filter", desc = "A message filter (can be em /** * Moves all the message corresponding to the specified filter to the specified other queue. - *
    + *

    * Using {@code null} or an empty filter will move all messages from this queue. * * @return the number of moved messages @@ -550,7 +526,7 @@ boolean copyMessage(@Parameter(name = "messageID", desc = "A message ID") long m /** * Sends all the message corresponding to the specified filter to this queue's dead letter address. - *
    + *

    * Using {@code null} or an empty filter will send all messages from this queue. * * @return the number of sent messages @@ -559,13 +535,10 @@ boolean copyMessage(@Parameter(name = "messageID", desc = "A message ID") long m int sendMessagesToDeadLetterAddress(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filterStr) throws Exception; /** - * @param headers the message headers and properties to set. Can only - * container Strings maped to primitive types. - * @param body the text to send - * @param durable - * @param user - * @param password @return - * @throws Exception + * Sends a TextMessage to a password-protected destination. + * + * @param headers the message headers and properties to set. Can only container Strings maped to primitive types. + * @param body the text to send */ @Operation(desc = "Sends a TextMessage to a password-protected destination.", impact = MBeanOperationInfo.ACTION) String sendMessage(@Parameter(name = "headers", desc = "The headers to add to the message") Map headers, @@ -576,14 +549,12 @@ String sendMessage(@Parameter(name = "headers", desc = "The headers to add to th @Parameter(name = "password", desc = "The users password to authenticate with") String password) throws Exception; /** - * @param headers the message headers and properties to set. Can only - * container Strings maped to primitive types. - * @param body the text to send - * @param durable - * @param user - * @param password @return - * @param createMessageId whether or not to auto generate a Message ID - * @throws Exception + * Sends a TextMessage to a password-protected destination. + * + * @param headers the message headers and properties to set. Can only container Strings maped to primitive + * types. + * @param body the text to send + * @param createMessageId whether to auto generate a Message ID */ @Operation(desc = "Sends a TextMessage to a password-protected destination.", impact = MBeanOperationInfo.ACTION) String sendMessage(@Parameter(name = "headers", desc = "The headers to add to the message") Map headers, @@ -606,7 +577,7 @@ boolean changeMessagePriority(@Parameter(name = "messageID", desc = "A message I /** * Changes the priority for all the message corresponding to the specified filter to the specified priority. - *
    + *

    * Using {@code null} or an empty filter will change all messages from this queue. * * @return the number of changed messages @@ -669,7 +640,7 @@ int changeMessagesPriority(@Parameter(name = "filter", desc = "A message filter String listConsumersAsJSON() throws Exception; /** - * Returns whether the queue is paused. + * {@return whether the queue is paused} */ @Attribute(desc = "whether the queue is paused") boolean isPaused() throws Exception; @@ -714,23 +685,21 @@ CompositeData[] browse(@Parameter(name = "page", desc = "Current page") int page void resetMessagesKilled() throws Exception; /** - * it will flush one cycle on internal executors, so you would be sure that any pending tasks are done before you call - * any other measure. - * It is useful if you need the exact number of counts on a message + * it will flush one cycle on internal executors, so you would be sure that any pending tasks are done before you + * call any other measure. It is useful if you need the exact number of counts on a message */ @Operation(desc = "Flush internal executors", impact = MBeanOperationInfo.ACTION) void flushExecutor(); /** - * Will reset the all the groups. - * This is useful if you want a complete rebalance of the groups to consumers + * Will reset the all the groups. This is useful if you want a complete rebalance of the groups to consumers */ @Operation(desc = "Resets all groups", impact = MBeanOperationInfo.ACTION) void resetAllGroups(); /** - * Will reset the group matching the given groupID. - * This is useful if you want the given group to be rebalanced to the consumers + * Will reset the group matching the given groupID. This is useful if you want the given group to be rebalanced to + * the consumers */ @Operation(desc = "Reset the specified group", impact = MBeanOperationInfo.ACTION) void resetGroup(@Parameter(name = "groupID", desc = "ID of group to reset") String groupID); @@ -752,13 +721,13 @@ CompositeData[] browse(@Parameter(name = "page", desc = "Current page") int page long getRingSize(); /** - * Returns whether the groups of this queue are automatically rebalanced. + * {@return whether the groups of this queue are automatically rebalanced} */ @Attribute(desc = "whether the groups of this queue are automatically rebalanced") boolean isGroupRebalance(); /** - * Returns whether the dispatch is paused when groups of this queue are automatically rebalanced. + * {@return whether the dispatch is paused when groups of this queue are automatically rebalanced} */ @Attribute(desc = "whether the dispatch is paused when groups of this queue are automatically rebalanced") boolean isGroupRebalancePauseDispatch(); @@ -794,19 +763,19 @@ CompositeData[] browse(@Parameter(name = "page", desc = "Current page") int page void deliverScheduledMessage(@Parameter(name = "messageID", desc = "ID of the message to deliver") long messageId) throws Exception; /** - * Returns whether this queue is available for auto deletion. + * {@return whether this queue is available for auto deletion} */ @Attribute(desc = "whether this queue is available for auto deletion") boolean isAutoDelete(); /** - * Returns the first message on the queue as JSON + * {@return the first message on the queue as JSON} */ @Operation(desc = "Returns first message on the queue as JSON", impact = MBeanOperationInfo.INFO) String peekFirstMessageAsJSON() throws Exception; /** - * Returns the first scheduled message on the queue as JSON + * {@return the first scheduled message on the queue as JSON} */ @Operation(desc = "Returns first scheduled message on the queue as JSON", impact = MBeanOperationInfo.INFO) String peekFirstScheduledMessageAsJSON() throws Exception; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/RemoteBrokerConnectionControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/RemoteBrokerConnectionControl.java index 3b47d43aab7..7d40249e5a1 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/RemoteBrokerConnectionControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/RemoteBrokerConnectionControl.java @@ -17,25 +17,25 @@ package org.apache.activemq.artemis.api.core.management; /** - * An API for a RemoteBrokerConnectionControl object that is used to view information about - * active remote broker connections. + * An API for a RemoteBrokerConnectionControl object that is used to view information about active remote broker + * connections. */ public interface RemoteBrokerConnectionControl { /** - * Returns the name of the remote broker connection + * {@return the name of the remote broker connection} */ @Attribute(desc = "name of the remote broker connection") String getName(); /** - * Returns the Node ID of the remote broker connection + * {@return the Node ID of the remote broker connection} */ @Attribute(desc = "Node ID of the remote broker connection") String getNodeId(); /** - * Returns the wire protocol this broker connection is using. + * {@return the wire protocol this broker connection is using} */ @Attribute(desc = "the wire protocol this broker connection is using") String getProtocol(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ResourceNames.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ResourceNames.java index 169e5bb15fb..6d251e897c4 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ResourceNames.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ResourceNames.java @@ -21,9 +21,9 @@ /** * Helper class used to build resource names used by management messages. - *
    - * Resource's name is build by appending its name to its corresponding type. - * For example, the resource name of the "foo" queue is {@code QUEUE + "foo"}. + *

    + * Resource's name is build by appending its name to its corresponding type. For example, the resource name of + * the "foo" queue is {@code QUEUE + "foo"}. */ public final class ResourceNames { public static final String BROKER = "broker"; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/RoleInfo.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/RoleInfo.java index 211f716d6a5..ec89d552ee8 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/RoleInfo.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/RoleInfo.java @@ -22,8 +22,7 @@ import org.apache.activemq.artemis.api.core.JsonUtil; /** - * Helper class to create Java Objects from the - * JSON serialization returned by {@link AddressControl#getRolesAsJSON()}. + * Helper class to create Java Objects from the JSON serialization returned by {@link AddressControl#getRolesAsJSON()}. */ public final class RoleInfo { @@ -50,8 +49,8 @@ public final class RoleInfo { private final boolean deleteAddress; /** - * Returns an array of RoleInfo corresponding to the JSON serialization returned - * by {@link AddressControl#getRolesAsJSON()}. + * {@return an array of RoleInfo corresponding to the JSON serialization returned by {@link + * AddressControl#getRolesAsJSON()}} */ public static RoleInfo[] from(final String jsonString) throws Exception { JsonArray array = JsonUtil.readJsonArray(jsonString); @@ -99,78 +98,75 @@ private RoleInfo(final String name, this.deleteAddress = deleteAddress; } - /** - * Returns the name of the role. - */ public String getName() { return name; } /** - * Returns whether this role can send messages to the address. + * {@return whether this role can send messages to the address} */ public boolean isSend() { return send; } /** - * Returns whether this role can consume messages from queues bound to the address. + * {@return whether this role can consume messages from queues bound to the address} */ public boolean isConsume() { return consume; } /** - * Returns whether this role can create durable queues bound to the address. + * {@return whether this role can create durable queues bound to the address} */ public boolean isCreateDurableQueue() { return createDurableQueue; } /** - * Returns whether this role can delete durable queues bound to the address. + * {@return whether this role can delete durable queues bound to the address} */ public boolean isDeleteDurableQueue() { return deleteDurableQueue; } /** - * Returns whether this role can create non-durable queues bound to the address. + * {@return whether this role can create non-durable queues bound to the address} */ public boolean isCreateNonDurableQueue() { return createNonDurableQueue; } /** - * Returns whether this role can delete non-durable queues bound to the address. + * {@return whether this role can delete non-durable queues bound to the address} */ public boolean isDeleteNonDurableQueue() { return deleteNonDurableQueue; } /** - * Returns whether this role can send management messages to the address. + * {@return whether this role can send management messages to the address} */ public boolean isManage() { return manage; } /** - * Returns whether this role can browse queues bound to the address. + * {@return whether this role can browse queues bound to the address} */ public boolean isBrowse() { return browse; } /** - * Returns whether this role can create addresses. + * {@return whether this role can create addresses} */ public boolean isCreateAddress() { return createAddress; } /** - * Returns whether this role can delete addresses. + * {@return whether this role can delete addresses} */ public boolean isDeleteAddress() { return deleteAddress; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/SimpleManagement.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/SimpleManagement.java index 5152b36e4e4..570eb32f3b6 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/SimpleManagement.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/SimpleManagement.java @@ -37,7 +37,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** This class provides a simple proxy for management operations */ +/** + * This class provides a simple proxy for management operations + */ public class SimpleManagement implements AutoCloseable { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -94,28 +96,36 @@ public void rebuildPageCounters() throws Exception { simpleManagementVoid("broker", "rebuildPageCounters"); } - /** Simple helper for management returning a string.*/ + /** + * Simple helper for management returning a string. + */ public String simpleManagement(String resource, String method, Object... parameters) throws Exception { AtomicReference responseString = new AtomicReference<>(); doManagement((m) -> setupCall(m, resource, method, parameters), m -> setStringResult(m, responseString), SimpleManagement::failed); return responseString.get(); } - /** Simple helper for management returning a long.*/ + /** + * Simple helper for management returning a long. + */ public long simpleManagementLong(String resource, String method, Object... parameters) throws Exception { AtomicLong responseLong = new AtomicLong(); doManagement((m) -> setupCall(m, resource, method, parameters), m -> setLongResult(m, responseLong), SimpleManagement::failed); return responseLong.get(); } - /** Simple helper for management returning a long.*/ + /** + * Simple helper for management returning a long. + */ public boolean simpleManagementBoolean(String resource, String method, Object... parameters) throws Exception { AtomicBoolean responseBoolean = new AtomicBoolean(); doManagement((m) -> setupCall(m, resource, method, parameters), m -> setBooleanResult(m, responseBoolean), SimpleManagement::failed); return responseBoolean.get(); } - /** Simple helper for management void calls.*/ + /** + * Simple helper for management void calls. + */ public void simpleManagementVoid(String resource, String method, Object... parameters) throws Exception { doManagement((m) -> setupCall(m, resource, method, parameters), null, SimpleManagement::failed); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java index 7845deee7d7..dd40192d3e1 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java @@ -36,8 +36,6 @@ public final class ResetLimitWrappedActiveMQBuffer extends ChannelBufferWrapper /** * We need to turn of notifications of body changes on reset on the server side when dealing with AMQP conversions, * for that reason this method will set the message to null here - * - * @param message */ public void setMessage(Message message) { this.message = message; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java index 1debd394a27..e7c1c7108df 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientLogger.java @@ -179,10 +179,9 @@ public interface ActiveMQClientLogger { void packetOutOfOrder(Object obj, Throwable t); /** - * Warns about usage of {@link org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler} or JMS's {@code CompletionWindow} with - * confirmations disabled (confirmationWindowSize=-1). + * Warns about usage of {@link org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler} or JMS's + * {@code CompletionWindow} with confirmations disabled (confirmationWindowSize=-1). */ - @LogMessage(id = 212053, value = "CompletionListener/SendAcknowledgementHandler used with confirmationWindowSize=-1. Enable confirmationWindowSize to receive acks from server!", level = LogMessage.Level.WARN) void confirmationWindowDisabledWarning(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AfterConnectInternalListener.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AfterConnectInternalListener.java index 8267a702b8e..87ea713f135 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AfterConnectInternalListener.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/AfterConnectInternalListener.java @@ -17,9 +17,8 @@ package org.apache.activemq.artemis.core.client.impl; /** - * To be called right after the ConnectionFactory created a connection. - * This listener is not part of the API and shouldn't be used by users. - * (if you do so we can't guarantee any API compatibility on this class) + * To be called right after the ConnectionFactory created a connection. This listener is not part of the API and + * shouldn't be used by users. (if you do so we can't guarantee any API compatibility on this class) */ public interface AfterConnectInternalListener { 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 7628a4dc61b..e8292771442 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 @@ -304,7 +304,7 @@ private ClientMessage receive(final long timeout, final boolean forcingDelivery) if (callForceDelivery) { logger.trace("{}::Forcing delivery", this); - // JBPAPP-6030 - Calling forceDelivery outside of the lock to avoid distributed dead locks + // Calling forceDelivery outside of the lock to avoid distributed dead locks sessionContext.forceDelivery(this, forceDeliveryCount.getAndIncrement()); callForceDelivery = false; deliveryForced = true; @@ -458,7 +458,6 @@ public void close() throws ActiveMQException { * To be used by MDBs to stop any more handling of messages. * * @param future the future to run once the onMessage Thread has completed - * @throws ActiveMQException */ @Override public Thread prepareForClose(final FutureLatch future) throws ActiveMQException { @@ -609,14 +608,13 @@ private void handleRegularMessage(ClientMessageInternal message) { } /** - * This method deals with messages arrived as regular message but its contents are compressed. - * Such messages come from message senders who are configured to compress large messages, and - * if some of the messages are compressed below the min-large-message-size limit, they are sent - * as regular messages. - *
    - * However when decompressing the message, we are not sure how large the message could be.. - * for that reason we fake a large message controller that will deal with the message as it was a large message - *
    + * This method deals with messages arrived as regular message but its contents are compressed. Such messages come + * from message senders who are configured to compress large messages, and if some of the messages are compressed + * below the min-large-message-size limit, they are sent as regular messages. + *

    + * However when decompressing the message, we are not sure how large the message could be.. for that reason we fake a + * large message controller that will deal with the message as it was a large message + *

    * Say that you sent a 1G message full of spaces. That could be just bellow 100K compressed but you wouldn't have * enough memory to decompress it */ @@ -809,10 +807,11 @@ public void flushAcks() throws ActiveMQException { } /** - * LargeMessageBuffer will call flowcontrol here, while other handleMessage will also be calling flowControl. - * So, this operation needs to be atomic. + * LargeMessageBuffer will call flowcontrol here, while other handleMessage will also be calling flowControl. So, + * this operation needs to be atomic. * - * @param discountSlowConsumer When dealing with slowConsumers, we need to discount one credit that was pre-sent when the first receive was called. For largeMessage that is only done at the latest packet + * @param discountSlowConsumer When dealing with slowConsumers, we need to discount one credit that was pre-sent when + * the first receive was called. For largeMessage that is only done at the latest packet */ @Override public void flowControl(final int messageBytes, final boolean discountSlowConsumer) throws ActiveMQException { @@ -896,9 +895,6 @@ private void queueExecutor() { sessionExecutor.execute(runner); } - /** - * @param credits - */ private void sendCredits(final int credits) { pendingFlowControl.countUp(); flowControlExecutor.execute(() -> { @@ -1055,10 +1051,6 @@ private void safeRestoreContextClassLoader(final ClassLoader originalClassLoader }); } - /** - * @param message - * @throws ActiveMQException - */ private void flowControlBeforeConsumption(final ClientMessageInternal message) throws ActiveMQException { if (manualFlowManagement) { return; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerInternal.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerInternal.java index 24f55a2210d..5efe120b558 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerInternal.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerInternal.java @@ -48,9 +48,6 @@ public interface ClientConsumerInternal extends ClientConsumer { /** * To be called by things like MDBs during shutdown of the server - * - * @param future - * @throws ActiveMQException */ Thread prepareForClose(FutureLatch future) throws ActiveMQException; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientLargeMessageImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientLargeMessageImpl.java index ca57a70201f..f024f5ccd39 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientLargeMessageImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientLargeMessageImpl.java @@ -28,8 +28,8 @@ /** * ClientLargeMessageImpl is only created when receiving large messages. *

    - * At the time of sending a regular Message is sent as we won't know the message is considered large - * until the buffer is filled up or the user set a streaming. + * At the time of sending a regular Message is sent as we won't know the message is considered large until the buffer is + * filled up or the user set a streaming. */ public final class ClientLargeMessageImpl extends ClientMessageImpl implements ClientLargeMessageInternal { @@ -38,9 +38,6 @@ public final class ClientLargeMessageImpl extends ClientMessageImpl implements C private long largeMessageSize; - /** - * @param largeMessageSize the largeMessageSize to set - */ @Override public void setLargeMessageSize(long largeMessageSize) { this.largeMessageSize = largeMessageSize; @@ -64,9 +61,6 @@ public int getEncodeSize() { } } - /** - * @return the largeMessage - */ @Override public boolean isLargeMessage() { return true; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageImpl.java index 5fac7e56b8a..5faacbf1cf5 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageImpl.java @@ -32,9 +32,6 @@ import org.apache.activemq.artemis.reader.MessageUtil; import org.apache.activemq.artemis.utils.UUID; -/** - * A ClientMessageImpl - */ public class ClientMessageImpl extends CoreMessage implements ClientMessageInternal { // added this constant here so that the client package have no dependency on JMS @@ -53,9 +50,6 @@ public class ClientMessageImpl extends CoreMessage implements ClientMessageInter */ private InputStream bodyInputStream; - /* - * Constructor for when reading from remoting - */ public ClientMessageImpl() { } @@ -92,9 +86,7 @@ public ClientMessageImpl setUserID(UUID userID) { } - /* - * Construct messages before sending - */ + // Construct messages before sending public ClientMessageImpl(final byte type, final boolean durable, final long expiration, @@ -168,9 +160,6 @@ public void setFlowControlSize(final int flowControlSize) { this.flowControlSize = flowControlSize; } - /** - * @return the largeMessage - */ @Override public boolean isLargeMessage() { return false; @@ -219,17 +208,11 @@ public boolean waitOutputStreamCompletion(final long timeMilliseconds) throws Ac public void discardBody() { } - /** - * @return the bodyInputStream - */ @Override public InputStream getBodyInputStream() { return bodyInputStream; } - /** - * @param bodyInputStream the bodyInputStream to set - */ @Override public ClientMessageImpl setBodyInputStream(final InputStream bodyInputStream) { this.bodyInputStream = bodyInputStream; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageInternal.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageInternal.java index 1a7fe07e0f8..3edeae5b138 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageInternal.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageInternal.java @@ -23,21 +23,12 @@ public interface ClientMessageInternal extends ClientMessage { TypedProperties getProperties(); - /** - * Size used for FlowControl - */ int getFlowControlSize(); - /** - * Size used for FlowControl - */ void setFlowControlSize(int flowControlSize); void onReceipt(ClientConsumerInternal consumer); - /** - * Discard unused packets (used on large-message) - */ void discardBody(); boolean isCompressed(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerCreditManager.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerCreditManager.java index 3cdf6ed44fc..ca32948287f 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerCreditManager.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerCreditManager.java @@ -37,7 +37,9 @@ public interface ClientProducerCreditManager { int getMaxAnonymousCacheSize(); - /** This will determine the flow control as asynchronous, - * no actual block should happen instead a callback will be sent whenever blockages change */ + /** + * This will determine the flow control as asynchronous, no actual block should happen instead a callback will be + * sent whenever blockages change + */ void setCallback(ClientProducerFlowCallback callback); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerCreditManagerImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerCreditManagerImpl.java index 59762aa7865..a4a1311e288 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerCreditManagerImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerCreditManagerImpl.java @@ -48,9 +48,6 @@ public ClientProducerCreditManagerImpl(final ClientSessionInternal session, fina this.windowSize = windowSize; } - - /** This will determine the flow control as asynchronous, - * no actual block should happen instead a callback will be sent whenever blockages change */ @Override public void setCallback(ClientProducerFlowCallback callback) { this.callback = callback; 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 e538379b904..983debcf22c 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 @@ -37,9 +37,6 @@ 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(MethodHandles.lookup().lookupClass()); @@ -54,8 +51,6 @@ public class ClientProducerImpl implements ClientProducerInternal { private volatile boolean closed; - // For rate throttling - private final TokenBucketLimiter rateLimiter; private final boolean blockOnNonDurableSend; @@ -313,11 +308,6 @@ private void checkClosed() throws ActiveMQException { // Methods to send Large Messages---------------------------------------------------------------- - /** - * @param msgI - * @param handler - * @throws ActiveMQException - */ private void largeMessageSend(final boolean sendBlocking, final ICoreMessage msgI, final ClientProducerCredits credits, @@ -357,13 +347,8 @@ private void sendInitialLargeMessageHeader(Message msgI, } /** - * Used to send serverMessages through the bridges. No need to validate compression here since - * the message is only compressed at the client - * - * @param sendBlocking - * @param msgI - * @param handler - * @throws ActiveMQException + * Used to send serverMessages through the bridges. No need to validate compression here since the message is only + * compressed at the client */ private void largeMessageSendServer(final boolean sendBlocking, final ICoreMessage msgI, @@ -402,12 +387,6 @@ private void largeMessageSendServer(final boolean sendBlocking, } } - /** - * @param sendBlocking - * @param msgI - * @param handler - * @throws ActiveMQException - */ private void largeMessageSendBuffered(final boolean sendBlocking, final ICoreMessage msgI, final ClientProducerCredits credits, @@ -416,13 +395,6 @@ private void largeMessageSendBuffered(final boolean sendBlocking, largeMessageSendStreamed(sendBlocking, msgI, new ActiveMQBufferInputStream(msgI.getBodyBuffer()), credits, handler); } - /** - * @param sendBlocking - * @param msgI - * @param inputStreamParameter - * @param credits - * @throws ActiveMQException - */ private void largeMessageSendStreamed(final boolean sendBlocking, final ICoreMessage msgI, final InputStream inputStreamParameter, diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerInternal.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerInternal.java index 963f86fdbeb..35e06c32b75 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerInternal.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerInternal.java @@ -18,9 +18,6 @@ import org.apache.activemq.artemis.api.core.client.ClientProducer; -/** - * A ClientProducerInternal - */ public interface ClientProducerInternal extends ClientProducer { void cleanUp(); 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 fbef6f2ab1c..d5d5d60689e 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 @@ -227,7 +227,7 @@ public ClientSessionFactoryImpl(final ServerLocatorInternal serverLocator, this.callFailoverTimeout = locatorConfig.callFailoverTimeout; - // HORNETQ-1314 - if this in an in-vm connection then disable connection monitoring + // If this in an in-vm connection then disable connection monitoring if (connectorFactory.isReliable() && locatorConfig.clientFailureCheckPeriod == ActiveMQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD && locatorConfig.connectionTTL == ActiveMQClient.DEFAULT_CONNECTION_TTL) { @@ -488,9 +488,6 @@ private void interruptConnectAndCloseAllSessions(boolean close) { } } - /** - * @param close - */ private void closeCleanSessions(boolean close) { Set sessionsToClose; synchronized (sessions) { @@ -581,9 +578,6 @@ private void handleConnectionFailure(final Object connectionID, /** * TODO: Maybe this belongs to ActiveMQClientProtocolManager - * - * @param connectionID - * @param me */ private void failoverOrReconnect(final Object connectionID, final ActiveMQException me, @@ -896,9 +890,7 @@ private void callFailoverListeners(FailoverEventType type) { } } - /* - * Re-attach sessions all pre-existing sessions to the new remoting connection - */ + // Re-attach sessions all pre-existing sessions to the new remoting connection private boolean reconnectSessions(final Set sessionsToFailover, final RemotingConnection oldConnection, final ActiveMQException cause) { @@ -1226,10 +1218,8 @@ private void checkTransportKeys(final ConnectorFactory factory, final TransportC } /** - * It will connect to either primary or backup accordingly to the current configurations - * it will also switch to backup case it can't connect to primary and there's a backup configured - * - * @return + * It will connect to either primary or backup accordingly to the current configurations it will also switch to + * backup case it can't connect to primary and there's a backup configured */ protected Connection createTransportConnection() { Connection transportConnection = null; @@ -1443,11 +1433,7 @@ public synchronized void run() { send(); } - /** - * - */ public void send() { - clientProtocolManager.ping(connectionTTL); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryInternal.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryInternal.java index 0bab53041ad..a01319f01ca 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryInternal.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryInternal.java @@ -48,8 +48,8 @@ public interface ClientSessionFactoryInternal extends ClientSessionFactory { void connect(int reconnectAttempts) throws ActiveMQException; /** - * @deprecated This method is no longer acceptable to connect. - * Replaced by {@link ClientSessionFactoryInternal#connect(int)}. + * @deprecated This method is no longer acceptable to connect. Replaced by + * {@link ClientSessionFactoryInternal#connect(int)}. */ @Deprecated void connect(int reconnectAttempts, boolean failoverOnInitialConnection) throws ActiveMQException; 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 abda31340f3..3641ccf56f0 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 @@ -399,10 +399,6 @@ public void createTemporaryQueue(final String address, createTemporaryQueue(SimpleString.of(address), SimpleString.of(queueName), SimpleString.of(filter)); } - - /** New Queue API **/ - - @Deprecated @Override public void createQueue(final SimpleString address, @@ -572,15 +568,6 @@ public void createTemporaryQueue(final String address, final RoutingType routing createTemporaryQueue(SimpleString.of(address), routingType, SimpleString.of(queueName), SimpleString.of(filter)); } - /** - * Creates a non-temporary queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param durable whether the queue is durable or not - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Deprecated @Override public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable) throws ActiveMQException { @@ -596,54 +583,17 @@ public void createQueue(SimpleString address, RoutingType routingType, SimpleStr .setMaxConsumers(ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers())); } - /** - * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted - *

    - * Notice: you will get an exception if the address or the filter doesn't match to an already existent queue - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param durable if the queue is durable - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable) throws ActiveMQException { createSharedQueue(address, routingType, queueName, null, durable); } - /** - * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted - *

    - * Notice: you will get an exception if the address or the filter doesn't match to an already existent queue - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter whether the queue is durable or not - * @param durable if the queue is durable - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable) throws ActiveMQException { createSharedQueue(address, routingType, queueName, filter, durable, null, null, null, null); } - /** - * Creates Shared queue. A queue that will exist as long as there are consumers or is durable. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter whether the queue is durable or not - * @param durable if the queue is durable - * @param maxConsumers how many concurrent consumers will be allowed on this queue - * @param purgeOnNoConsumers whether to delete the contents of the queue when the last consumer disconnects - * @param exclusive if the queue is exclusive queue - * @param lastValue if the queue is last value queue - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Deprecated @Override public void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, @@ -659,42 +609,17 @@ public void createSharedQueue(SimpleString address, RoutingType routingType, Sim createSharedQueue(address, queueName, queueAttributes); } - /** - * Creates Shared queue. A queue that will exist as long as there are consumers or is durable. - * - * @param address the queue will be bound to this address - * @param queueName the name of the queue - * @param queueAttributes attributes for the queue - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Deprecated @Override public void createSharedQueue(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes) throws ActiveMQException { createSharedQueue(queueAttributes.toQueueConfiguration().setName(queueName).setAddress(address)); } - /** - * Creates a non-temporary queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param durable whether the queue is durable or not - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createQueue(String address, RoutingType routingType, String queueName, boolean durable) throws ActiveMQException { createQueue(SimpleString.of(address), routingType, SimpleString.of(queueName), durable); } - /** - * Creates a non-temporary queue non-durable queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Deprecated @Override public void createQueue(String address, RoutingType routingType, String queueName) throws ActiveMQException { @@ -710,14 +635,6 @@ public void createQueue(String address, RoutingType routingType, String queueNam .setMaxConsumers(ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers())); } - /** - * Creates a non-temporary queue non-durable queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Deprecated @Override public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName) throws ActiveMQException { @@ -733,16 +650,6 @@ public void createQueue(SimpleString address, RoutingType routingType, SimpleStr .setMaxConsumers(ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers())); } - /** - * Creates a non-temporary queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Deprecated @Override public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, @@ -759,23 +666,12 @@ public void createQueue(SimpleString address, RoutingType routingType, SimpleStr .setMaxConsumers(ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers())); } - /** - * Creates a non-temporaryqueue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable) throws ActiveMQException { createQueue(SimpleString.of(address), routingType, SimpleString.of(queueName), SimpleString.of(filter), durable); } - @Override public void deleteQueue(final SimpleString queueName) throws ActiveMQException { checkClosed(); @@ -887,14 +783,12 @@ public ClientConsumer createConsumer(final SimpleString queueName, } /** - * Note, we DO NOT currently support direct consumers (i.e. consumers where delivery occurs on - * the remoting thread). + * Note, we DO NOT currently support direct consumers (i.e. consumers where delivery occurs on the remoting thread). *

    - * Direct consumers have issues with blocking and failover. E.g. if direct then inside - * MessageHandler call a blocking method like rollback or acknowledge (blocking) This can block - * until failover completes, which disallows the thread to be used to deliver any responses to - * the client during that period, so failover won't occur. If we want direct consumers we need to - * rethink how they work. + * Direct consumers have issues with blocking and failover. E.g. if direct then inside MessageHandler call a blocking + * method like rollback or acknowledge (blocking) This can block until failover completes, which disallows the thread + * to be used to deliver any responses to the client during that period, so failover won't occur. If we want direct + * consumers we need to rethink how they work. */ @Override public ClientConsumer createConsumer(final SimpleString queueName, @@ -965,18 +859,16 @@ public void commit(boolean block) throws ActiveMQException { logger.trace("Sending commit"); - /* - * we have failed over since any work was done so we should rollback - * */ + // we have failed over since any work was done so we should rollback if (rollbackOnly) { rollbackOnFailover(true); } flushAcks(); /* - * if we have failed over whilst flushing the acks then we should rollback and throw exception before attempting to - * commit as committing might actually commit something but we we wouldn't know and rollback after the commit - * */ + * if we have failed over whilst flushing the acks then we should rollback and throw exception before attempting to + * commit as committing might actually commit something but we we wouldn't know and rollback after the commit + */ if (rollbackOnly) { rollbackOnFailover(true); } @@ -1201,9 +1093,6 @@ public int getCompressionLevel() { return compressionLevel; } - /** - * @return the cacheLargeMessageClient - */ @Override public boolean isCacheLargeMessageClient() { return cacheLargeMessageClient; @@ -1214,9 +1103,6 @@ public String getName() { return name; } - /** - * Acknowledges all messages received by the consumer so far. - */ @Override public void acknowledge(final ClientConsumer consumer, final Message message) throws ActiveMQException { // if we're pre-acknowledging then we don't need to do anything @@ -2001,14 +1887,6 @@ public String toString() { Integer.toHexString(hashCode()); } - /** - * @param queueName - * @param filterString - * @param windowSize - * @param browseOnly - * @return - * @throws ActiveMQException - */ private ClientConsumer internalCreateConsumer(final SimpleString queueName, final SimpleString filterString, final int priority, @@ -2125,8 +2003,6 @@ private void cleanUpChildren() throws ActiveMQException { /** * Not part of the interface, used on tests only - * - * @return */ public Set cloneProducers() { Set producersClone; @@ -2139,8 +2015,6 @@ public Set cloneProducers() { /** * Not part of the interface, used on tests only - * - * @return */ public Set cloneConsumers() { synchronized (consumers) { @@ -2175,14 +2049,10 @@ private void flushAcks() throws ActiveMQException { } /** - * If you ever tried to debug XIDs you will know what this is about. - * This will serialize and deserialize the XID to the same way it's going to be printed on server logs - * or print-data. + * If you ever tried to debug XIDs you will know what this is about. This will serialize and deserialize the XID to + * the same way it's going to be printed on server logs or print-data. *

    * This will convert to the same XID deserialized on the Server, hence we will be able to debug eventual stuff - * - * @param xid - * @return */ public static Object convert(Xid xid) { ActiveMQBuffer buffer = ActiveMQBuffers.dynamicBuffer(200); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionInternal.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionInternal.java index 0c13fbdba6e..9f79fe0e939 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionInternal.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionInternal.java @@ -104,23 +104,19 @@ void handleReceiveContinuation(ConsumerContext consumerID, void markRollbackOnly(); /** - * This is used internally to control and educate the user - * about using the thread boundaries properly. - * if more than one thread is using the session simultaneously - * this will generate a big warning on the docs. - * There are a limited number of places where we can call this such as acks and sends. otherwise we - * could get false warns + * This is used internally to control and educate the user about using the thread boundaries properly. if more than + * one thread is using the session simultaneously this will generate a big warning on the docs. There are a limited + * number of places where we can call this such as acks and sends. otherwise we could get false warns */ void startCall(); /** + * Opposite of {@link #startCall()} + * * @see #startCall() */ void endCall(); - /** - * Sets a stop signal to true. This will cancel - */ void setStopSignal(); boolean isConfirmationWindowEnabled(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java index 76dd273bff3..92be797a1ee 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java @@ -43,9 +43,6 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll this.bufferDelegate = bufferDelegate; } - /** - * - */ @Override public void discardUnusedPackets() { bufferDelegate.discardUnusedPackets(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageController.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageController.java index 0565c83647b..f943ea40bc7 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageController.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageController.java @@ -24,7 +24,7 @@ public interface LargeMessageController extends ActiveMQBuffer { /** - * Returns the size of this buffer. + * {@return the size of this buffer.} */ long getSize(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImpl.java index 56736afbfd0..28b679cb056 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImpl.java @@ -17,7 +17,6 @@ package org.apache.activemq.artemis.core.client.impl; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -43,11 +42,10 @@ import org.apache.activemq.artemis.utils.UTF8Util; /** - * This class aggregates several {@link org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage} - * as it was being handled - * by a single buffer. This buffer can be consumed as messages are arriving, and it will hold the - * packets until they are read using the ChannelBuffer interface, or the setOutputStream or - * saveStream are called. + * This class aggregates several + * {@link org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage} as it was + * being handled by a single buffer. This buffer can be consumed as messages are arriving, and it will hold the packets + * until they are read using the ChannelBuffer interface, or the setOutputStream or saveStream are called. */ public class LargeMessageControllerImpl implements LargeMessageController { @@ -272,7 +270,6 @@ public synchronized void saveBuffer(final OutputStream output) throws ActiveMQEx /** * @param timeWait Milliseconds to Wait. 0 means forever - * @throws ActiveMQException */ @Override public synchronized boolean waitCompletion(final long timeWait) throws ActiveMQException { @@ -325,9 +322,6 @@ public LargeData take() throws InterruptedException { return largeData; } - /** - * @throws ActiveMQException - */ private void checkException() throws ActiveMQException { // it's not needed to copy it as we never set it back to null // once the exception is set, the controller is pretty much useless @@ -899,14 +893,12 @@ public void writeBytes(final ByteBuffer src) { } /** - * Transfers the specified source buffer's data to this buffer starting at - * the current {@code writerIndex} until the source buffer's position - * reaches its limit, and increases the {@code writerIndex} by the - * number of the transferred bytes. + * Transfers the specified source buffer's data to this buffer starting at the current {@code writerIndex} until the + * source buffer's position reaches its limit, and increases the {@code writerIndex} by the number of the transferred + * bytes. * * @param src The source buffer - * @throws IndexOutOfBoundsException if {@code src.remaining()} is greater than - * {@code this.writableBytes} + * @throws IndexOutOfBoundsException if {@code src.remaining()} is greater than {@code this.writableBytes} */ @Override public void writeBytes(ByteBuf src, int srcIndex, int length) { @@ -1103,11 +1095,6 @@ public ActiveMQBuffer slice(final int index, final int length) { throw new UnsupportedOperationException(); } - /** - * @param output - * @param packet - * @throws ActiveMQException - */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); @@ -1244,9 +1231,6 @@ public void cachePackage(final byte[] body) throws Exception { close(); } - /** - * @throws FileNotFoundException - */ private FileChannel checkOpen() throws IOException { FileChannel channel = cachedChannel; if (cachedFile != null || !channel.isOpen()) { 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 a2288344929..f1fe47a867d 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 @@ -78,8 +78,8 @@ import org.slf4j.LoggerFactory; /** - * This is the implementation of {@link org.apache.activemq.artemis.api.core.client.ServerLocator} and all - * the proper javadoc is located on that interface. + * This is the implementation of {@link org.apache.activemq.artemis.api.core.client.ServerLocator} and all the proper + * javadoc is located on that interface. */ public final class ServerLocatorImpl implements ServerLocatorInternal, DiscoveryListener { @@ -125,10 +125,9 @@ private enum STATE { private volatile boolean receivedTopology; - - /** This specifies serverLocator.connect was used, - * which means it's a cluster connection. - * We should not use retries */ + /** + * This specifies serverLocator.connect was used, which means it's a cluster connection. We should not use retries + */ private volatile boolean disableDiscoveryRetries = false; // if the system should shutdown the pool when shutting down @@ -168,12 +167,16 @@ private enum STATE { private TransportConfiguration clusterTransportConfiguration; - /** For tests only */ + /** + * For tests only + */ public DiscoveryGroup getDiscoveryGroup() { return discoveryGroup; } - /** For tests only */ + /** + * For tests only + */ public Set getFactories() { return factories; } @@ -376,8 +379,6 @@ public ServerLocatorImpl(final boolean useHA, final DiscoveryGroupConfiguration /** * Create a ServerLocatorImpl using a static list of servers - * - * @param transportConfigs */ public ServerLocatorImpl(final boolean useHA, final TransportConfiguration... transportConfigs) { this(new Topology(null), useHA, null, transportConfigs); @@ -399,8 +400,6 @@ public ServerLocatorImpl(final Topology topology, /** * Create a ServerLocatorImpl using a static list of servers - * - * @param transportConfigs */ public ServerLocatorImpl(final Topology topology, final boolean useHA, @@ -415,9 +414,7 @@ public void resetToInitialConnectors() { topology.clear(); } - /* - * I'm not using isAllInVM here otherwsie BeanProperties would translate this as a property for the URL - */ + // I'm not using isAllInVM here otherwsie BeanProperties would translate this as a property for the URL @Override public boolean allInVM() { for (TransportConfiguration config : getStaticTransportConfigurations()) { @@ -874,10 +871,6 @@ public boolean isHA() { return ha; } - /** - * @param interceptorList a comma separated string of incoming interceptor class names to be used. Each interceptor needs a default Constructor to be used with this method. - * @return this - */ @Override public ServerLocator setIncomingInterceptorList(String interceptorList) { feedInterceptors(incomingInterceptors, interceptorList); @@ -889,10 +882,6 @@ public String getIncomingInterceptorList() { return fromInterceptors(incomingInterceptors); } - /** - * @param interceptorList a comma separated string of incoming interceptor class names to be used. Each interceptor needs a default Constructor to be used with this method. - * @return this - */ @Override public ServerLocator setOutgoingInterceptorList(String interceptorList) { feedInterceptors(outgoingInterceptors, interceptorList); @@ -1514,9 +1503,8 @@ private void doClose(final boolean sendClose) { } /** - * This is directly called when the connection to the node is gone, - * or when the node sends a disconnection. - * Look for callers of this method! + * This is directly called when the connection to the node is gone, or when the node sends a disconnection. Look for + * callers of this method! */ @Override public void notifyNodeDown(final long eventTime, final String nodeID, boolean disconnect) { @@ -1722,8 +1710,6 @@ public void removeClusterTopologyListener(final ClusterTopologyListener listener /** * for tests only and not part of the public interface. Do not use it. - * - * @return */ public TransportConfiguration[] getInitialConnectors() { return initialConnectors; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorInternal.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorInternal.java index 2c145c6c0c9..b39cfd58ae4 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorInternal.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorInternal.java @@ -37,7 +37,7 @@ public interface ServerLocatorInternal extends ServerLocator { /** * Used to better identify Cluster Connection Locators on logs. To facilitate eventual debugging. - * + *

    * This method used to be on tests interface, but I'm now making it part of the public interface since */ ServerLocatorInternal setIdentity(String identity); @@ -55,8 +55,6 @@ public interface ServerLocatorInternal extends ServerLocator { /** * Like {@link #connect()} but it does not log warnings if it fails to connect. - * - * @throws ActiveMQException */ ClientSessionFactoryInternal connectNoWarnings() throws ActiveMQException; @@ -68,12 +66,14 @@ void notifyNodeUp(long uniqueEventID, boolean last); /** + * Notify this about a node down event. + * * @param uniqueEventID 0 means get the previous ID +1 - * @param nodeID */ default void notifyNodeDown(long uniqueEventID, String nodeID) { notifyNodeDown(uniqueEventID, nodeID, false); } + void notifyNodeDown(long uniqueEventID, String nodeID, boolean disconnect); ServerLocatorInternal setClusterConnection(boolean clusterConnection); 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 d28e2c628a7..99ff680447d 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 @@ -36,6 +36,9 @@ import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; +/** + * A {@code Topology} describes the other cluster nodes that this server knows about. + */ public final class Topology { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -47,19 +50,15 @@ public final class Topology { /** * Used to debug operations. *

    - * Someone may argue this is not needed. But it's impossible to debug anything related to - * topology without knowing what node or what object missed a Topology update. Hence I added some - * information to locate debugging here. + * Someone may argue this is not needed. But it's impossible to debug anything related to topology without knowing + * what node or what object missed a Topology update. Hence I added some information to locate debugging here. */ private volatile Object owner; private final TopologyManager manager; /** - * topology describes the other cluster nodes that this server knows about: - * - * keys are node IDs - * values are a pair of live/backup transport configurations + * Keys are node IDs. Values are a pair of primary/backup transport configurations. */ private final Map topology; @@ -143,8 +142,6 @@ public void updateAsPrimary(final String nodeId, final TopologyMemberImpl member /** * After the node is started, it will resend the notifyPrimary a couple of times to avoid gossip between two servers - * - * @param nodeId */ public void resendNode(final String nodeId) { synchronized (this) { @@ -187,11 +184,11 @@ public TopologyMemberImpl updateBackup(final TopologyMemberImpl memberInput) { } /** - * @param uniqueEventID an unique identifier for when the change was made. We will use current - * time millis for starts, and a ++ of that number for shutdown. - * @param nodeId - * @param memberInput - * @return {@code true} if an update did take place. Note that backups are *always* updated. + * Update a member + * + * @param uniqueEventID an unique identifier for when the change was made. We will use current time millis for + * starts, and a ++ of that number for shutdown. + * @return {@code true} if an update did take place. Note that backups are *always* updated */ public boolean updateMember(final long uniqueEventID, final String nodeId, final TopologyMemberImpl memberInput) { @@ -260,10 +257,6 @@ public boolean updateMember(final long uniqueEventID, final String nodeId, final } } - /** - * @param nodeId - * @param memberToSend - */ private void sendMemberUp(final String nodeId, final TopologyMemberImpl memberToSend) { final List copy = copyListeners(); @@ -288,9 +281,6 @@ private void sendMemberUp(final String nodeId, final TopologyMemberImpl memberTo } } - /** - * @return - */ private List copyListeners() { List listenersCopy; synchronized (topologyListeners) { @@ -429,9 +419,9 @@ private int members() { } /** - * The owner exists mainly for debug purposes. - * When enabling logging and tracing, the Topology updates will include the owner, what will enable to identify - * what instances are receiving the updates, what will enable better debugging. + * The owner exists mainly for debug purposes. When enabling logging and tracing, the Topology updates will include + * the owner, what will enable to identify what instances are receiving the updates, what will enable better + * debugging. */ public void setOwner(final Object owner) { this.owner = owner; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java index 48422decd09..5eb30b2a1e4 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java @@ -99,9 +99,6 @@ public String getScaleDownGroupName() { return scaleDownGroupName; } - /** - * @param uniqueEventID the uniqueEventID to set - */ public void setUniqueEventID(final long uniqueEventID) { this.uniqueEventID = uniqueEventID; } @@ -111,11 +108,10 @@ public Pair getConnector() { } /** - * We only need to check if the connection point to the same node, - * don't need to compare the whole params map. + * We only need to check if the connection point to the same node, don't need to compare the whole params map. + * * @param connection The connection to the target node - * @return true if the connection point to the same node - * as this member represents. + * @return true if the connection point to the same node as this member represents. */ @Override public boolean isMember(RemotingConnection connection) { 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 00f3ddb9ba2..2a8201e867b 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 @@ -46,9 +46,9 @@ /** * This class is used to search for members on the cluster through the opaque interface {@link BroadcastEndpoint}. - * + *

    * There are two current implementations, and that's probably all we will ever need. - * + *

    * We will probably keep both interfaces for a while as UDP is a simple solution requiring no extra dependencies which * is suitable for users looking for embedded solutions. */ @@ -82,13 +82,6 @@ public final class DiscoveryGroup implements ActiveMQComponent { /** * This is the main constructor, intended to be used - * - * @param nodeID - * @param name - * @param timeout - * @param endpointFactory - * @param service - * @throws Exception */ public DiscoveryGroup(final String nodeID, final String name, @@ -139,8 +132,8 @@ public ThreadFactory run() { } /** - * This will start the DiscoveryRunnable and run it directly. - * This is useful for a test process where we need this execution blocking a thread. + * This will start the DiscoveryRunnable and run it directly. This is useful for a test process where we need this + * execution blocking a thread. */ public void internalRunning() throws Exception { endpoint.openClient(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/config/TransformerConfiguration.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/config/TransformerConfiguration.java index 8dcaa3356d3..98fa2f3ed65 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/config/TransformerConfiguration.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/config/TransformerConfiguration.java @@ -57,8 +57,8 @@ public Map getProperties() { } /** - * This method returns a {@code TransformerConfiguration} created from the JSON-formatted input {@code String}. - * The input should contain these entries: + * This method returns a {@code TransformerConfiguration} created from the JSON-formatted input {@code String}. The + * input should contain these entries: * *

      *
    • class-name - a string value, @@ -104,6 +104,8 @@ public JsonObjectBuilder createJsonObjectBuilder() { } /** + * add properties to this {@code TransportConfiguration} + * * @param properties the properties to set */ public TransformerConfiguration setProperties(final Map properties) { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/LargeBodyReader.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/LargeBodyReader.java index 7491aa529ac..042314e7da9 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/LargeBodyReader.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/LargeBodyReader.java @@ -22,9 +22,9 @@ /** * Class used to readInto message body into buffers. - *
      + *

      * Used to send large streams over the wire - * + *

      * None of these methods should be caleld from Clients */ public interface LargeBodyReader extends AutoCloseable { @@ -36,14 +36,14 @@ public interface LargeBodyReader extends AutoCloseable { /** * This method must not be called directly by ActiveMQ Artemis clients. - * + *

      * This is the reading position. */ void position(long position) throws ActiveMQException; /** * This method must not be called directly by ActiveMQ Artemis clients. - * + *

      * This is the reading position. */ long position(); 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 d4f4c89c78d..c5d822175fe 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 @@ -63,8 +63,6 @@ import static org.apache.activemq.artemis.utils.ByteUtil.ensureExactWritable; -/** Note: you shouldn't change properties using multi-threads. Change your properties before you can send it to multiple - * consumers */ public class CoreMessage extends RefCountMessage implements ICoreMessage { public static final int BUFFER_HEADER_SPACE = PacketImpl.PACKET_HEADERS_SIZE; @@ -76,8 +74,10 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage { // There's an integer with the number of bytes for the body public static final int BODY_OFFSET = DataConstants.SIZE_INT; - /** That is the readInto for the whole message, including properties.. - it does not include the buffer for the Packet send and receive header on core protocol */ + /** + * That is the readInto for the whole message, including properties. It does not include the buffer for the Packet + * send and receive header on core protocol + */ protected ByteBuf buffer; private volatile boolean validBuffer = false; @@ -99,7 +99,7 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage { protected boolean paged; /** - * GMT milliseconds at which this message expires. 0 means never expires * + * GMT milliseconds at which this message expires. 0 means never expires */ private long expiration; @@ -140,13 +140,17 @@ public String getProtocolName() { return ActiveMQClient.DEFAULT_CORE_PROTOCOL; } - /** On core there's no delivery annotation */ + /** + * On core there's no delivery annotation + */ @Override public Object getAnnotation(SimpleString key) { return getObjectProperty(key); } - /** On core there's no delivery annotation */ + /** + * On core there's no delivery annotation + */ @Override public Object removeAnnotation(SimpleString key) { return removeProperty(key); @@ -226,7 +230,9 @@ public void receiveBuffer(ByteBuf buffer) { decode(false); } - /** This will fix the incoming body of 1.x messages */ + /** + * This will fix the incoming body of 1.x messages + */ @Override public void receiveBuffer_1X(ByteBuf buffer) { this.buffer = buffer; @@ -248,9 +254,8 @@ public int getBodyBufferSize() { } /** - * This will return the proper buffer to represent the data of the Message. If compressed it will decompress. - * If large, it will read from the file or streaming. - * @return + * This will return the proper buffer to represent the data of the Message. If compressed it will decompress. If + * large, it will read from the file or streaming. */ @Override public ActiveMQBuffer getDataBuffer() { @@ -346,7 +351,6 @@ public Message setCorrelationID(final Object correlationID) { } /** - * @param sendBuffer * @param deliveryCount Some protocols (AMQP) will have this as part of the message. ignored on core */ @Override @@ -485,8 +489,10 @@ protected CoreMessage(CoreMessage other, TypedProperties copyProperties) { } } - /** This method serves as a purpose of extension. - * Large Message on a Core Message will have to set the messageID on the attached NewLargeMessage */ + /** + * This method serves as a purpose of extension. Large Message on a Core Message will have to set the messageID on + * the attached NewLargeMessage + */ protected void internalSetMessageID(final long messageID) { this.messageID = messageID; } @@ -1173,9 +1179,9 @@ public boolean hasScheduledDeliveryTime() { } /** - * Differently from {@link #containsProperty(SimpleString)}, this method can save decoding the message, - * performing a search of the {@code key} property and falling back to {@link #containsProperty(SimpleString)} - * if not possible or if already decoded. + * Differently from {@link #containsProperty(SimpleString)}, this method can save decoding the message, performing a + * search of the {@code key} property and falling back to {@link #containsProperty(SimpleString)} if not possible or + * if already decoded. */ public boolean searchProperty(SimpleString key) { Objects.requireNonNull(key, "key cannot be null"); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessagePersister.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessagePersister.java index 0dca6d34907..78211bf6f65 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessagePersister.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessagePersister.java @@ -29,7 +29,9 @@ public class CoreMessagePersister implements Persister { private static CoreMessagePersister theInstance; - /** This is a hook for testing */ + /** + * This is a hook for testing + */ public static void registerPersister(CoreMessagePersister newPersister) { theInstance = newPersister; } @@ -60,7 +62,9 @@ public int getEncodeSize(Message record) { } - /** Sub classes must add the first short as the protocol-id */ + /** + * Sub classes must add the first short as the protocol-id + */ @Override public void encode(ActiveMQBuffer buffer, Message record) { buffer.writeByte((byte)1); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/MessageInternalImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/MessageInternalImpl.java index 1081950f552..c84ed1e1e10 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/MessageInternalImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/MessageInternalImpl.java @@ -121,10 +121,6 @@ public void messageChanged() { throw new UnsupportedOperationException(); } - /** - * Used to calculate what is the delivery time. - * Return null if not scheduled. - */ @Override public Long getScheduledDeliveryTime() { return message.getScheduledDeliveryTime(); @@ -142,9 +138,7 @@ public Message setReplyTo(SimpleString address) { } /** - * The buffer will belong to this message, until release is called. - * - * @param buffer + * The buffer will belong to this message until release is called. */ public Message setBuffer(ByteBuf buffer) { throw new UnsupportedOperationException(); @@ -154,19 +148,11 @@ public ByteBuf getBuffer() { return message.getBuffer(); } - /** - * It will generate a new instance of the message encode, being a deep copy, new properties, new everything - */ @Override public Message copy() { return message.copy(); } - /** - * It will generate a new instance of the message encode, being a deep copy, new properties, new everything - * - * @param newID - */ @Override public Message copy(long newID) { return message.copy(newID); @@ -177,11 +163,6 @@ public Message copy(long newID, boolean isDLQorExpiry) { return message.copy(newID, isDLQorExpiry); } - /** - * Returns the messageID. - *
      - * The messageID is set when the message is handled by the server. - */ @Override public long getMessageID() { return message.getMessageID(); @@ -193,33 +174,17 @@ public Message setMessageID(long id) { return this; } - /** - * Returns the expiration time of this message. - */ @Override public long getExpiration() { return message.getExpiration(); } - /** - * Sets the expiration of this message. - * - * @param expiration expiration time - */ @Override public Message setExpiration(long expiration) { message.setExpiration(expiration); return this; } - /** - * This represents historically the JMSMessageID. - * We had in the past used this for the MessageID that was sent on core messages... - * - * later on when we added AMQP this name clashed with AMQPMessage.getUserID(); - * - * @return the user id - */ @Override public Object getUserID() { return message.getUserID(); @@ -231,19 +196,11 @@ public Message setUserID(Object userID) { return this; } - /** - * Returns whether this message is durable or not. - */ @Override public boolean isDurable() { return message.isDurable(); } - /** - * Sets whether this message is durable or not. - * - * @param durable {@code true} to flag this message as durable, {@code false} else - */ @Override public Message setDurable(boolean durable) { message.setDurable(durable); @@ -288,45 +245,22 @@ public Message setTimestamp(long timestamp) { return this; } - /** - * Returns the message priority. - *

      - * Values range from 0 (less priority) to 9 (more priority) inclusive. - */ @Override public byte getPriority() { return message.getPriority(); } - /** - * Sets the message priority. - *

      - * Value must be between 0 and 9 inclusive. - * - * @param priority the new message priority - */ @Override public Message setPriority(byte priority) { message.setPriority(priority); return this; } - /** - * Used to receive this message from an encoded medium buffer - * - * @param buffer - */ @Override public void receiveBuffer(ByteBuf buffer) { throw new UnsupportedOperationException(); } - /** - * Used to send this message to an encoded medium buffer. - * - * @param buffer the buffer used. - * @param deliveryCount Some protocols (AMQP) will have this as part of the message. - */ @Override public void sendBuffer(ByteBuf buffer, int deliveryCount) { throw new UnsupportedOperationException(); @@ -624,17 +558,11 @@ public Message putStringProperty(SimpleString key, String value) { return message.putStringProperty(key, value); } - /** - * Returns the size of the encoded message. - */ @Override public int getEncodeSize() { return message.getEncodeSize(); } - /** - * Returns all the names of the properties for this message. - */ @Override public Set getPropertyNames() { return message.getPropertyNames(); @@ -685,19 +613,11 @@ public int durableDown() { throw new UnsupportedOperationException(); } - /** - * This should make you convert your message into Core format. - */ @Override public ICoreMessage toCore() { return message.toCore(); } - /** - * This should make you convert your message into Core format. - * - * @param coreMessageObjectPools - */ @Override public ICoreMessage toCore(CoreMessageObjectPools coreMessageObjectPools) { return message.toCore(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/Channel.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/Channel.java index add18c55875..a0b73053514 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/Channel.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/Channel.java @@ -21,29 +21,28 @@ import org.apache.activemq.artemis.api.core.ActiveMQException; /** - * A channel is a way of interleaving data meant for different endpoints over the same {@link org.apache.activemq.artemis.core.protocol.core.CoreRemotingConnection}. + * A channel is a way of interleaving data meant for different endpoints over the same + * {@link org.apache.activemq.artemis.core.protocol.core.CoreRemotingConnection}. *

      - * Any packet sent will have its channel id set to the specific channel sending so it can be routed to its correct channel - * when received by the {@link org.apache.activemq.artemis.core.protocol.core.CoreRemotingConnection}. see {@link org.apache.activemq.artemis.core.protocol.core.Packet#setChannelID(long)}. + * Any packet sent will have its channel id set to the specific channel sending so it can be routed to its correct + * channel when received by the {@link org.apache.activemq.artemis.core.protocol.core.CoreRemotingConnection}. see + * {@link org.apache.activemq.artemis.core.protocol.core.Packet#setChannelID(long)}. *

      - * Each Channel should will forward any packets received to its {@link org.apache.activemq.artemis.core.protocol.core.ChannelHandler}. + * Each Channel should will forward any packets received to its + * {@link org.apache.activemq.artemis.core.protocol.core.ChannelHandler}. *

      * A Channel *does not* support concurrent access by more than one thread! */ public interface Channel { /** - * Returns the id of this channel. - * - * @return the id + * {@return the id of this channel} */ long getID(); /** - * This number increases every time the channel reconnects successfully. - * This is used to guarantee the integrity of the channel on sequential commands such as large messages. - * - * @return + * This number increases every time the channel reconnects successfully. This is used to guarantee the integrity of + * the channel on sequential commands such as large messages. */ int getReconnectID(); @@ -69,8 +68,7 @@ default boolean requireSpecialVotingHandling() { * Sends a packet on this channel. * * @param packet the packet to send - * @return false if the packet was rejected by an outgoing interceptor; true if the send was - * successful + * @return false if the packet was rejected by an outgoing interceptor; {@code true} if the send was successful */ boolean send(Packet packet); @@ -78,8 +76,7 @@ default boolean requireSpecialVotingHandling() { * Sends a packet on this channel. * * @param packet the packet to send - * @return false if the packet was rejected by an outgoing interceptor; true if the send was - * successful + * @return false if the packet was rejected by an outgoing interceptor; {@code true} if the send was successful */ boolean send(Packet packet, int reconnectID); @@ -87,14 +84,14 @@ default boolean requireSpecialVotingHandling() { * Sends a packet on this channel using batching algorithm if appropriate * * @param packet the packet to send - * @return false if the packet was rejected by an outgoing interceptor; true if the send was - * successful + * @return false if the packet was rejected by an outgoing interceptor; {@code true} if the send was successful */ boolean sendBatched(Packet packet); /** - * Similarly to {@code flushConnection} on {@link #send(Packet, boolean)}, it requests - * any un-flushed previous sent packets to be flushed to the underlying connection.
      + * Similarly to {@code flushConnection} on {@link #send(Packet, boolean)}, it requests any un-flushed previous sent + * packets to be flushed to the underlying connection. + *

      * It can be a no-op in case of InVM transports, because they would likely to flush already on each send. */ void flushConnection(); @@ -103,11 +100,10 @@ default boolean requireSpecialVotingHandling() { * Sends a packet on this channel, but request it to be flushed (along with the un-flushed previous ones) only iff * {@code flushConnection} is {@code true}. * - * @param packet the packet to send - * @param flushConnection if {@code true} requests this {@code packet} and any un-flushed previous sent one to be flushed - * to the underlying connection - * @return false if the packet was rejected by an outgoing interceptor; true if the send was - * successful + * @param packet the packet to send + * @param flushConnection if {@code true} requests this {@code packet} and any un-flushed previous sent one to be + * flushed to the underlying connection + * @return false if the packet was rejected by an outgoing interceptor; {@code true} if the send was successful */ boolean send(Packet packet, boolean flushConnection); @@ -115,14 +111,12 @@ default boolean requireSpecialVotingHandling() { * Sends a packet on this channel and then blocks until it has been written to the connection. * * @param packet the packet to send - * @return false if the packet was rejected by an outgoing interceptor; true if the send was - * successful + * @return false if the packet was rejected by an outgoing interceptor; {@code true} if the send was successful */ boolean sendAndFlush(Packet packet); /** - * Sends a packet on this channel and then blocks until a response is received or a timeout - * occurs. + * Sends a packet on this channel and then blocks until a response is received or a timeout occurs. * * @param packet the packet to send * @param expectedPacket the packet being expected. @@ -132,8 +126,7 @@ default boolean requireSpecialVotingHandling() { Packet sendBlocking(Packet packet, byte expectedPacket) throws ActiveMQException; /** - * Sends a packet on this channel and then blocks until a response is received or a timeout - * occurs. + * Sends a packet on this channel and then blocks until a response is received or a timeout occurs. * * @param packet the packet to send * @param expectedPacket the packet being expected. @@ -145,16 +138,16 @@ default boolean requireSpecialVotingHandling() { Packet sendBlocking(Packet packet, int reconnectID, byte expectedPacket, long timeout, boolean failOnTimeout) throws ActiveMQException; /** - * Sets the {@link org.apache.activemq.artemis.core.protocol.core.ChannelHandler} that this channel should - * forward received packets to. + * Sets the {@link org.apache.activemq.artemis.core.protocol.core.ChannelHandler} that this channel should forward + * received packets to. * * @param handler the handler */ void setHandler(ChannelHandler handler); /** - * Gets the {@link org.apache.activemq.artemis.core.protocol.core.ChannelHandler} that this channel should - * forward received packets to. + * Gets the {@link org.apache.activemq.artemis.core.protocol.core.ChannelHandler} that this channel should forward + * received packets to. * * @return the current channel handler */ @@ -188,16 +181,15 @@ default boolean requireSpecialVotingHandling() { void replayCommands(int lastConfirmedCommandID); /** - * returns the last confirmed packet command id - * - * @return the id + * {@return the last confirmed packet command id} */ int getLastConfirmedCommandID(); /** - * queries if this channel is locked. This method is designed for use in monitoring of the system state, not for synchronization control. + * queries if this channel is locked. This method is designed for use in monitoring of the system state, not for + * synchronization control. * - * @return true it the channel is locked and false otherwise + * @return {@code true} it the channel is locked and false otherwise */ boolean isLocked(); @@ -214,24 +206,24 @@ default boolean requireSpecialVotingHandling() { void unlock(); /** - * forces any {@link org.apache.activemq.artemis.core.protocol.core.Channel#sendBlocking(Packet, byte)} request to return with an exception. + * forces any {@link org.apache.activemq.artemis.core.protocol.core.Channel#sendBlocking(Packet, byte)} request to + * return with an exception. */ void returnBlocking(); /** - * forces any {@link org.apache.activemq.artemis.core.protocol.core.Channel#sendBlocking(Packet, byte)} request to return with an exception. + * forces any {@link org.apache.activemq.artemis.core.protocol.core.Channel#sendBlocking(Packet, byte)} request to + * return with an exception. */ void returnBlocking(Throwable cause); /** - * returns the channel lock - * - * @return the lock + * {@return the channel lock} */ Lock getLock(); /** - * returns the {@link CoreRemotingConnection} being used by the channel + * {@return the {@link CoreRemotingConnection} being used by the channel} */ CoreRemotingConnection getConnection(); @@ -258,10 +250,11 @@ default boolean requireSpecialVotingHandling() { void flushConfirmations(); /** - * Called by {@link org.apache.activemq.artemis.core.protocol.core.CoreRemotingConnection} when a packet is received. + * Called by {@link org.apache.activemq.artemis.core.protocol.core.CoreRemotingConnection} when a packet is + * received. *

      - * This method should then call its {@link org.apache.activemq.artemis.core.protocol.core.ChannelHandler} after appropriate processing of - * the packet + * This method should then call its {@link org.apache.activemq.artemis.core.protocol.core.ChannelHandler} after + * appropriate processing of the packet * * @param packet the packet to process. */ @@ -273,14 +266,12 @@ default boolean requireSpecialVotingHandling() { void clearCommands(); /** - * returns the confirmation window size this channel is using. - * - * @return the window size + * {@return the confirmation window size this channel is using} */ int getConfirmationWindowSize(); /** - * notifies the channel if it is transferring its connection. When true it is illegal to send messages. + * notifies the channel if it is transferring its connection. When {@code true} it is illegal to send messages. * * @param transferring whether the channel is transferring */ diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/ChannelHandler.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/ChannelHandler.java index 4eef1813f42..2c50530c5eb 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/ChannelHandler.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/ChannelHandler.java @@ -17,8 +17,8 @@ package org.apache.activemq.artemis.core.protocol.core; /** - * A ChannelHandler is used by {@link Channel}. When a channel receives a packet it will call its handler to deal with the - * packet. + * A ChannelHandler is used by {@link Channel}. When a channel receives a packet it will call its handler to deal with + * the packet. */ public interface ChannelHandler { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/CoreRemotingConnection.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/CoreRemotingConnection.java index 3f8699b5b8f..30ab0532f61 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/CoreRemotingConnection.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/CoreRemotingConnection.java @@ -26,8 +26,8 @@ public interface CoreRemotingConnection extends RemotingConnection { /** - * The client protocol used on the communication. - * This will determine if the client has support for certain packet types + * The client protocol used on the communication. This will determine if the client has support for certain packet + * types */ int getChannelVersion(); @@ -82,8 +82,8 @@ default boolean isBeforeProducerMetricsChanged() { } /** - * Sets the client protocol used on the communication. This will determine if the client has - * support for certain packet types + * Sets the client protocol used on the communication. This will determine if the client has support for certain + * packet types */ void setChannelVersion(int clientVersion); @@ -129,45 +129,33 @@ default boolean isBeforeProducerMetricsChanged() { void syncIDGeneratorSequence(long id); /** - * Returns the next id to be chosen. - * - * @return the id + * {@return the next id to be chosen} */ long getIDGeneratorSequence(); /** - * Returns the current timeout for blocking calls - * - * @return the timeout in milliseconds + * {@return the current timeout for blocking calls)} */ long getBlockingCallTimeout(); /** - * Returns the current timeout for blocking calls - * - * @return the timeout in milliseconds + * {@return the current timeout for blocking calls} */ long getBlockingCallFailoverTimeout(); /** - * Returns the transfer lock used when transferring connections. - * - * @return the lock + * {@return the transfer lock used when transferring connections} */ Object getTransferLock(); /** - * Returns the default security principal - * - * @return the principal + * {@return the default security principal} */ ActiveMQPrincipal getDefaultActiveMQPrincipal(); /** - * - * @param timeout - * @return - * @throws IllegalStateException if the connection is closed + * {@see org.apache.activemq.artemis.spi.core.remoting.Connection#blockUntilWritable(long, + * java.util.concurrent.TimeUnit)} */ boolean blockUntilWritable(long timeout); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/Packet.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/Packet.java index b658090be34..b43a109c435 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/Packet.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/Packet.java @@ -26,8 +26,8 @@ public interface Packet { int INITIAL_PACKET_SIZE = 1500; /** - * Sets the channel id that should be used once the packet has been successfully decoded it is - * sent to the correct channel. + * Sets the channel id that should be used once the packet has been successfully decoded it is sent to the correct + * channel. * * @param channelID the id of the channel to handle the packet */ @@ -35,7 +35,6 @@ public interface Packet { /** * This will return the expected packet size for the encoding - * @return */ default int expectedEncodeSize() { return INITIAL_PACKET_SIZE; @@ -50,25 +49,17 @@ default int expectedEncodeSize() { void setCorrelationID(long correlationID); /** - * Returns the channel id of the channel that should handle this packet. - * - * @return the id of the channel + * {@return the channel id of the channel that should handle this packet} */ long getChannelID(); /** - * returns true if this packet is being sent in response to a previously received packet - * - * @return true if a response + * {@return true if this packet is being sent in response to a previously received packet} */ boolean isResponse(); /** - * returns the type of the packet. - *

      - * This is needed when decoding the packet - * - * @return the packet type + * {@return the type of the packet; needed when decoding the packet} */ byte getType(); @@ -88,23 +79,20 @@ default int expectedEncodeSize() { void decode(ActiveMQBuffer buffer); /** - * returns the size needed to encode this packet. - * - * @return The size of the entire packet including headers, and extra data + * {@return The size of the entire packet including headers, and extra data; i.e. the size + * needed to encode this packet} */ int getPacketSize(); /** - * returns true if a confirmation should be sent on receipt of this packet. - * - * @return true if confirmation is required + * {@return true if a confirmation should be sent on receipt of this packet} */ boolean isRequiresConfirmations(); - - - /** The packe wasn't used because the stream is closed, - * this gives a chance to sub classes to cleanup anything that won't be used. */ + /** + * The packet wasn't used because the stream is closed. This gives a chance to sub classes to cleanup anything that + * won't be used. + */ default void release() { } } 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 1f14d2f6ee1..18c3fb46205 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 @@ -69,16 +69,15 @@ /** * This class will return specific packets for different types of actions happening on a messaging protocol. - * + *

      * This is trying to unify the Core client into multiple protocols. - * + *

      * Returning null in certain packets means no action is taken on this specific protocol. - * + *

      * Semantic properties could also be added to this implementation. - * + *

      * Implementations of this class need to be stateless. */ - public class ActiveMQClientProtocolManager implements ClientProtocolManager { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -505,9 +504,6 @@ private void handleDisconnect(SimpleString nodeID, DisconnectReason reason, Simp } } - /** - * @param topMessage - */ protected void notifyTopologyChange(final ClusterTopologyChangeMessage topMessage) { final long eventUID; final String backupGroupName; 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 890f6e2aaa7..8760f985f15 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 @@ -552,8 +552,6 @@ public void sendProducerCreditsMessage(final int credits, final SimpleString add /** * ActiveMQ Artemis does support large messages - * - * @return */ @Override public boolean supportsLargeMessage() { @@ -962,7 +960,6 @@ public void recreateConsumerOnServer(ClientConsumerInternal consumerInternal, sendPacketWithoutLock(sessionChannel, packet); } else { - // https://jira.jboss.org/browse/HORNETQ-522 SessionConsumerFlowCreditMessage packet = new SessionConsumerFlowCreditMessage(getConsumerID(consumerInternal), 1); sendPacketWithoutLock(sessionChannel, packet); } @@ -1019,8 +1016,6 @@ private CoreRemotingConnection getCoreConnection() { /** * This doesn't apply to other protocols probably, so it will be an ActiveMQ Artemis exclusive feature - * - * @throws ActiveMQException */ private void handleConsumerDisconnected(DisconnectConsumerMessage packet) throws ActiveMQException { DisconnectConsumerMessage message = packet; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/BackwardsCompatibilityUtils.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/BackwardsCompatibilityUtils.java index 0037963af9d..2bcdf13e77f 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/BackwardsCompatibilityUtils.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/BackwardsCompatibilityUtils.java @@ -26,8 +26,8 @@ import java.util.Map; /** - * There are a few properties that were changed between HornetQ and Artemis. - * When sending topology updates to clients, if these properties are used we need to convert them properly + * There are a few properties that were changed between HornetQ and Artemis. When sending topology updates to clients, + * if these properties are used we need to convert them properly */ public class BackwardsCompatibilityUtils { @@ -146,8 +146,8 @@ public class BackwardsCompatibilityUtils { /** * Translates V3 strings to V2 strings. - *

      - * Returns the string as if it's not found in the conversion map. + * + * @return the string as if it's not found in the conversion map. */ public static String convertParameter(String name) { String oldParameter = OLD_PARAMETERS_MAP.get(name); 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 aed5afa577a..feb47505f5a 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 @@ -113,9 +113,6 @@ protected static String idToString(long code) { private volatile long id; - /** - * This is used in - */ private final AtomicInteger reconnectID = new AtomicInteger(0); private ChannelHandler handler; @@ -469,9 +466,10 @@ public Packet sendBlocking(final Packet packet, } /** - * Due to networking issues or server issues the server may take longer to answer than expected.. the client may timeout the call throwing an exception - * and the client could eventually retry another call, but the server could then answer a previous command issuing a class-cast-exception. - * The expectedPacket will be used to filter out undesirable packets that would belong to previous calls. + * Due to networking issues or server issues the server may take longer to answer than expected.. the client may + * timeout the call throwing an exception and the client could eventually retry another call, but the server could + * then answer a previous command issuing a class-cast-exception. The expectedPacket will be used to filter out + * undesirable packets that would belong to previous calls. */ @Override public Packet sendBlocking(final Packet packet, @@ -592,9 +590,10 @@ public Packet sendBlocking(final Packet packet, } /** + * {@return the name of the interceptor that returned {@code false} or {@code null} if no interceptors returned + * {@code false}} + * * @param packet the packet to intercept - * @return the name of the interceptor that returned false or null if no interceptors - * returned false. */ public static String invokeInterceptors(final Packet packet, final List interceptors, diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java index 10ce0ecb61b..e1f42418c00 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java @@ -435,7 +435,9 @@ public boolean isRequiresConfirmations() { return true; } - /** extensions of this class are supposed to use getPacketString to provide toString functionality */ + /** + * extensions of this class are supposed to use getPacketString to provide toString functionality + */ @Override public final String toString() { return getPacketString() + "]"; 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 00d92e0115f..a24a39910e9 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 @@ -81,7 +81,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement private final SimpleString nodeID; - /* + /** * Create a client side connection */ public RemotingConnectionImpl(final PacketDecoder packetDecoder, @@ -94,7 +94,7 @@ public RemotingConnectionImpl(final PacketDecoder packetDecoder, this(packetDecoder, transportConnection, blockingCallTimeout, blockingCallFailoverTimeout, incomingInterceptors, outgoingInterceptors, true, null, connectionExecutor); } - /* + /** * Create a server side connection */ public RemotingConnectionImpl(final PacketDecoder packetDecoder, @@ -142,17 +142,11 @@ public String toString() { return "RemotingConnectionImpl [ID=" + getID() + ", clientID=" + getClientID() + ", nodeID=" + nodeID + ", transportConnection=" + getTransportConnection() + "]"; } - /** - * @return the channelVersion - */ @Override public int getChannelVersion() { return channelVersion; } - /** - * @param clientVersion the channelVersion to set - */ @Override public void setChannelVersion(int clientVersion) { this.channelVersion = clientVersion; @@ -368,11 +362,6 @@ public boolean isSupportsFlowControl() { return true; } - /** - * Returns the name of the protocol for this Remoting Connection - * - * @return - */ @Override public String getProtocolName() { return ActiveMQClient.DEFAULT_CORE_PROTOCOL; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java index 1e4ae3ad1c8..aae9dac8871 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java @@ -58,9 +58,6 @@ public ClusterTopologyChangeMessage() { super(CLUSTER_TOPOLOGY); } - /** - * @param clusterTopologyV2 - */ public ClusterTopologyChangeMessage(byte clusterTopologyV2) { super(clusterTopologyV2); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java index 3d80dd108cd..34132a03d5e 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java @@ -20,9 +20,6 @@ import org.apache.activemq.artemis.api.core.Pair; import org.apache.activemq.artemis.api.core.TransportConfiguration; -/** - * Clebert Suconic - */ public class ClusterTopologyChangeMessage_V2 extends ClusterTopologyChangeMessage { protected long uniqueEventID; @@ -66,9 +63,6 @@ public ClusterTopologyChangeMessage_V2(byte clusterTopologyV3) { super(clusterTopologyV3); } - /** - * @return the uniqueEventID - */ public long getUniqueEventID() { return uniqueEventID; } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java index 3430a92def2..0f9c62aba04 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java @@ -59,9 +59,6 @@ public CreateQueueMessage() { super(CREATE_QUEUE); } - /** - * @param createQueueMessageV2 - */ public CreateQueueMessage(byte createQueueMessageV2) { super(createQueueMessageV2); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/Ping.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/Ping.java index 2a1434a577b..62437cf5917 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/Ping.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/Ping.java @@ -21,8 +21,8 @@ import org.apache.activemq.artemis.utils.DataConstants; /** - * Ping is sent on the client side by {@link org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl}. At the server's - * side it is handled by org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl + * Ping is sent on the client side by {@link org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl}. At + * the server's side it is handled by org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl */ public final class Ping extends PacketImpl { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QueueAbstractPacket.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QueueAbstractPacket.java index c1328e25c14..8a407fed49f 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QueueAbstractPacket.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QueueAbstractPacket.java @@ -39,8 +39,9 @@ public SimpleString getAddress() { } /** - * It converts the given {@code queueNames} using the JMS prefix found on {@link #address} when {@code clientVersion < }{@link #ADDRESSING_CHANGE_VERSION}. - * If no conversion has occurred, it returns {@code queueNames}. + * It converts the given {@code queueNames} using the JMS prefix found on {@link #address} when + * {@code clientVersion < }{@link #ADDRESSING_CHANGE_VERSION}. If no conversion has occurred, it returns + * {@code queueNames}. * * @param clientVersion version of the client * @param queueNames names of the queues to be converted diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/RollbackMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/RollbackMessage.java index a69c21874b4..c42a83c6697 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/RollbackMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/RollbackMessage.java @@ -33,16 +33,10 @@ public RollbackMessage(final boolean considerLastMessageAsDelivered) { private boolean considerLastMessageAsDelivered; - /** - * @return the considerLastMessageAsDelivered - */ public boolean isConsiderLastMessageAsDelivered() { return considerLastMessageAsDelivered; } - /** - * @param isLastMessageAsDelivered the considerLastMessageAsDelivered to set - */ public void setConsiderLastMessageAsDelivered(final boolean isLastMessageAsDelivered) { considerLastMessageAsDelivered = isLastMessageAsDelivered; } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java index 14201eae4bf..1897c315c16 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java @@ -21,7 +21,7 @@ /** * A SessionAddMetaDataMessage - * + *

      * Packet deprecated: It exists only to support old formats */ public class SessionAddMetaDataMessage extends PacketImpl { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java index 414f506df28..3dda89504b9 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java @@ -21,7 +21,7 @@ /** * A SessionAddMetaDataMessage - * + *

      * This packet replaces {@link SessionAddMetaDataMessage} */ public class SessionAddMetaDataMessageV2 extends PacketImpl { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java index afdd4db1e7f..9f15ffeed92 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java @@ -23,9 +23,6 @@ import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl; -/** - * A SessionBindingQueryResponseMessage - */ public class SessionBindingQueryResponseMessage extends PacketImpl { protected boolean exists; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionContinuationMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionContinuationMessage.java index 82d90b75c49..bf7c9874934 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionContinuationMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionContinuationMessage.java @@ -41,9 +41,6 @@ public SessionContinuationMessage(final byte type) { super(type); } - /** - * @return the body - */ public byte[] getBody() { if (size <= 0) { return new byte[0]; @@ -52,20 +49,15 @@ public byte[] getBody() { } } - /** - * @return the continues - */ public boolean isContinues() { return continues; } /** - * Returns the exact expected encoded size of {@code this} packet. - * It will be used to allocate the proper encoding buffer in {@link #createPacket}, hence any - * wrong value will result in a thrown exception or a resize of the encoding - * buffer during the encoding process, depending to the implementation of {@link #createPacket}. - * Any child of {@code this} class are required to override this method if their encoded size is changed - * from the base class. + * Returns the exact expected encoded size of {@code this} packet. It will be used to allocate the proper encoding + * buffer in {@link #createPacket}, hence any wrong value will result in a thrown exception or a resize of the + * encoding buffer during the encoding process, depending to the implementation of {@link #createPacket}. Any child + * of {@code this} class are required to override this method if their encoded size is changed from the base class. * * @return the size in bytes of the expected encoded packet */ diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java index 127b0e4b870..8caff691ca9 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java @@ -19,9 +19,6 @@ import org.apache.activemq.artemis.api.core.ActiveMQBuffer; import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl; -/** - * A SessionConsumerForceDelivery - */ public class SessionForceConsumerDelivery extends PacketImpl { private long consumerID; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java index 4a848169bb6..6581264bf87 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java @@ -32,12 +32,6 @@ public SessionReceiveContinuationMessage() { super(SESS_RECEIVE_CONTINUATION); } - /** - * @param consumerID - * @param body - * @param continues - * @param requiresResponse - */ public SessionReceiveContinuationMessage(final long consumerID, final byte[] body, final boolean continues, @@ -55,9 +49,6 @@ public SessionReceiveContinuationMessage(final long consumerID, this.size = packetSize; } - /** - * @return the consumerID - */ public long getConsumerID() { return consumerID; } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java index a646ff188f3..074fec9e85d 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java @@ -26,7 +26,7 @@ public class SessionReceiveLargeMessage extends PacketImpl implements MessagePac private Message message; /** - * Since we receive the message before the entire message was received, + * Since we receive the message before the entire message was received */ private long largeMessageSize; @@ -78,9 +78,6 @@ public int getDeliveryCount() { return deliveryCount; } - /** - * @return the largeMessageSize - */ public long getLargeMessageSize() { return largeMessageSize; } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java index f95dfb915af..7e43a612db0 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java @@ -21,9 +21,6 @@ import org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler; import org.apache.activemq.artemis.utils.DataConstants; -/** - * A SessionSendContinuationMessage
      - */ public class SessionSendContinuationMessage extends SessionContinuationMessage { protected boolean requiresResponse; @@ -31,12 +28,14 @@ public class SessionSendContinuationMessage extends SessionContinuationMessage { // Used on confirmation handling protected Message message; /** - * In case, we are using a different handler than the one set on the {@link org.apache.activemq.artemis.api.core.client.ClientSession} - *
      + * In case, we are using a different handler than the one set on the + * {@link org.apache.activemq.artemis.api.core.client.ClientSession} + *

      * This field is only used at the client side. * * @see org.apache.activemq.artemis.api.core.client.ClientSession#setSendAcknowledgementHandler(SendAcknowledgementHandler) - * @see org.apache.activemq.artemis.api.core.client.ClientProducer#send(org.apache.activemq.artemis.api.core.SimpleString, org.apache.activemq.artemis.api.core.Message, SendAcknowledgementHandler) + * @see org.apache.activemq.artemis.api.core.client.ClientProducer#send(org.apache.activemq.artemis.api.core.SimpleString, + * org.apache.activemq.artemis.api.core.Message, SendAcknowledgementHandler) */ private final transient SendAcknowledgementHandler handler; @@ -57,11 +56,6 @@ protected SessionSendContinuationMessage(byte type) { handler = null; } - /** - * @param body - * @param continues - * @param requiresResponse - */ public SessionSendContinuationMessage(final Message message, final byte[] body, final boolean continues, @@ -75,11 +69,6 @@ public SessionSendContinuationMessage(final Message message, this.messageBodySize = messageBodySize; } - /** - * @param body - * @param continues - * @param requiresResponse - */ protected SessionSendContinuationMessage(final byte type, final Message message, final byte[] body, @@ -94,9 +83,6 @@ protected SessionSendContinuationMessage(final byte type, this.messageBodySize = messageBodySize; } - /** - * @return the requiresResponse - */ @Override public boolean isRequiresResponse() { return requiresResponse; @@ -106,9 +92,6 @@ public long getMessageBodySize() { return messageBodySize; } - /** - * @return the message - */ public Message getMessage() { return message; } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V2.java index e98d2e414ae..7ae7760bc1f 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V2.java @@ -21,9 +21,6 @@ import org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler; import org.apache.activemq.artemis.utils.DataConstants; -/** - * A SessionSendContinuationMessage
      - */ public class SessionSendContinuationMessage_V2 extends SessionSendContinuationMessage { private long correlationID; @@ -34,11 +31,6 @@ public SessionSendContinuationMessage_V2() { super(); } - /** - * @param body - * @param continues - * @param requiresResponse - */ public SessionSendContinuationMessage_V2(final Message message, final byte[] body, final boolean continues, diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V3.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V3.java index 60db0c2d92a..b280bb92b1f 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V3.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V3.java @@ -21,9 +21,6 @@ import org.apache.activemq.artemis.api.core.client.SendAcknowledgementHandler; import org.apache.activemq.artemis.utils.DataConstants; -/** - * A SessionSendContinuationMessage
      - */ public class SessionSendContinuationMessage_V3 extends SessionSendContinuationMessage_V2 { private int senderID; @@ -32,11 +29,6 @@ public SessionSendContinuationMessage_V3() { super(); } - /** - * @param body - * @param continues - * @param requiresResponse - */ public SessionSendContinuationMessage_V3(final Message message, final byte[] body, final boolean continues, diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage.java index f1afbdb7d9e..c98476abf2d 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage.java @@ -28,16 +28,20 @@ public class SessionSendMessage extends MessagePacket { protected boolean requiresResponse; /** - * In case, we are using a different handler than the one set on the {@link org.apache.activemq.artemis.api.core.client.ClientSession} - *
      + * In case, we are using a different handler than the one set on the + * {@link org.apache.activemq.artemis.api.core.client.ClientSession} + *

      * This field is only used at the client side. * * @see org.apache.activemq.artemis.api.core.client.ClientSession#setSendAcknowledgementHandler(SendAcknowledgementHandler) - * @see org.apache.activemq.artemis.api.core.client.ClientProducer#send(org.apache.activemq.artemis.api.core.SimpleString, org.apache.activemq.artemis.api.core.Message, SendAcknowledgementHandler) + * @see org.apache.activemq.artemis.api.core.client.ClientProducer#send(org.apache.activemq.artemis.api.core.SimpleString, + * org.apache.activemq.artemis.api.core.Message, SendAcknowledgementHandler) */ private final transient SendAcknowledgementHandler handler; - /** This will be using the CoreMessage because it is meant for the core-protocol */ + /** + * This will be using the CoreMessage because it is meant for the core-protocol + */ protected SessionSendMessage(final byte id, final ICoreMessage message, final boolean requiresResponse, @@ -53,7 +57,9 @@ protected SessionSendMessage(final byte id, this.handler = null; } - /** This will be using the CoreMessage because it is meant for the core-protocol */ + /** + * This will be using the CoreMessage because it is meant for the core-protocol + */ public SessionSendMessage(final ICoreMessage message, final boolean requiresResponse, final SendAcknowledgementHandler handler) { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V2.java index 1fff56dfb53..9209f0d3461 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V2.java @@ -26,7 +26,9 @@ public class SessionSendMessage_V2 extends SessionSendMessage { private long correlationID; - /** This will be using the CoreMessage because it is meant for the core-protocol */ + /** + * This will be using the CoreMessage because it is meant for the core-protocol + */ public SessionSendMessage_V2(final ICoreMessage message, final boolean requiresResponse, final SendAcknowledgementHandler handler) { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V3.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V3.java index 690b931f62d..5ee42490c40 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V3.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V3.java @@ -26,7 +26,9 @@ public class SessionSendMessage_V3 extends SessionSendMessage_V2 { private int senderID; - /** This will be using the CoreMessage because it is meant for the core-protocol */ + /** + * This will be using the CoreMessage because it is meant for the core-protocol + */ public SessionSendMessage_V3(final ICoreMessage message, final boolean requiresResponse, final SendAcknowledgementHandler handler, diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessageV2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessageV2.java index 4df3d28967a..cd737051e04 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessageV2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessageV2.java @@ -38,9 +38,6 @@ public void encodeRest(final ActiveMQBuffer buffer) { buffer.writeInt(clientVersion); } - /** - * @return the clientVersion - */ public int getClientVersion() { return clientVersion; } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/CloseListener.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/CloseListener.java index 12c8f7ad463..d6c702cc2ee 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/CloseListener.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/CloseListener.java @@ -17,7 +17,8 @@ package org.apache.activemq.artemis.core.remoting; /** - * CloseListeners can be registered with a {@link org.apache.activemq.artemis.spi.core.protocol.RemotingConnection} to get notified when the connection is closed. + * CloseListeners can be registered with a {@link org.apache.activemq.artemis.spi.core.protocol.RemotingConnection} to + * get notified when the connection is closed. *

      * {@link org.apache.activemq.artemis.spi.core.protocol.RemotingConnection#addCloseListener(CloseListener)} */ diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/FailureListener.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/FailureListener.java index 05e185b4146..14878a1c3a4 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/FailureListener.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/FailureListener.java @@ -26,8 +26,7 @@ public interface FailureListener { /** * Notifies that a connection has failed due to the specified exception. * - * @param exception exception which has caused the connection to fail - * @param failedOver + * @param exception exception which has caused the connection to fail */ void connectionFailed(ActiveMQException exception, boolean failedOver); @@ -35,7 +34,6 @@ public interface FailureListener { * Notifies that a connection has failed due to the specified exception. * * @param exception exception which has caused the connection to fail - * @param failedOver * @param scaleDownTargetNodeID the ID of the node to which messages are scaling down */ void connectionFailed(ActiveMQException exception, boolean failedOver, String scaleDownTargetNodeID); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/TransportConfigurationUtil.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/TransportConfigurationUtil.java index 806196fe028..8c88365845d 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/TransportConfigurationUtil.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/TransportConfigurationUtil.java @@ -40,8 +40,10 @@ public class TransportConfigurationUtil { public static Map getDefaults(String className) { if (className == null) { - /* Returns a new map. This allows any parent objects to update the map key/values - without polluting the EMPTY_HELPER map. */ + /* + * Returns a new map. This allows any parent objects to update the map key/values without polluting the + * EMPTY_HELPER map. + */ return new HashMap<>(); } @@ -55,8 +57,10 @@ public static Map getDefaults(String className) { } } - /* We need to return a copy of the default Map. This means the defaults parent is able to update the map without - modifying the original */ + /* + * We need to return a copy of the default Map. This means the defaults parent is able to update the map without + * modifying the original + */ return cloneDefaults(DEFAULTS.get(className)); } 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 5136c995dd7..4a90401dcca 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,8 +23,8 @@ import org.apache.activemq.artemis.utils.Env; /** - * This class will check for Epoll or KQueue is available, and return false in case of NoClassDefFoundError - * it could be improved to check for other cases eventually. + * This class will check for Epoll or KQueue is available, and return false in case of NoClassDefFoundError it could be + * improved to check for other cases eventually. */ public class CheckDependencies { 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 f84edb22842..363767d0599 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 @@ -61,8 +61,8 @@ public class NettyConnection implements Connection { private final boolean directDeliver; private final Map configuration; /** - * if {@link #isWritable(ReadyListener)} returns false, we add a callback - * here for when the connection (or Netty Channel) becomes available again. + * if {@link #isWritable(ReadyListener)} returns false, we add a callback here for when the connection (or Netty + * Channel) becomes available again. */ private final List readyListeners = new ArrayList<>(); private static final FastThreadLocal> localListenersPool = new FastThreadLocal<>(); @@ -109,7 +109,7 @@ private static void waitFor(ChannelPromise promise, long millis) { } /** - * Returns an estimation of the current size of the write buffer in the channel. + * {@return an estimation of the current size of the write buffer in the channel} */ private static long batchBufferSize(Channel channel) { final ChannelOutboundBuffer outboundBuffer = channel.unsafe().outboundBuffer(); @@ -207,8 +207,6 @@ public final void forceClose() { /** * This is exposed so users would have the option to look at any data through interceptors - * - * @return */ public final Channel getChannel() { return channel; 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 c9aa44a0956..e0fc9be0c1e 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 @@ -858,8 +858,9 @@ public Connection createConnection() { /** * Create and return a connection from this connector. *

      - * This method must NOT throw an exception if it fails to create the connection - * (e.g. network is not available), in this case it MUST return null.
      + * This method must NOT throw an exception if it fails to create the connection (e.g. network is not available), in + * this case it MUST return null. + *

      * This version can be used for testing purposes. * * @param onConnect a callback that would be called right after {@link Bootstrap#connect()} 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 91ebe95cd9e..e7464975dfe 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 @@ -68,10 +68,10 @@ public class TransportConstants { public static final String USE_KQUEUE_PROP_NAME = "useKQueue"; - @Deprecated /** * @deprecated Use USE_GLOBAL_WORKER_POOL_PROP_NAME */ + @Deprecated public static final String USE_NIO_GLOBAL_WORKER_POOL_PROP_NAME = "useNioGlobalWorkerPool"; public static final String USE_GLOBAL_WORKER_POOL_PROP_NAME = "useGlobalWorkerPool"; @@ -145,14 +145,15 @@ public class TransportConstants { public static final String NETTY_VERSION; /** - * Disable Nagle's algorithm.
      + * Disable Nagle's algorithm. + *

      * Valid for (client) Sockets. * * @see - * Netty note on this option - * @see Oracle - * doc on tcpNoDelay + * href="https://netty.io/4.1/api/io/netty/channel/socket/SocketChannelConfig.html#setTcpNoDelay-boolean-">Netty note + * on this option + * @see Oracle doc on + * tcpNoDelay */ public static final String TCP_NODELAY_PROPNAME = "tcpNoDelay"; @@ -160,10 +161,10 @@ public class TransportConstants { public static final String TCP_RECEIVEBUFFER_SIZE_PROPNAME = "tcpReceiveBufferSize"; - @Deprecated /** * @deprecated Use REMOTING_THREADS_PROPNAME */ + @Deprecated public static final String NIO_REMOTING_THREADS_PROPNAME = "nioRemotingThreads"; public static final String WRITE_BUFFER_LOW_WATER_MARK_PROPNAME = "writeBufferLowWaterMark"; @@ -364,17 +365,20 @@ public class TransportConstants { public static final String DISABLE_STOMP_SERVER_HEADER = "disableStompServerHeader"; - /** We let this to be defined as a System Variable, as we need a different timeout over our testsuite. - * When running on a real server, this is the default we want. - * When running on a test suite, we need it to be 0, You should see a property on the main pom.xml. + /** + * We let this to be defined as a System Variable, as we need a different timeout over our testsuite. When running on + * a real server, this is the default we want. When running on a test suite, we need it to be 0, You should see a + * property on the main pom.xml. */ public static final int DEFAULT_QUIET_PERIOD = parseDefaultVariable("DEFAULT_QUIET_PERIOD", 100); public static final String SHUTDOWN_TIMEOUT = "shutdownTimeout"; - /** We let this to be defined as a System Variable, as we need a different timeout over our testsuite. - * When running on a real server, this is the default we want. - * When running on a test suite, we need it to be 0, You should see a property on the main pom.xml */ + /** + * We let this to be defined as a System Variable, as we need a different timeout over our testsuite. When running on + * a real server, this is the default we want. When running on a test suite, we need it to be 0, You should see a + * property on the main pom.xml + */ public static final int DEFAULT_SHUTDOWN_TIMEOUT = parseDefaultVariable("DEFAULT_SHUTDOWN_TIMEOUT", 3_000); public static final boolean DEFAULT_PROXY_ENABLED = false; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/CachingOpenSSLContextFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/CachingOpenSSLContextFactory.java index c72706b53ba..3ef6af4c5db 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/CachingOpenSSLContextFactory.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/CachingOpenSSLContextFactory.java @@ -25,12 +25,10 @@ import org.apache.activemq.artemis.spi.core.remoting.ssl.SSLContextConfig; /** - * {@link OpenSSLContextFactory} providing a cache of {@link SslContext}. - * Since {@link SslContext} should be reused instead of recreated and are thread safe. - * To activate it you need to allow this Service to be discovered by having a - * META-INF/services/org.apache.activemq.artemis.spi.core.remoting.ssl.OpenSSLContextFactory - * file with org.apache.activemq.artemis.core.remoting.impl.ssl.CachingOpenSSLContextFactory - * as value. + * {@link OpenSSLContextFactory} providing a cache of {@link SslContext}. Since {@link SslContext} should be reused + * instead of recreated and are thread safe. To activate it you need to allow this Service to be discovered by having a + * {@code META-INF/services/org.apache.activemq.artemis.spi.core.remoting.ssl.OpenSSLContextFactory} file with + * {@code org.apache.activemq.artemis.core.remoting.impl.ssl.CachingOpenSSLContextFactory} as value. */ public class CachingOpenSSLContextFactory extends DefaultOpenSSLContextFactory { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/CachingSSLContextFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/CachingSSLContextFactory.java index bd385c82821..e283ac1b6eb 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/CachingSSLContextFactory.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/CachingSSLContextFactory.java @@ -28,12 +28,10 @@ import org.apache.activemq.artemis.utils.ConfigurationHelper; /** - * {@link SSLContextFactory} providing a cache of {@link SSLContext}. - * Since {@link SSLContext} should be reused instead of recreated and are thread safe. - * To activate it you need to allow this Service to be discovered by having a - * META-INF/services/org.apache.activemq.artemis.spi.core.remoting.ssl.SSLContextFactory - * file with org.apache.activemq.artemis.core.remoting.impl.ssl.CachingSSLContextFactory - * as value. + * {@link SSLContextFactory} providing a cache of {@link SSLContext}. Since {@link SSLContext} should be reused instead + * of recreated and are thread safe. To activate it you need to allow this Service to be discovered by having a + * {@code META-INF/services/org.apache.activemq.artemis.spi.core.remoting.ssl.SSLContextFactory} file with + * {@code org.apache.activemq.artemis.core.remoting.impl.ssl.CachingSSLContextFactory} as value. */ public class CachingSSLContextFactory extends DefaultSSLContextFactory { @@ -59,11 +57,11 @@ public SSLContext getSSLContext(final SSLContextConfig config, final Map - *

    • If config contains an entry with key "sslContext", the associated value is returned + *
    • If {@code config} contains an entry with key "sslContext", the associated value is returned *
    • Otherwise, the provided {@link SSLContextConfig} is used as cache key. * * - * @return the SSL context name to cache/retrieve the {@link SslContext}. + * @return the SSL context name to cache/retrieve the {@link SslContext} */ protected Object getCacheKey(final SSLContextConfig config, final Map additionalOpts) { final Object cacheKey = ConfigurationHelper.getStringProperty(TransportConstants.SSL_CONTEXT_PROP_NAME, null, additionalOpts); 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 b40d43120fa..c7f85c1d362 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 @@ -36,8 +36,7 @@ public class DefaultOpenSSLContextFactory implements OpenSSLContextFactory { /** * @param additionalOpts not used by this implementation - * - * @return an {@link SslContext} instance for the given configuration. + * @return an {@link SslContext} instance for the given configuration */ @Override public SslContext getClientSslContext(final SSLContextConfig config, final Map additionalOpts) throws Exception { @@ -49,8 +48,7 @@ public SslContext getClientSslContext(final SSLContextConfig config, final Map additionalOpts) throws Exception { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/SSLSupport.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/SSLSupport.java index 1e5ab56baee..7dee7e0379c 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/SSLSupport.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/SSLSupport.java @@ -60,10 +60,10 @@ import org.apache.activemq.artemis.utils.ClassloadingUtil; /** - * Please note, this class supports PKCS#11 keystores, but there are no specific tests in the ActiveMQ Artemis test-suite to - * validate/verify this works because this requires a functioning PKCS#11 provider which is not available by default - * (see java.security.Security#getProviders()). The main thing to keep in mind is that PKCS#11 keystores will either use - * null, and empty string, or NONE for their keystore path. + * Please note, this class supports PKCS#11 keystores, but there are no specific tests in the ActiveMQ Artemis + * test-suite to validate/verify this works because this requires a functioning PKCS#11 provider which is not available + * by default (see java.security.Security#getProviders()). The main thing to keep in mind is that PKCS#11 keystores + * will either use null, and empty string, or NONE for their keystore path. */ public class SSLSupport { @@ -410,9 +410,9 @@ private static URL validateStoreURL(final String storePath) throws Exception { } /** - * This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a - * utility class, as it would be a door to load anything you like in a safe VM. - * For that reason any class trying to do a privileged block should do with the AccessController directly. + * This seems duplicate code all over the place, but for security reasons we can't let something like this to be open + * in a utility class, as it would be a door to load anything you like in a safe VM. For that reason any class trying + * to do a privileged block should do with the AccessController directly. */ private static URL findResource(final String resourceName) { return AccessController.doPrivileged((PrivilegedAction) () -> ClassloadingUtil.findResource(resourceName)); @@ -438,13 +438,11 @@ private KeyManagerFactory getKeyManagerFactory(KeyStore keyStore, char[] keystor /** * The changes ARTEMIS-3155 introduced an incompatibility with old clients using the keyStoreProvider and - * trustStoreProvider URL properties. These old clients use these properties to set the *type* of store - * (e.g. PKCS12, PKCS11, JKS, JCEKS, etc.), but new clients use these to set the *provider* (as the name - * implies). This method checks to see if the provider property matches what is expected from old clients - * and if so returns they proper provider and type properties to use with the new client implementation. + * trustStoreProvider URL properties. These old clients use these properties to set the *type* of store (e.g. PKCS12, + * PKCS11, JKS, JCEKS, etc.), but new clients use these to set the *provider* (as the name implies). This method + * checks to see if the provider property matches what is expected from old clients and if so returns they proper + * provider and type properties to use with the new client implementation. * - * @param storeProvider - * @param storeType * @return a {@code Pair} representing the provider and type to use (in that order) */ public static Pair getValidProviderAndType(String storeProvider, String storeType) { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/security/Role.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/security/Role.java index 2036a92feae..2876ec7bdcd 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/security/Role.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/security/Role.java @@ -64,14 +64,6 @@ public Role() { } /** - * @param name - * @param send - * @param consume - * @param createDurableQueue - * @param deleteDurableQueue - * @param createNonDurableQueue - * @param deleteNonDurableQueue - * @param manage * @deprecated Use {@link #Role(String, boolean, boolean, boolean, boolean, boolean, boolean, boolean, boolean)} */ @Deprecated diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/ComponentConfigurationRoutingType.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/ComponentConfigurationRoutingType.java index 9c488a05671..f57915990fd 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/ComponentConfigurationRoutingType.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/ComponentConfigurationRoutingType.java @@ -18,8 +18,8 @@ /** * This class essentially mirrors {@code RoutingType} except it has some additional members to support special - * configuration semantics for diverts and bridges. These additional members weren't put in {@code RoutingType} - * so as to not confuse users. + * configuration semantics for diverts and bridges. These additional members weren't put in {@code RoutingType} so as + * to not confuse users. */ public enum ComponentConfigurationRoutingType { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/management/NotificationService.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/management/NotificationService.java index 113bc346c77..e57765c2584 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/management/NotificationService.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/management/NotificationService.java @@ -21,11 +21,11 @@ public interface NotificationService { /** * the message corresponding to a notification will always contain the properties: *
        - *
      • ManagementHelper.HDR_NOTIFICATION_TYPE - the type of notification (SimpleString)
      • - *
      • ManagementHelper.HDR_NOTIFICATION_MESSAGE - a message contextual to the notification (SimpleString)
      • - *
      • ManagementHelper.HDR_NOTIFICATION_TIMESTAMP - the timestamp when the notification occurred (long)
      • + *
      • {@code ManagementHelper.HDR_NOTIFICATION_TYPE} - the type of notification (SimpleString)
      • + *
      • {@code ManagementHelper.HDR_NOTIFICATION_MESSAGE} - a message contextual to the notification (SimpleString)
      • + *
      • {@code ManagementHelper.HDR_NOTIFICATION_TIMESTAMP} - the timestamp when the notification occurred (long)
      • *
      - * in addition to the properties defined in props + * in addition to the properties defined in {@code props} * * @see org.apache.activemq.artemis.api.core.management.ManagementHelper */ diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/transaction/impl/XidImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/transaction/impl/XidImpl.java index 3dfca762f61..09404262586 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/transaction/impl/XidImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/transaction/impl/XidImpl.java @@ -65,10 +65,6 @@ private static byte[] toByteArray(final Xid xid) { /** * Standard constructor - * - * @param branchQualifier - * @param formatId - * @param globalTransactionId */ public XidImpl(final byte[] branchQualifier, final int formatId, final byte[] globalTransactionId) { this.branchQualifier = branchQualifier; @@ -78,8 +74,6 @@ public XidImpl(final byte[] branchQualifier, final int formatId, final byte[] gl /** * Copy constructor - * - * @param other */ public XidImpl(final Xid other) { branchQualifier = copyBytes(other.getBranchQualifier()); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/BytesMessageUtil.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/BytesMessageUtil.java index 0a38be2d785..0e8d6c88768 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/BytesMessageUtil.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/BytesMessageUtil.java @@ -128,11 +128,7 @@ public static void bytesWriteBytes(ActiveMQBuffer message, final byte[] value, f } /** - * Returns true if it could send the Object to any known format - * - * @param message - * @param value - * @return + * {@return {@code true} if it could send the Object to any known format} */ public static boolean bytesWriteObject(ActiveMQBuffer message, Object value) { if (value == null) { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/MessageUtil.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/MessageUtil.java index 03b3f89fdd5..8c626cb208c 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/MessageUtil.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/MessageUtil.java @@ -135,7 +135,7 @@ public static void setJMSReplyTo(Message message, final SimpleString dest) { } public static void clearProperties(Message message) { - /** + /* * JavaDoc for this method states: * Clears a message's properties. * The message's header fields and body are not cleared. diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/StreamMessageUtil.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/StreamMessageUtil.java index ad98a0155a7..cd20f86d0e7 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/StreamMessageUtil.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/reader/StreamMessageUtil.java @@ -23,11 +23,8 @@ public class StreamMessageUtil extends MessageUtil { /** - * Method to read boolean values out of the Stream protocol existent on JMS Stream Messages - * Throws IllegalStateException if the type was invalid - * - * @param buff - * @return + * Method to read boolean values out of the Stream protocol existent on JMS Stream Messages Throws + * IllegalStateException if the type was invalid */ public static boolean streamReadBoolean(ActiveMQBuffer buff) { byte type = buff.readByte(); @@ -164,11 +161,9 @@ public static String streamReadString(ActiveMQBuffer buff) { } /** - * Utility for reading bytes out of streaming. - * It will return remainingBytes, bytesRead + * Utility for reading bytes out of streaming. It will return remainingBytes, bytesRead * * @param remainingBytes remaining Bytes from previous read. Send it to 0 if it was the first call for the message - * @param buff * @return a pair of remaining bytes and bytes read */ public static Pair streamReadBytes(ActiveMQBuffer buff, int remainingBytes, byte[] value) { 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 f6971fe9c3f..8814d60af1e 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 @@ -224,9 +224,7 @@ public boolean checkDataReceived() { return res; } - /* - * This can be called concurrently by more than one thread so needs to be locked - */ + // This can be called concurrently by more than one thread so needs to be locked @Override public void fail(final ActiveMQException me) { fail(me, null); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/protocol/RemotingConnection.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/protocol/RemotingConnection.java index df1655e3e61..e24875e2879 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/protocol/RemotingConnection.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/protocol/RemotingConnection.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.artemis.spi.core.protocol; +import javax.security.auth.Subject; import java.util.List; import java.util.concurrent.Future; @@ -30,32 +31,26 @@ import org.apache.activemq.artemis.spi.core.remoting.Connection; import org.apache.activemq.artemis.spi.core.remoting.ReadyListener; -import javax.security.auth.Subject; - /** * A RemotingConnection is a connection between a client and a server. - * - * Perhaps a better name for this class now would be ProtocolConnection as this - * represents the link with the used protocol + *

      + * Perhaps a better name for this class now would be ProtocolConnection as this represents the link with the used + * protocol */ public interface RemotingConnection extends BufferHandler { /** - * Returns the unique id of the {@link RemotingConnection}. - * - * @return the id + * {@return the unique id of the {@link RemotingConnection}} */ Object getID(); /** - * Returns the creation time of the {@link RemotingConnection}. + * {@return the creation time of the {@link RemotingConnection}} */ long getCreationTime(); /** - * returns a string representation of the remote address of this connection - * - * @return the remote address + * {@return a string representation of the remote address of this connection} */ String getRemoteAddress(); @@ -100,9 +95,7 @@ public interface RemotingConnection extends BufferHandler { void setCloseListeners(List listeners); /** - * return all the failure listeners - * - * @return the listeners + * {@return all the failure listeners} */ List getFailureListeners(); @@ -118,8 +111,7 @@ public interface RemotingConnection extends BufferHandler { void setFailureListeners(List listeners); /** - * creates a new ActiveMQBuffer of the specified size. - * For the purpose of i/o outgoing packets + * creates a new ActiveMQBuffer of the specified size. For the purpose of i/o outgoing packets * * @param size the size of buffer required * @return the buffer @@ -135,9 +127,8 @@ public interface RemotingConnection extends BufferHandler { void close(); - /** Same thing as fail, but using an executor. - * semantic of send here, is asynchrounous. - * @param me + /** + * Same thing as fail, but using an executor. semantic of send here, is asynchrounous. */ Future asyncFail(ActiveMQException me); @@ -162,16 +153,12 @@ public interface RemotingConnection extends BufferHandler { Connection getTransportConnection(); /** - * Returns whether or not the {@link RemotingConnection} is a client - * - * @return true if client, false if a server + * {@return true if the {@link RemotingConnection} is a client, otherwise false} */ boolean isClient(); /** - * Returns true if this {@link RemotingConnection} has been destroyed. - * - * @return true if destroyed, otherwise false + * {@return true if this {@link RemotingConnection} has been destroyed, otherwise false} */ boolean isDestroyed(); @@ -193,9 +180,7 @@ default void disconnect(DisconnectReason reason, String targetNodeID, TransportC } /** - * returns true if any data has been received since the last time this method was called. - * - * @return true if data has been received. + * {@return true if any data has been received since the last time this method was called} */ boolean checkDataReceived(); @@ -212,56 +197,46 @@ default void disconnect(DisconnectReason reason, String targetNodeID, TransportC void killMessage(SimpleString nodeID); /** - * This will check if reconnects are supported on the protocol and configuration. - * In case it's not supported a connection failure could remove messages right away from pending deliveries. - * - * @return + * This will check if reconnects are supported on the protocol and configuration. In case it's not supported a + * connection failure could remove messages right away from pending deliveries. */ boolean isSupportReconnect(); /** - * Return true if the protocol supports flow control. - * This is because in some cases we may need to hold message producers in cases like disk full. - * If the protocol doesn't support it we trash the connection and throw exceptions. - * - * @return + * Return true if the protocol supports flow control. This is because in some cases we may need to hold message + * producers in cases like disk full. If the protocol doesn't support it we trash the connection and throw + * exceptions. */ boolean isSupportsFlowControl(); /** * sets the currently associated subject for this connection - * @param subject */ void setSubject(Subject subject); /** * the possibly null subject associated with this connection - * @return */ Subject getSubject(); /** - * Returns the name of the protocol for this Remoting Connection - * @return + * {@return the name of the protocol for this Remoting Connection} */ String getProtocolName(); /** * Sets the client ID associated with this connection - * @param cID */ void setClientID(String cID); /** - * Returns the Client ID associated with this connection - * @return + * {@return the Client ID associated with this connection} */ String getClientID(); /** - * Returns a string representation of the local address this connection is connected to. - * This is useful when the server is configured at 0.0.0.0 (or multiple IPs). - * This will give you the actual IP that's being used. + * Returns a string representation of the local address this connection is connected to This is useful when the + * server is configured at 0.0.0.0 (or multiple IPs). This will give you the actual IP that's being used. * * @return the local address of transport connection */ diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/AbstractConnector.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/AbstractConnector.java index fbf86c9a0e8..a572080b36d 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/AbstractConnector.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/AbstractConnector.java @@ -18,9 +18,6 @@ import java.util.Map; -/** - * Abstract connector - */ public abstract class AbstractConnector implements Connector { protected final Map configuration; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BaseConnectionLifeCycleListener.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BaseConnectionLifeCycleListener.java index 39820db50b1..8678c603a6b 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BaseConnectionLifeCycleListener.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BaseConnectionLifeCycleListener.java @@ -25,14 +25,12 @@ public interface BaseConnectionLifeCycleListener { /** - * This method is used both by client connector creation and server connection creation through - * acceptors. On the client side the {@code component} parameter is normally passed as - * {@code null}. + * This method is used both by client connector creation and server connection creation through acceptors. On the + * client side the {@code component} parameter is normally passed as {@code null}. *

      - * Leaving this method here and adding a different one at - * {@code ServerConnectionLifeCycleListener} is a compromise for a reasonable split between the - * activemq-server and activemq-client packages while avoiding to pull too much into activemq-core. - * The pivotal point keeping us from removing the method is {@link ConnectorFactory} and the + * Leaving this method here and adding a different one at {@code ServerConnectionLifeCycleListener} is a compromise + * for a reasonable split between the activemq-server and activemq-client packages while avoiding to pull too much + * into activemq-core. The pivotal point keeping us from removing the method is {@link ConnectorFactory} and the * usage of it. * * @param component This will probably be an {@code Acceptor} and only used on the server side. diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BufferDecoder.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BufferDecoder.java index b96c2621a5b..9ab863d4e75 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BufferDecoder.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BufferDecoder.java @@ -21,12 +21,13 @@ public interface BufferDecoder { /** - * called by the remoting system prior to {@link org.apache.activemq.artemis.spi.core.remoting.BufferHandler#bufferReceived(Object, ActiveMQBuffer)}. + * called by the remoting system prior to + * {@link org.apache.activemq.artemis.spi.core.remoting.BufferHandler#bufferReceived(Object, ActiveMQBuffer)}. *

      - * The implementation should return true if there is enough data in the buffer to decode. otherwise false. - * * @param buffer the buffer + * The implementation should return {@code true} if there is enough data in the buffer to decode. otherwise false. * - * @return true id the buffer can be decoded.. + * @param buffer the buffer + * @return {@code true} id the buffer can be decoded. */ int isReadyToHandle(ActiveMQBuffer buffer); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BufferHandler.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BufferHandler.java index f4ddf9d7488..df79833b16e 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BufferHandler.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BufferHandler.java @@ -21,7 +21,8 @@ /** * A BufferHandler that will handle buffers received by an acceptor. *

      - * The Buffer Handler will decode the buffer and take the appropriate action, typically forwarding to the correct channel. + * The Buffer Handler will decode the buffer and take the appropriate action, typically forwarding to the correct + * channel. */ public interface BufferHandler { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientProtocolManager.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientProtocolManager.java index 04fcf011646..28b6c62bc0a 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientProtocolManager.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientProtocolManager.java @@ -46,8 +46,8 @@ RemotingConnection connect(Connection transportConnection, boolean waitOnLatch(long milliseconds) throws InterruptedException; /** - * This is to be called when a connection failed and we want to interrupt any communication. - * This used to be called exitLoop at some point o the code.. with a method named causeExit from ClientSessionFactoryImpl + * This is to be called when a connection failed and we want to interrupt any communication. This used to be called + * exitLoop at some point o the code.. with a method named causeExit from ClientSessionFactoryImpl */ void stop(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientProtocolManagerFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientProtocolManagerFactory.java index 78d3db35726..8b5045d0e0c 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientProtocolManagerFactory.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ClientProtocolManagerFactory.java @@ -28,8 +28,8 @@ public interface ClientProtocolManagerFactory { ServerLocator getLocator(); /** - * Adapt the transport configuration passed in parameter and return an adapted one that is suitable to use with ClientProtocolManager - * created by this factory. + * Adapt the transport configuration passed in parameter and return an adapted one that is suitable to use with + * ClientProtocolManager created by this factory. * * @param tc the original TransportConfiguration * @return the adapted TransportConfiguration diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Connection.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Connection.java index ab91b69a29e..a9695cc42c3 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Connection.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Connection.java @@ -34,7 +34,7 @@ public interface Connection { * Create a new ActiveMQBuffer of the given size. * * @param size the size of buffer to create - * @return the new buffer. + * @return the new buffer */ ActiveMQBuffer createTransportBuffer(int size); @@ -47,13 +47,14 @@ public interface Connection { boolean isOpen(); /** - * Causes the current thread to wait until the connection is writable unless the specified waiting time elapses. - * The available capacity of the connection could change concurrently hence this method is suitable to perform precise flow-control - * only in a single writer case, while its precision decrease inversely proportional with the rate and the number of concurrent writers. - * If the current thread is not allowed to block the timeout will be ignored dependently on the connection type. + * Causes the current thread to wait until the connection is writable unless the specified waiting time elapses. The + * available capacity of the connection could change concurrently hence this method is suitable to perform precise + * flow-control only in a single writer case, while its precision decrease inversely proportional with the rate and + * the number of concurrent writers. If the current thread is not allowed to block the timeout will be ignored + * dependently on the connection type. * - * @param timeout the maximum time to wait - * @param timeUnit the time unit of the timeout argument + * @param timeout the maximum time to wait + * @param timeUnit the time unit of the timeout argument * @return {@code true} if the connection is writable, {@code false} otherwise * @throws IllegalStateException if the connection is closed */ @@ -64,23 +65,20 @@ default boolean blockUntilWritable(final long timeout, final TimeUnit timeUnit) void fireReady(boolean ready); /** - * This will disable reading from the channel. - * This is basically the same as blocking the reading. + * This will disable reading from the channel. This is basically the same as blocking the reading. */ void setAutoRead(boolean autoRead); /** - * returns the unique id of this wire. - * - * @return the id + * {@return the unique id of this wire} */ Object getID(); EventLoop getEventLoop(); /** - * writes the buffer to the connection and if flush is true request to flush the buffer - * (and any previous un-flushed ones) into the wire. + * writes the buffer to the connection and if flush is true request to flush the buffer (and any previous un-flushed + * ones) into the wire. * * @param buffer the buffer to write * @param requestFlush whether to request flush onto the wire @@ -95,7 +93,8 @@ default void flush() { } /** - * writes the buffer to the connection and if flush is true returns only when the buffer has been physically written to the connection. + * writes the buffer to the connection and if flush is true returns only when the buffer has been physically written + * to the connection. * * @param buffer the buffer to write * @param flush whether to flush the buffers onto the wire @@ -104,7 +103,8 @@ default void flush() { void write(ActiveMQBuffer buffer, boolean flush, boolean batched); /** - * writes the buffer to the connection and if flush is true returns only when the buffer has been physically written to the connection. + * writes the buffer to the connection and if flush is true returns only when the buffer has been physically written + * to the connection. * * @param buffer the buffer to write * @param flush whether to flush the buffers onto the wire @@ -120,9 +120,8 @@ default void flush() { void write(ActiveMQBuffer buffer); /** - * This should close the internal channel without calling any listeners. - * This is to avoid a situation where the broker is busy writing on an internal thread. - * This should close the socket releasing any pending threads. + * This should close the internal channel without calling any listeners. This is to avoid a situation where the + * broker is busy writing on an internal thread. This should close the socket releasing any pending threads. */ void forceClose(); @@ -136,16 +135,13 @@ default void disconnect() { } /** - * Returns a string representation of the remote address this connection is connected to. - * - * @return the remote address + * {@return the string representation of the remote address this connection is connected to} */ String getRemoteAddress(); /** - * Returns a string representation of the local address this connection is connected to. - * This is useful when the server is configured at 0.0.0.0 (or multiple IPs). - * This will give you the actual IP that's being used. + * Returns a string representation of the local address this connection is connected to. This is useful when the + * server is configured at 0.0.0.0 (or multiple IPs). This will give you the actual IP that's being used. * * @return the local address */ @@ -157,8 +153,7 @@ default void disconnect() { void checkFlushBatchBuffer(); /** - * Generates a {@link TransportConfiguration} to be used to connect to the same target this is - * connected to. + * Generates a {@link TransportConfiguration} to be used to connect to the same target this is connected to. * * @return TransportConfiguration */ @@ -169,10 +164,8 @@ default void disconnect() { ActiveMQPrincipal getDefaultActiveMQPrincipal(); /** - * the InVM Connection has some special handling as it doesn't use Netty ProtocolChannel - * we will use this method Instead of using instanceof - * - * @return + * the InVM Connection has some special handling as it doesn't use Netty ProtocolChannel we will use this method + * Instead of using instanceof */ boolean isUsingProtocolHandling(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Connector.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Connector.java index 0f174695768..d495b1b6e3c 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Connector.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Connector.java @@ -23,40 +23,27 @@ */ public interface Connector { - /** - * starts the connector - */ void start(); - /** - * closes the connector - */ void close(); - /** - * returns true if the connector is started, oterwise false. - * - * @return true if the connector is started - */ boolean isStarted(); /** * Create and return a connection from this connector. *

      - * This method must NOT throw an exception if it fails to create the connection - * (e.g. network is not available), in this case it MUST return null + * This method must NOT throw an exception if it fails to create the connection (e.g. network is not available), in + * this case it MUST return null * * @return The connection, or null if unable to create a connection (e.g. network is unavailable) */ Connection createConnection(); /** - * If the configuration is equivalent to this connector, which means - * if the parameter configuration is used to create a connection to a target - * node, it will be the same node as of the connections made with this connector. + * If the configuration is equivalent to this connector, which means if the parameter configuration is used to create + * a connection to a target node, it will be the same node as of the connections made with this connector. * - * @param configuration - * @return true means the configuration is equivalent to the connector. false otherwise. + * @return true means the configuration is equivalent to the connector. false otherwise */ boolean isEquivalent(Map configuration); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectorFactory.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectorFactory.java index e709f7806db..fb1111b6ca8 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectorFactory.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ConnectorFactory.java @@ -52,7 +52,7 @@ Connector createConnector(Map configuration, * Indicates if connectors from this factory are reliable or not. If a connector is reliable then connection * monitoring (i.e. pings/pongs) will be disabled. * - * @return whether or not connectors from this factory are reliable + * @return whether connectors from this factory are reliable */ boolean isReliable(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/SessionContext.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/SessionContext.java index 9ec8187e28c..e2505ea406d 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/SessionContext.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/SessionContext.java @@ -78,9 +78,7 @@ public void setSession(ClientSessionInternal session) { /** * it will either reattach or reconnect, preferably reattaching it. * - * @param newConnection * @return true if it was possible to reattach - * @throws ActiveMQException */ public abstract boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException; @@ -148,10 +146,6 @@ public abstract void sendFullMessage(ICoreMessage msgI, /** * it should return the number of credits (or bytes) used to send this packet - * - * @param msgI - * @return - * @throws ActiveMQException */ public abstract int sendInitialChunkOnLargeMessage(Message msgI) throws ActiveMQException; @@ -177,17 +171,8 @@ public abstract int sendServerLargeMessageChunk(Message msgI, public abstract SendAcknowledgementHandler getSendAcknowledgementHandler(); /** - * Creates a shared queue using the routing type set by the Address. If the Address supports more than one type of delivery - * then the default delivery mode (MULTICAST) is used. - * - * @param address - * @param queueName - * @param routingType - * @param filterString - * @param durable - * @param exclusive - * @param lastValue - * @throws ActiveMQException + * Creates a shared queue using the routing type set by the Address. If the Address supports more than one type of + * delivery then the default delivery mode (MULTICAST) is used. */ @Deprecated public abstract void createSharedQueue(SimpleString address, @@ -201,13 +186,8 @@ public abstract void createSharedQueue(SimpleString address, Boolean lastValue) throws ActiveMQException; /** - * Creates a shared queue using the routing type set by the Address. If the Address supports more than one type of delivery - * then the default delivery mode (MULTICAST) is used. - * - * @param address - * @param queueName - * @param queueAttributes - * @throws ActiveMQException + * Creates a shared queue using the routing type set by the Address. If the Address supports more than one type of + * delivery then the default delivery mode (MULTICAST) is used. */ @Deprecated public abstract void createSharedQueue(SimpleString address, @@ -291,9 +271,6 @@ public abstract void createQueue(SimpleString address, * otherwise DLQ won't work. *

      * this is because we only ACK after on the RA, We may review this if we always acked earlier. - * - * @param lastMessageAsDelivered - * @throws ActiveMQException */ public abstract void simpleRollback(boolean lastMessageAsDelivered) throws ActiveMQException; @@ -345,8 +322,6 @@ public abstract ClientConsumerInternal createConsumer(SimpleString queueName, /** * Performs a round trip to the server requesting what is the current tx timeout on the session - * - * @return */ public abstract int recoverSessionTimeout() throws ActiveMQException; @@ -378,8 +353,8 @@ public abstract void recreateSession(String username, public abstract void returnBlocking(ActiveMQException cause); /** - * it will lock the communication channel of the session avoiding anything to come while failover is happening. - * It happens on preFailover from ClientSessionImpl + * it will lock the communication channel of the session avoiding anything to come while failover is happening. It + * happens on preFailover from ClientSessionImpl */ public abstract void lockCommunications(); 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 867619350b8..9cabff714a1 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 @@ -21,11 +21,10 @@ import io.netty.handler.ssl.SslContext; /** - * Service interface to create an {@link SslContext} for a configuration. - * This is ONLY used with OpenSSL. - * To create and use your own implementation you need to create a file - * META-INF/services/org.apache.activemq.artemis.spi.core.remoting.ssl.OpenSSLContextFactory - * in your jar and fill it with the full qualified name of your implementation. + * Service interface to create an {@link SslContext} for a configuration. This is ONLY used with OpenSSL. To create and + * use your own implementation you need to create a file + * {@code META-INF/services/org.apache.activemq.artemis.spi.core.remoting.ssl.OpenSSLContextFactory} in your jar and + * fill it with the full qualified name of your implementation. */ public interface OpenSSLContextFactory extends Comparable { @@ -42,22 +41,20 @@ default int compareTo(final OpenSSLContextFactory other) { /** * @param additionalOpts implementation specific additional options. - * - * @return an {@link SslContext} instance for the given configuration. + * @return an {@link SslContext} instance for the given configuration */ SslContext getClientSslContext(SSLContextConfig config, Map additionalOpts) throws Exception; /** * @param additionalOpts implementation specific additional options. - * - * @return an {@link SslContext} instance for the given configuration. + * @return an {@link SslContext} instance for the given configuration */ SslContext getServerSslContext(SSLContextConfig config, Map additionalOpts) throws Exception; /** - * The priority for the {@link OpenSSLContextFactory} when resolving the service to get the implementation. - * This is used when selecting the implementation when several implementations are loaded. - * The highest priority implementation will be used. + * The priority for the {@link OpenSSLContextFactory} when resolving the service to get the implementation. This is + * used when selecting the implementation when several implementations are loaded. The highest priority + * implementation will be used. */ int getPriority(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/OpenSSLContextFactoryProvider.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/OpenSSLContextFactoryProvider.java index 15c788f82e9..0b1b9e7662f 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/OpenSSLContextFactoryProvider.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/OpenSSLContextFactoryProvider.java @@ -19,7 +19,8 @@ import java.util.ServiceLoader; /** - * Provider that loads all registered {@link OpenSSLContextFactory} services and returns the one with the highest priority. + * Provider that loads all registered {@link OpenSSLContextFactory} services and returns the one with the highest + * priority. */ public class OpenSSLContextFactoryProvider { @@ -36,7 +37,7 @@ public class OpenSSLContextFactoryProvider { } /** - * @return the {@link OpenSSLContextFactory} with the higher priority. + * @return the {@link OpenSSLContextFactory} with the higher priority */ public static OpenSSLContextFactory getOpenSSLContextFactory() { return FACTORY; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextConfig.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextConfig.java index c047d754b3f..29d583aeafe 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextConfig.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextConfig.java @@ -21,9 +21,9 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants; /** - * This class holds configuration parameters for SSL context initialization. - * To be used with {@link SSLContextFactory} and {@link OpenSSLContextFactory}. - *
      + * This class holds configuration parameters for SSL context initialization. To be used with {@link SSLContextFactory} + * and {@link OpenSSLContextFactory}. + *

      * Use {@link SSLContextConfig#builder()} to create new immutable instances. */ public final class SSLContextConfig { 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 d3a4a03f741..e448a068988 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 @@ -20,16 +20,15 @@ import javax.net.ssl.SSLContext; /** - * Service interface to create a SSLContext for a configuration. - * This is NOT used by OpenSSL. - * To create and use your own implementation you need to create a file - * META-INF/services/org.apache.activemq.artemis.spi.core.remoting.ssl.SSLContextFactory - * in your jar and fill it with the full qualified name of your implementation. + * Service interface to create a SSLContext for a configuration. This is NOT used by OpenSSL. To create and use your own + * implementation you need to create a file + * {@code META-INF/services/org.apache.activemq.artemis.spi.core.remoting.ssl.SSLContextFactory} in your jar and fill it + * with the full qualified name of your implementation. */ public interface SSLContextFactory extends Comparable { /** - * @return an {@link SSLContext} for the given configuration. + * @return an {@link SSLContext} for the given configuration * * @deprecated use {@link #getSSLContext(SSLContextConfig, Map)} instead */ @@ -58,7 +57,7 @@ default SSLContext getSSLContext(Map configuration, /** * @param additionalOpts implementation specific additional options. * - * @return an {@link SSLContext} for the given configuration. + * @return an {@link SSLContext} for the given configuration */ default SSLContext getSSLContext(SSLContextConfig config, Map additionalOpts) throws Exception { return getSSLContext(additionalOpts, @@ -72,10 +71,11 @@ default void clearSSLContexts() { } /** - * The priority for the SSLContextFactory when resolving the service to get the implementation. - * This is used when selecting the implementation when several implementations are loaded. - * The highest priority implementation will be used. - * @return the priority. + * The priority for the SSLContextFactory when resolving the service to get the implementation. This is used when + * selecting the implementation when several implementations are loaded. The highest priority implementation will be + * used. + * + * @return the priority */ int getPriority(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextFactoryProvider.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextFactoryProvider.java index bfc643b0b31..28159e0edb1 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextFactoryProvider.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/ssl/SSLContextFactoryProvider.java @@ -24,8 +24,8 @@ import javax.net.ssl.SSLContext; /** - * Provider that loads the SSLContextFactory services and return the one with the highest priority. - * This is only used to provide SSLContext, so it doesn't support OpenSSL. + * Provider that loads the SSLContextFactory services and return the one with the highest priority. This is only used to + * provide SSLContext, so it doesn't support OpenSSL. */ public class SSLContextFactoryProvider { private static final SSLContextFactory factory; @@ -54,7 +54,7 @@ public int getPriority() { } } /** - * @return the SSLContextFactory with the higher priority. + * @return the SSLContextFactory with the higher priority */ public static SSLContextFactory getSSLContextFactory() { return factory; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/connector/InVMTransportConfigurationSchema.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/connector/InVMTransportConfigurationSchema.java index 6d07375abbb..3bcabeaa6ef 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/connector/InVMTransportConfigurationSchema.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/connector/InVMTransportConfigurationSchema.java @@ -27,7 +27,8 @@ public class InVMTransportConfigurationSchema extends AbstractTransportConfigurationSchema { - /* This is the same as org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.CONNECTIONS_ALLOWED, + /* + * This is the same as org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants.CONNECTIONS_ALLOWED, * but this Maven module can't see that class. */ public static final String CONNECTIONS_ALLOWED = "connectionsAllowed"; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/ConnectionOptions.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/ConnectionOptions.java index 8931dd6b494..1bf75f2b0fb 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/ConnectionOptions.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/uri/schema/serverLocator/ConnectionOptions.java @@ -18,9 +18,8 @@ package org.apache.activemq.artemis.uri.schema.serverLocator; /** - * This will represent all the possible options you could setup on URLs - * When parsing the URL this will serve as an intermediate object - * And it could also be a pl + * This will represent all the possible options you could setup on URLs When parsing the URL this will serve as an + * intermediate object And it could also be a pl */ public class ConnectionOptions { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ActiveMQBufferInputStream.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ActiveMQBufferInputStream.java index aaf09bce76b..bc525ac5364 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ActiveMQBufferInputStream.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ActiveMQBufferInputStream.java @@ -26,13 +26,8 @@ */ public class ActiveMQBufferInputStream extends InputStream { - /* (non-Javadoc) - * @see java.io.InputStream#read() - */ - private ActiveMQBuffer bb; - public ActiveMQBufferInputStream(final ActiveMQBuffer paramByteBuffer) { bb = paramByteBuffer; } @@ -130,9 +125,6 @@ public boolean markSupported() { return false; } - /** - * @return - */ private int remainingBytes() { return bb.writerIndex() - bb.readerIndex(); } 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 c01790c8849..ac7851aeebf 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 @@ -41,7 +41,8 @@ public class AutoCreateUtil { public static void autoCreateQueue(ClientSession session, SimpleString destAddress, SimpleString selectorString) throws ActiveMQException { AddressQuery response = session.addressQuery(destAddress); - /* The address query will send back exists=true even if the node only has a REMOTE binding for the destination. + /* + * The address query will send back exists=true even if the node only has a REMOTE binding for the destination. * Therefore, we must check if the queue names list contains the exact name of the address to know whether or * not a LOCAL binding for the address exists. If no LOCAL binding exists then it should be created here. */ @@ -72,13 +73,15 @@ public static void autoCreateQueue(ClientSession session, SimpleString destAddr } /** - * Set the non nullable (CreateQueueMessage_V2) queue attributes (all others have static defaults or get defaulted if null by address settings server side). + * Set the non nullable (CreateQueueMessage_V2) queue attributes (all others have static defaults or get defaulted if + * null by address settings server side). * * @param queueConfiguration the provided queue configuration the client wants to set - * @param addressQuery the address settings query information (this could be removed if max consumers and purge on no consumers were null-able in CreateQueueMessage_V2) - * @param routingType of the queue (multicast or anycast) - * @param filter to apply on the queue - * @param durable if queue is durable + * @param addressQuery the address settings query information (this could be removed if max consumers and purge + * on no consumers were null-able in CreateQueueMessage_V2) + * @param routingType of the queue (multicast or anycast) + * @param filter to apply on the queue + * @param durable if queue is durable */ public static void setRequiredQueueConfigurationIfNotSet(QueueConfiguration queueConfiguration, AddressQuery addressQuery, RoutingType routingType, SimpleString filter, boolean durable) { if (queueConfiguration.getRoutingType() == null) { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/BufferHelper.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/BufferHelper.java index 9cd689532b4..695050b4c96 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/BufferHelper.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/BufferHelper.java @@ -57,9 +57,6 @@ public static void writeAsSimpleString(ActiveMQBuffer buffer, String str) { buffer.writeSimpleString(SimpleString.of(str)); } - /** - * @param buffer - */ public static void writeNullableBoolean(ActiveMQBuffer buffer, Boolean value) { buffer.writeBoolean(value != null); @@ -82,9 +79,6 @@ public static Boolean readNullableBoolean(ActiveMQBuffer buffer) { } } - /** - * @param buffer - */ public static void writeNullableLong(ActiveMQBuffer buffer, Long value) { buffer.writeBoolean(value != null); @@ -93,9 +87,6 @@ public static void writeNullableLong(ActiveMQBuffer buffer, Long value) { } } - /** - * @param buffer - */ public static void writeNullableDouble(ActiveMQBuffer buffer, Double value) { buffer.writeBoolean(value != null); @@ -122,9 +113,6 @@ public static Long readNullableLong(ActiveMQBuffer buffer) { } } - /** - * @param buffer - */ public static void writeNullableInteger(ActiveMQBuffer buffer, Integer value) { buffer.writeBoolean(value != null); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ConfirmationWindowWarning.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ConfirmationWindowWarning.java index c3188580064..9598507a5b1 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ConfirmationWindowWarning.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ConfirmationWindowWarning.java @@ -26,9 +26,6 @@ public final class ConfirmationWindowWarning { public final boolean disabled; public final AtomicBoolean warningIssued; - /** - * - */ public ConfirmationWindowWarning(boolean disabled) { this.disabled = disabled; warningIssued = new AtomicBoolean(false); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/DeflaterReader.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/DeflaterReader.java index 91f0a0b7f6f..f5e415c3a59 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/DeflaterReader.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/DeflaterReader.java @@ -23,7 +23,9 @@ /** * A DeflaterReader + *

      * The reader takes an inputstream and compress it. + *

      * Not for concurrent use. */ public class DeflaterReader extends InputStream { @@ -55,12 +57,11 @@ public int read() throws IOException { } /** - * Try to fill the buffer with compressed bytes. Except the last effective read, - * this method always returns with a full buffer of compressed data. + * Try to fill the buffer with compressed bytes. Except the last effective read, this method always returns with a + * full buffer of compressed data. * * @param buffer the buffer to fill compressed bytes - * @return the number of bytes really filled, -1 indicates end. - * @throws IOException + * @return the number of bytes really filled, -1 indicates end */ @Override public int read(final byte[] buffer, int offset, int len) throws IOException { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/IDGenerator.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/IDGenerator.java index 4cbc2ff0f74..2cb0bccf9b2 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/IDGenerator.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/IDGenerator.java @@ -19,12 +19,12 @@ /** * Generator of record IDs for the journals. *

      - * Notice that while the bindings and messages journals are independent from one another they use - * the same {@link IDGenerator} instance. + * Notice that while the bindings and messages journals are independent from one another they use the same + * {@link IDGenerator} instance. *

      - * The next recordID should be persisted in the journals during a normal shutdown. The lack of such - * a record indicates a server crash. During server restart, if the journals lack a - * {@literal next-recordID} record, we use the last recorded ID plus {@code MAX_INT}. + * The next recordID should be persisted in the journals during a normal shutdown. The lack of such a record indicates a + * server crash. During server restart, if the journals lack a {@literal next-recordID} record, we use the last recorded + * ID plus {@code MAX_INT}. */ public interface IDGenerator { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/InflaterReader.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/InflaterReader.java index 183989f4f08..6ff5b3c44e3 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/InflaterReader.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/InflaterReader.java @@ -23,8 +23,8 @@ /** * InflaterReader - * It takes a compressed input stream and decompressed it as it is being read. - * Not for concurrent use. + *

      + * It takes a compressed input stream and decompressed it as it is being read. Not for concurrent use. */ public class InflaterReader extends InputStream { @@ -70,9 +70,8 @@ public int read() throws IOException { } /* - * feed inflater more bytes in order to get some - * decompressed output. - * returns number of bytes actually got + * Feed inflater more bytes in order to get some decompressed output. + * returns number of bytes actually read */ private int doRead(byte[] buf, int offset, int len) throws DataFormatException, IOException { int read = 0; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/InflaterWriter.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/InflaterWriter.java index 2921276ba80..143a354f141 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/InflaterWriter.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/InflaterWriter.java @@ -24,9 +24,8 @@ /** * InflaterWriter *

      - * This class takes an OutputStream. Compressed bytes - * can directly be written into this class. The class will - * decompress the bytes and write them to the output stream. + * This class takes an OutputStream. Compressed bytes can directly be written into this class. The class will decompress + * the bytes and write them to the output stream. *

      * Not for concurrent use. */ @@ -46,8 +45,10 @@ public InflaterWriter(final OutputStream output) { this.output = output; } - /* + /** * Write a compressed byte. + *

      + * {@inheritDoc} */ @Override public void write(final int b) throws IOException { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/JNDIUtil.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/JNDIUtil.java index edcbb505556..1502d36bd95 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/JNDIUtil.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/JNDIUtil.java @@ -61,10 +61,9 @@ public static void tearDownRecursively(final Context c) throws Exception { } /** - * Context.rebind() requires that all intermediate contexts and the target context (that named by - * all but terminal atomic component of the name) must already exist, otherwise - * NameNotFoundException is thrown. This method behaves similar to Context.rebind(), but creates - * intermediate contexts, if necessary. + * Context.rebind() requires that all intermediate contexts and the target context (that named by all but terminal + * atomic component of the name) must already exist, otherwise NameNotFoundException is thrown. This method behaves + * similar to Context.rebind(), but creates intermediate contexts, if necessary. */ public static void rebind(final Context c, final String jndiName, final Object o) throws NamingException { Context context = c; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ObjectInputStreamWithClassLoader.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ObjectInputStreamWithClassLoader.java index 3fa5d17429f..d2897b421c1 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ObjectInputStreamWithClassLoader.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/ObjectInputStreamWithClassLoader.java @@ -30,7 +30,6 @@ public class ObjectInputStreamWithClassLoader extends ObjectInputStream { - /** * Value used to indicate that all classes should be allowed or denied */ @@ -43,11 +42,9 @@ public class ObjectInputStreamWithClassLoader extends ObjectInputStream { public static final String BLACKLIST_PROPERTY = "org.apache.activemq.artemis.jms.deserialization.blacklist"; public static final String DENYLIST_PROPERTY = "org.apache.activemq.artemis.jms.deserialization.denylist"; - private List allowList = new ArrayList<>(); private List denyList = new ArrayList<>(); - public ObjectInputStreamWithClassLoader(final InputStream in) throws IOException { super(in); addToAllowList(System.getProperty(WHITELIST_PROPERTY, null)); @@ -58,24 +55,23 @@ public ObjectInputStreamWithClassLoader(final InputStream in) throws IOException } /** - * @return the allowList configured on this policy instance. + * @return the allowList configured on this policy instance */ public String getAllowList() { return StringUtil.joinStringList(allowList, ","); } /** - * @return the denyList configured on this policy instance. + * @return the denyList configured on this policy instance */ public String getDenyList() { return StringUtil.joinStringList(denyList, ","); } /** - * Replaces the currently configured allowList with a comma separated - * string containing the new allowList. Null or empty string denotes - * no allowList entries, {@value #CATCH_ALL_WILDCARD} indicates that - * all classes are allowListed. + * Replaces the currently configured allowList with a comma separated string containing the new allowList. Null or + * empty string denotes no allowList entries, {@value #CATCH_ALL_WILDCARD} indicates that all classes are + * allowListed. * * @param allowList the list that this policy is configured to recognize. */ @@ -84,22 +80,18 @@ public void setAllowList(String allowList) { } /** - * Adds to the currently configured allowList with a comma separated - * string containing the additional allowList entries. Null or empty - * string denotes no additional allowList entries. + * Adds to the currently configured allowList with a comma separated string containing the additional allowList + * entries. Null or empty string denotes no additional allowList entries. * - * @param allowList the additional list entries that this policy is - * configured to recognize. + * @param allowList the additional list entries that this policy is configured to recognize. */ public void addToAllowList(String allowList) { this.allowList.addAll(StringUtil.splitStringList(allowList, ",")); } /** - * Replaces the currently configured denyList with a comma separated - * string containing the new denyList. Null or empty string denotes - * no denylist entries, {@value #CATCH_ALL_WILDCARD} indicates that - * all classes are denylisted. + * Replaces the currently configured denyList with a comma separated string containing the new denyList. Null or + * empty string denotes no denylist entries, {@value #CATCH_ALL_WILDCARD} indicates that all classes are denylisted. * * @param denyList the list that this policy is configured to recognize. */ @@ -108,12 +100,10 @@ public void setDenyList(String denyList) { } /** - * Adds to the currently configured denyList with a comma separated - * string containing the additional denyList entries. Null or empty - * string denotes no additional denyList entries. + * Adds to the currently configured denyList with a comma separated string containing the additional denyList + * entries. Null or empty string denotes no additional denyList entries. * - * @param denyList the additional list entries that this policy is - * configured to recognize. + * @param denyList the additional list entries that this policy is configured to recognize. */ public void addToDenyList(String denyList) { this.denyList.addAll(StringUtil.splitStringList(denyList, ",")); @@ -145,12 +135,10 @@ protected Class resolveProxyClass(final String[] interfaces) throws IOException, } } - private Class resolveClass0(final ObjectStreamClass desc) throws IOException, ClassNotFoundException { String name = desc.getName(); ClassLoader loader = Thread.currentThread().getContextClassLoader(); try { - // HORNETQ-747 https://issues.jboss.org/browse/HORNETQ-747 // Use Class.forName instead of ClassLoader.loadClass to avoid issues with loading arrays Class clazz = Class.forName(name, false, loader); // sanity check only.. if a classLoader can't find a clazz, it will throw an exception diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/PrefixUtil.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/PrefixUtil.java index 850257697ff..ce20c438754 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/PrefixUtil.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/PrefixUtil.java @@ -70,8 +70,10 @@ public static String removePrefix(String string, String prefix) { return string.substring(prefix.length()); } - /** This will treat a prefix on the uri-type of queue://, topic://, temporaryTopic://, temporaryQueue. - * This is mostly used on conversions to treat JMSReplyTo or similar usages on core protocol */ + /** + * This will treat a prefix on the uri-type of queue://, topic://, temporaryTopic://, temporaryQueue. This is mostly + * used on conversions to treat JMSReplyTo or similar usages on core protocol + */ public static String getURIPrefix(String address) { int index = address.indexOf("://"); if (index > 0) { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TimeAndCounterIDGenerator.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TimeAndCounterIDGenerator.java index 58213e8ac9b..22ba790b316 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TimeAndCounterIDGenerator.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TimeAndCounterIDGenerator.java @@ -21,8 +21,8 @@ /** * A TimeAndCounterIDGenerator *

      - * This IDGenerator doesn't support more than 16777215 IDs per 16 millisecond. It would throw an exception if this happens. - *

      + * This IDGenerator doesn't support more than 16777215 IDs per 16 millisecond. It would throw an exception if this + * happens. */ public class TimeAndCounterIDGenerator implements IDGenerator { diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TokenBucketLimiter.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TokenBucketLimiter.java index d9a0ea65370..95e60c4a302 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TokenBucketLimiter.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TokenBucketLimiter.java @@ -27,7 +27,7 @@ public interface TokenBucketLimiter { /** - * Returns the rate in cycles per second (which is the same as saying 'in Hertz'). + * {@return the rate in cycles per second (which is the same as saying 'in Hertz')} * * @see Hertz */ diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TokenBucketLimiterImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TokenBucketLimiterImpl.java index ed11e4f3094..b4d44242c54 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TokenBucketLimiterImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/TokenBucketLimiterImpl.java @@ -27,14 +27,12 @@ public class TokenBucketLimiterImpl implements TokenBucketLimiter { private final boolean spin; /** - * Even thought we don't use TokenBucket in multiThread - * the implementation should keep this volatile for correctness + * Even thought we don't use TokenBucket in multiThread the implementation should keep this volatile for correctness */ private volatile long last; /** - * Even thought we don't use TokenBucket in multiThread - * the implementation should keep this volatile for correctness + * Even thought we don't use TokenBucket in multiThread the implementation should keep this volatile for correctness */ private int tokens; 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 393ff22ca82..ecdc79de905 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 @@ -148,8 +148,7 @@ public static String elementToString(final Node n) { } /** - * Note: if the content is another element or set of elements, it returns a string representation - * of the hierarchy. + * Note: if the content is another element or set of elements, it returns a string representation of the hierarchy. */ public static String getTextContent(final Node n) { if (n.hasChildNodes()) { diff --git a/artemis-core-client/src/test/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstantTest.java b/artemis-core-client/src/test/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstantTest.java index 2243d66e54a..bae09f2acee 100644 --- a/artemis-core-client/src/test/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstantTest.java +++ b/artemis-core-client/src/test/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstantTest.java @@ -23,8 +23,9 @@ public class TransportConstantTest { - /** We change the default on the main pom.xml - * This is just validating the pom still works */ + /** + * We change the default on the main pom.xml This is just validating the pom still works + */ @Test public void testDefaultOnPom() { assertEquals(0, TransportConstants.DEFAULT_QUIET_PERIOD, "It is expected to have the default at 0 on the testsuite"); diff --git a/artemis-core-client/src/test/java/org/apache/activemq/artemis/message/CoreMessageTest.java b/artemis-core-client/src/test/java/org/apache/activemq/artemis/message/CoreMessageTest.java index 09108c7cd9b..58b66e83031 100644 --- a/artemis-core-client/src/test/java/org/apache/activemq/artemis/message/CoreMessageTest.java +++ b/artemis-core-client/src/test/java/org/apache/activemq/artemis/message/CoreMessageTest.java @@ -61,9 +61,9 @@ public class CoreMessageTest { public static final SimpleString PROP1_VALUE = SimpleString.of("value-t1"); /** - * This encode was generated by {@link #generate()}. - * Run it manually with a right-click on the IDE to eventually update it - * */ + * This encode was generated by {@link #generate()}. Run it manually with a right-click on the IDE to eventually + * update it + */ // body = "hi"; private final String STRING_ENCODE = "AAAAFgEAAAAEaABpAAAAAAAAAAAAAQAAACR0AGgAaQBzAC4AbABvAGMAYQBsAC4AYQBkAGQAcgBlAHMAcwAAAwEAAAAAAAAAewAAAAAAAAFBAwEAAAABAAAABHQAMQAKAAAAEHYAYQBsAHUAZQAtAHQAMQA="; @@ -78,7 +78,9 @@ public void before() { BYTE_ENCODE.readerIndex(0).writerIndex(BYTE_ENCODE.capacity()); } - /** The message is received, then sent to the other side untouched */ + /** + * The message is received, then sent to the other side untouched + */ @Test public void testPassThrough() { CoreMessage decodedMessage = decodeMessage(); @@ -94,7 +96,9 @@ public void testBodyBufferSize() { assertEquals(bodyBufferSize, readonlyBodyBufferReadableBytes); } - /** The message is received, then sent to the other side untouched */ + /** + * The message is received, then sent to the other side untouched + */ @Test public void sendThroughPackets() { CoreMessage decodedMessage = decodeMessage(); @@ -123,7 +127,9 @@ public void sendThroughPackets() { assertEquals(TEXT, TextMessageUtil.readBodyText(sendMessageReceivedSent.getMessage().getReadOnlyBodyBuffer()).toString()); } - /** The message is received, then sent to the other side untouched */ + /** + * The message is received, then sent to the other side untouched + */ @Test public void sendThroughPacketsClient() { CoreMessage decodedMessage = decodeMessage(); @@ -188,7 +194,9 @@ private CoreMessage internalDecode(ByteBuf bufferOrigin) { return coreMessage; } - /** The message is received, then sent to the other side untouched */ + /** + * The message is received, then sent to the other side untouched + */ @Test public void testChangeBodyStringSameSize() { testChangeBodyString(TEXT.toUpperCase()); @@ -352,7 +360,9 @@ public void compareOriginal() throws Exception { } } - /** Use this method to update the encode for the known message */ + /** + * Use this method to update the encode for the known message + */ @Disabled @Test public void generate() throws Exception { diff --git a/artemis-dto/src/main/java/org/apache/activemq/artemis/dto/RequestLogDTO.java b/artemis-dto/src/main/java/org/apache/activemq/artemis/dto/RequestLogDTO.java index 5137307c348..a20b5fc0b52 100644 --- a/artemis-dto/src/main/java/org/apache/activemq/artemis/dto/RequestLogDTO.java +++ b/artemis-dto/src/main/java/org/apache/activemq/artemis/dto/RequestLogDTO.java @@ -111,7 +111,8 @@ public class RequestLogDTO { public Boolean preferProxiedForAddress; /** - * the format to use for logging; see https://www.eclipse.org/jetty/javadoc/jetty-9/org/eclipse/jetty/server/CustomRequestLog.html + * the format to use for logging; see + * https://www.eclipse.org/jetty/javadoc/jetty-9/org/eclipse/jetty/server/CustomRequestLog.html */ @XmlAttribute public String format; 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 c511553c60c..f58289eeecf 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 @@ -50,7 +50,8 @@ public static SQLProvider getSQLProvider(Map dataSourcePropertie } /** - * Append to {@code errorMessage} a detailed description of the provided {@link SQLException}.
      + * Append to {@code errorMessage} a detailed description of the provided {@link SQLException}. + *

      * The information appended are: *

        *
      • SQL STATEMENTS
      • @@ -71,7 +72,8 @@ public static StringBuilder appendSQLExceptionDetails(StringBuilder errorMessage } /** - * Append to {@code errorMessage} a detailed description of the provided {@link SQLException}.
        + * Append to {@code errorMessage} a detailed description of the provided {@link SQLException}. + *

        * The information appended are: *

          *
        • SQL EXCEPTIONS details ({@link SQLException#getSQLState}, 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 1b22bea44b0..6af1308ff45 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 @@ -231,14 +231,15 @@ private void pollWrites() { writeList.forEach(this::doCallback); } - /* Even though I would love to have a reusable byte[] for the following buffer - PreparedStatement.setData takes a byte[] without any sizing on the interface. - Blob interface would support setBytes with an offset and size, but some of the databases we are using - (DB2 specifically) is not allowing us to use Blob (at least during our dev time). - for that reason I'm using this byte[] with the very specific size that needs to be written - - Also Notice that our PagingManager will make sure that this size wouldn't go beyond our page-size limit - which we also limit at the JDBC storage, which should be 100K. */ + /* + * Even though I would love to have a reusable byte[] for the following buffer PreparedStatement.setData takes a + * byte[] without any sizing on the interface. Blob interface would support setBytes with an offset and size, but + * some of the databases we are using (DB2 specifically) is not allowing us to use Blob (at least during our dev + * time). For that reason I'm using this byte[] with the very specific size that needs to be written + * + * Also Notice that our PagingManager will make sure that this size wouldn't go beyond our page-size limit which we + * also limit at the JDBC storage, which should be 100K. + */ private byte[] extractBytes(List writeList) { int totalSize = 0; ScheduledWrite write; 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 c0e32a11e3e..41ad1127ec4 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 @@ -101,9 +101,6 @@ public List listFiles(String extension) throws Exception { /** * Opens the supplied file. If the file does not exist in the database it will create a new one. - * - * @param file - * @throws SQLException */ public void openFile(JDBCSequentialFile file) throws SQLException { final long fileId = getFileID(file); @@ -121,10 +118,6 @@ void removeFile(JDBCSequentialFile file) { /** * Checks to see if a file with filename and extension exists. If so returns the ID of the file or returns -1. - * - * @param file - * @return - * @throws SQLException */ public long getFileID(JDBCSequentialFile file) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { @@ -148,9 +141,6 @@ public long getFileID(JDBCSequentialFile file) throws SQLException { /** * Loads an existing file. - * - * @param file - * @throws SQLException */ public void loadFile(JDBCSequentialFile file) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { @@ -180,9 +170,6 @@ public void loadFile(JDBCSequentialFile file) throws SQLException { /** * Creates a new database row representing the supplied file. - * - * @param file - * @throws SQLException */ public void createFile(JDBCSequentialFile file) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { @@ -211,10 +198,6 @@ public void createFile(JDBCSequentialFile file) throws SQLException { /** * Updates the fileName field to the new value. - * - * @param file - * @param newFileName - * @throws SQLException */ public void renameFile(JDBCSequentialFile file, String newFileName) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { @@ -233,9 +216,6 @@ public void renameFile(JDBCSequentialFile file, String newFileName) throws SQLEx /** * Deletes the associated row in the database. - * - * @param file - * @throws SQLException */ public void deleteFile(JDBCSequentialFile file) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { @@ -253,11 +233,6 @@ public void deleteFile(JDBCSequentialFile file) throws SQLException { /** * Persists data to this files associated database mapping. - * - * @param file - * @param data - * @return - * @throws SQLException */ public int writeToFile(JDBCSequentialFile file, byte[] data, boolean append) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { @@ -296,11 +271,6 @@ public int writeToFile(JDBCSequentialFile file, byte[] data, boolean append) thr /** * Reads data from the file (at file.readPosition) into the byteBuffer. - * - * @param file - * @param bytes - * @return - * @throws SQLException */ public int readFromFile(JDBCSequentialFile file, ByteBuffer bytes) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { @@ -340,10 +310,6 @@ public int readFromFile(JDBCSequentialFile file, ByteBuffer bytes) throws SQLExc /** * Copy the data content of FileFrom to FileTo - * - * @param fileFrom - * @param fileTo - * @throws SQLException */ public void copyFileData(JDBCSequentialFile fileFrom, JDBCSequentialFile fileTo) throws SQLException { try (Connection connection = connectionProvider.getConnection()) { diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/PostgresLargeObjectManager.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/PostgresLargeObjectManager.java index 24e8d275485..fa5e67793d0 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/PostgresLargeObjectManager.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/PostgresLargeObjectManager.java @@ -40,8 +40,7 @@ public class PostgresLargeObjectManager { public static final int READ = 0x00040000; /** - * This mode is the default. It indicates we want read and write access to - * a large object + * This mode is the default. It indicates we want read and write access to a large object */ public static final int READWRITE = READ | WRITE; diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/ScheduledWrite.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/ScheduledWrite.java index 63ccce9bcf2..9d84154a5f9 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/ScheduledWrite.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/ScheduledWrite.java @@ -74,7 +74,9 @@ public int readAt(byte[] dst, int offset) { } } - /** Remove references letting buffer to be ready for GC */ + /** + * Remove references letting buffer to be ready for GC + */ public void releaseBuffer() { amqBuffer = null; ioBuffer = null; 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 03c023df234..f6a6c8f5fd9 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 @@ -146,8 +146,6 @@ public void flush() throws Exception { /** * The max size record that can be stored in the journal - * - * @return */ @Override public long getMaxRecordSize() { @@ -279,7 +277,9 @@ public synchronized int sync() { } } - /** public for tests only, not through API */ + /** + * public for tests only, not through API + */ public void handleException(List recordRef, Throwable e) { logger.warn(e.getMessage(), e); failed.set(true); @@ -292,8 +292,10 @@ public void handleException(List recordRef, Throwable e) { } } - /* We store Transaction reference in memory (once all records associated with a Tranascation are Deleted, - we remove the Tx Records (i.e. PREPARE, COMMIT). */ + /* + * We store Transaction reference in memory (once all records associated with a Transaction are Deleted, we remove + * the Tx Records (i.e. PREPARE, COMMIT). + */ private synchronized boolean cleanupTxRecords(List deletedRecords, List committedTx, PreparedStatement deleteJournalTxRecords) throws SQLException { List iterableCopy; diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallback.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallback.java index 58fc643ab12..9f779390711 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallback.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalLoaderCallback.java @@ -33,8 +33,10 @@ class JDBCJournalLoaderCallback implements LoaderCallback { private final TransactionFailureCallback failureCallback; - /* We keep track of list entries for each ID. This preserves order and allows multiple record insertions with the - same ID. We use this for deleting records */ + /* + * We keep track of list entries for each ID. This preserves order and allows multiple record insertions with the + * same ID. We use this for deleting records. + */ private final Map> deleteReferences = new HashMap<>(); private final List committedRecords; 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 43d682f1ea0..2549db4ff96 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 @@ -37,9 +37,9 @@ /** * Property-based implementation of a {@link SQLProvider}'s factory. - * + *

          * Properties are stored in a journal-sql.properties. - * + *

          * Dialects specific to a database can be customized by suffixing the property keys with the name of the dialect. */ public class PropertySQLProvider implements SQLProvider { diff --git a/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryTest.java b/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryTest.java index 7d3769a6b3b..ea34283f825 100644 --- a/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryTest.java +++ b/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryTest.java @@ -318,8 +318,6 @@ public void testCloneFile() throws Exception { * descriptor has enough information. However, with JDBC we do require that some information is loaded in order to * get the underlying BLOB. This tests ensures that file.size() returns the correct value, without the user calling * file.open() with JDBCSequentialFile. - * - * @throws Exception */ @TestTemplate public void testGetFileSizeWorksWhenNotOpen() throws Exception { 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 f154b782cf6..da5fa58db81 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 @@ -60,30 +60,22 @@ public class ActiveMQJMSClient { DEFAULT_ENABLE_1X_PREFIXES = prefixes; } - /** - * Creates an ActiveMQConnectionFactory; - * - * @return the ActiveMQConnectionFactory - */ public static ActiveMQConnectionFactory createConnectionFactory(final String url, String name) throws Exception { ConnectionFactoryParser parser = new ConnectionFactoryParser(); return parser.newObject(parser.expandURI(url), name); } /** - * Creates an ActiveMQConnectionFactory that receives cluster topology updates from the cluster as - * servers leave or join and new backups are appointed or removed. + * Creates an ActiveMQConnectionFactory that receives cluster topology updates from the cluster as servers leave or + * join and new backups are appointed or removed. *

          - * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP - * broadcasts which contain connection information for members of the cluster. The broadcasted - * connection information is simply used to make an initial connection to the cluster, once that - * connection is made, up to date cluster topology information is downloaded and automatically - * updated whenever the cluster topology changes. If the topology includes backup servers that - * information is also propagated to the client so that it can know which server to failover onto - * in case of server failure. + * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP broadcasts which + * contain connection information for members of the cluster. The broadcasted connection information is simply used + * to make an initial connection to the cluster, once that connection is made, up to date cluster topology + * information is downloaded and automatically updated whenever the cluster topology changes. If the topology + * includes backup servers that information is also propagated to the client so that it can know which server to + * failover onto in case of server failure. * - * @param groupConfiguration - * @param jmsFactoryType * @return the ActiveMQConnectionFactory */ public static ActiveMQConnectionFactory createConnectionFactoryWithHA(final DiscoveryGroupConfiguration groupConfiguration, @@ -92,12 +84,11 @@ public static ActiveMQConnectionFactory createConnectionFactoryWithHA(final Disc } /** - * Create an ActiveMQConnectionFactory which creates session factories from a set of active servers, no HA backup information is propagated to the client - * + * Create an ActiveMQConnectionFactory which creates session factories from a set of active servers, no HA backup + * information is propagated to the client + *

          * The UDP address and port are used to listen for active servers in the cluster * - * @param groupConfiguration - * @param jmsFactoryType * @return the ActiveMQConnectionFactory */ public static ActiveMQConnectionFactory createConnectionFactoryWithoutHA(final DiscoveryGroupConfiguration groupConfiguration, @@ -106,19 +97,17 @@ public static ActiveMQConnectionFactory createConnectionFactoryWithoutHA(final D } /** - * Create an ActiveMQConnectionFactory which will receive cluster topology updates from the cluster - * as servers leave or join and new backups are appointed or removed. + * Create an ActiveMQConnectionFactory which will receive cluster topology updates from the cluster as servers leave + * or join and new backups are appointed or removed. *

          - * The initial list of servers supplied in this method is simply to make an initial connection to - * the cluster, once that connection is made, up to date cluster topology information is - * downloaded and automatically updated whenever the cluster topology changes. If the topology - * includes backup servers that information is also propagated to the client so that it can know - * which server to failover onto in case of server failure. + * The initial list of servers supplied in this method is simply to make an initial connection to the cluster, once + * that connection is made, up to date cluster topology information is downloaded and automatically updated whenever + * the cluster topology changes. If the topology includes backup servers that information is also propagated to the + * client so that it can know which server to failover onto in case of server failure. * - * @param jmsFactoryType - * @param initialServers The initial set of servers used to make a connection to the cluster. - * Each one is tried in turn until a successful connection is made. Once a connection - * is made, the cluster topology is downloaded and the rest of the list is ignored. + * @param initialServers The initial set of servers used to make a connection to the cluster. Each one is tried in + * turn until a successful connection is made. Once a connection is made, the cluster topology + * is downloaded and the rest of the list is ignored. * @return the ActiveMQConnectionFactory */ public static ActiveMQConnectionFactory createConnectionFactoryWithHA(JMSFactoryType jmsFactoryType, @@ -130,11 +119,9 @@ public static ActiveMQConnectionFactory createConnectionFactoryWithHA(JMSFactory * Create an ActiveMQConnectionFactory which creates session factories using a static list of * transportConfigurations. *

          - * The ActiveMQConnectionFactory is not updated automatically as the cluster topology changes, and - * no HA backup information is propagated to the client + * The ActiveMQConnectionFactory is not updated automatically as the cluster topology changes, and no HA backup + * information is propagated to the client * - * @param jmsFactoryType - * @param transportConfigurations * @return the ActiveMQConnectionFactory */ public static ActiveMQConnectionFactory createConnectionFactoryWithoutHA(JMSFactoryType jmsFactoryType, @@ -144,9 +131,9 @@ public static ActiveMQConnectionFactory createConnectionFactoryWithoutHA(JMSFact /** * Creates a client-side representation of a JMS Topic. - * - * This method is deprecated. Use {@link org.apache.activemq.artemis.jms.client.ActiveMQSession#createTopic(String)} as that method will know the proper - * prefix used at the target server. + *

          + * This method is deprecated. Use {@link org.apache.activemq.artemis.jms.client.ActiveMQSession#createTopic(String)} + * as that method will know the proper prefix used at the target server. * * @param name the name of the topic * @return The Topic @@ -162,10 +149,10 @@ public static Topic createTopic(final String name) { /** * Creates a client-side representation of a JMS Queue. + *

          + * This method is deprecated. Use {@link org.apache.activemq.artemis.jms.client.ActiveMQSession#createQueue(String)} + * (String)} as that method will know the proper prefix used at the target server. * * - * This method is deprecated. Use {@link org.apache.activemq.artemis.jms.client.ActiveMQSession#createQueue(String)} (String)} as that method will know the proper - * prefix used at the target server. - * * * @param name the name of the queue * @return The Queue */ diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/JMSFactoryType.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/JMSFactoryType.java index 01ad1a69b40..ffcfa52a062 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/JMSFactoryType.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/JMSFactoryType.java @@ -16,6 +16,13 @@ */ package org.apache.activemq.artemis.api.jms; +import javax.jms.ConnectionFactory; +import javax.jms.QueueConnectionFactory; +import javax.jms.TopicConnectionFactory; +import javax.jms.XAConnectionFactory; +import javax.jms.XAQueueConnectionFactory; +import javax.jms.XATopicConnectionFactory; + import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration; import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; @@ -23,17 +30,9 @@ import org.apache.activemq.artemis.jms.client.ActiveMQQueueConnectionFactory; import org.apache.activemq.artemis.jms.client.ActiveMQTopicConnectionFactory; import org.apache.activemq.artemis.jms.client.ActiveMQXAConnectionFactory; -import org.apache.activemq.artemis.jms.client.ActiveMQXATopicConnectionFactory; import org.apache.activemq.artemis.jms.client.ActiveMQXAQueueConnectionFactory; +import org.apache.activemq.artemis.jms.client.ActiveMQXATopicConnectionFactory; -import javax.jms.ConnectionFactory; -import javax.jms.QueueConnectionFactory; -import javax.jms.TopicConnectionFactory; -import javax.jms.XAConnectionFactory; -import javax.jms.XAQueueConnectionFactory; -import javax.jms.XATopicConnectionFactory; - -// XXX no javadocs public enum JMSFactoryType { CF { @Override @@ -216,45 +215,42 @@ public static JMSFactoryType valueOf(int val) { } /** - * Creates an ActiveMQConnectionFactory that receives cluster topology updates from the cluster as - * servers leave or join and new backups are appointed or removed. + * Creates an ActiveMQConnectionFactory that receives cluster topology updates from the cluster as servers leave or + * join and new backups are appointed or removed. *

          - * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP - * broadcasts which contain connection information for members of the cluster. The broadcasted - * connection information is simply used to make an initial connection to the cluster, once that - * connection is made, up to date cluster topology information is downloaded and automatically - * updated whenever the cluster topology changes. If the topology includes backup servers that - * information is also propagated to the client so that it can know which server to failover onto - * in case of server failure. + * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP broadcasts which + * contain connection information for members of the cluster. The broadcasted connection information is simply used + * to make an initial connection to the cluster, once that connection is made, up to date cluster topology + * information is downloaded and automatically updated whenever the cluster topology changes. If the topology + * includes backup servers that information is also propagated to the client so that it can know which server to + * failover onto in case of server failure. * - * @param groupConfiguration * @return the ActiveMQConnectionFactory */ public abstract ActiveMQConnectionFactory createConnectionFactoryWithHA(DiscoveryGroupConfiguration groupConfiguration); /** - * Create an ActiveMQConnectionFactory which creates session factories from a set of active servers, no HA backup information is propagated to the client + * Create an ActiveMQConnectionFactory which creates session factories from a set of active servers, no HA backup + * information is propagated to the client *

          * The UDP address and port are used to listen for active servers in the cluster * - * @param groupConfiguration * @return the ActiveMQConnectionFactory */ public abstract ActiveMQConnectionFactory createConnectionFactoryWithoutHA(DiscoveryGroupConfiguration groupConfiguration); /** - * Create an ActiveMQConnectionFactory which will receive cluster topology updates from the cluster - * as servers leave or join and new backups are appointed or removed. + * Create an ActiveMQConnectionFactory which will receive cluster topology updates from the cluster as servers leave + * or join and new backups are appointed or removed. *

          - * The initial list of servers supplied in this method is simply to make an initial connection to - * the cluster, once that connection is made, up to date cluster topology information is - * downloaded and automatically updated whenever the cluster topology changes. If the topology - * includes backup servers that information is also propagated to the client so that it can know - * which server to failover onto in case of server failure. + * The initial list of servers supplied in this method is simply to make an initial connection to the cluster, once + * that connection is made, up to date cluster topology information is downloaded and automatically updated whenever + * the cluster topology changes. If the topology includes backup servers that information is also propagated to the + * client so that it can know which server to failover onto in case of server failure. * - * @param initialServers The initial set of servers used to make a connection to the cluster. - * Each one is tried in turn until a successful connection is made. Once a connection - * is made, the cluster topology is downloaded and the rest of the list is ignored. + * @param initialServers The initial set of servers used to make a connection to the cluster. Each one is tried in + * turn until a successful connection is made. Once a connection is made, the cluster topology + * is downloaded and the rest of the list is ignored. * @return the ActiveMQConnectionFactory */ public abstract ActiveMQConnectionFactory createConnectionFactoryWithHA(TransportConfiguration... initialServers); @@ -263,18 +259,15 @@ public static JMSFactoryType valueOf(int val) { * Create an ActiveMQConnectionFactory which creates session factories using a static list of * transportConfigurations. *

          - * The ActiveMQConnectionFactory is not updated automatically as the cluster topology changes, and - * no HA backup information is propagated to the client + * The ActiveMQConnectionFactory is not updated automatically as the cluster topology changes, and no HA backup + * information is propagated to the client * - * @param transportConfigurations * @return the ActiveMQConnectionFactory */ public abstract ActiveMQConnectionFactory createConnectionFactoryWithoutHA(TransportConfiguration... transportConfigurations); /** - * Returns the connection factory interface that this JMSFactoryType creates. - * - * @return the javax.jms Class ConnectionFactory interface + * {@return the javax.jms Class ConnectionFactory interface} */ public abstract Class connectionFactoryInterface(); diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSManagementHelper.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSManagementHelper.java index 4d0306ba559..2c1668e1380 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSManagementHelper.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/api/jms/management/JMSManagementHelper.java @@ -52,7 +52,8 @@ public static void putAttribute(final Message message, } /** - * Stores an operation invocation in a JMS message to invoke the corresponding operation the value from the server resource. + * Stores an operation invocation in a JMS message to invoke the corresponding operation the value from the server + * resource. * * @param message JMS message * @param resourceName the name of the resource @@ -79,7 +80,8 @@ private static JMSException convertFromException(final Exception e) { } /** - * Stores an operation invocation in a JMS message to invoke the corresponding operation the value from the server resource. + * Stores an operation invocation in a JMS message to invoke the corresponding operation the value from the server + * resource. * * @param message JMS message * @param resourceName the name of the server resource @@ -100,51 +102,48 @@ public static void putOperationInvocation(final Message message, } /** - * Returns whether the JMS message corresponds to the result of a management operation invocation. + * {@return whether the JMS message corresponds to the result of a management operation invocation.} */ public static boolean isOperationResult(final Message message) throws JMSException { return ManagementHelper.isOperationResult(JMSManagementHelper.getCoreMessage(message)); } /** - * Returns whether the JMS message corresponds to the result of a management attribute value. + * {@return whether the JMS message corresponds to the result of a management attribute value.} */ public static boolean isAttributesResult(final Message message) throws JMSException { return ManagementHelper.isAttributesResult(JMSManagementHelper.getCoreMessage(message)); } /** - * Returns whether the invocation of the management operation on the server resource succeeded. + * {@return whether the invocation of the management operation on the server resource succeeded.} */ public static boolean hasOperationSucceeded(final Message message) throws JMSException { return ManagementHelper.hasOperationSucceeded(JMSManagementHelper.getCoreMessage(message)); } /** - * Returns the result of an operation invocation or an attribute value. - *
          - * If an error occurred on the server, {@link #hasOperationSucceeded(Message)} will return {@code false}. - * and the result will be a String corresponding to the server exception. + * {@return the result of an operation invocation or an attribute value; if an error occurred on the server {@link + * #hasOperationSucceeded(Message)} will return {@code false} and the result will be a {@code String} corresponding + * to the server exception} */ public static Object[] getResults(final Message message) throws Exception { return ManagementHelper.getResults(JMSManagementHelper.getCoreMessage(message)); } /** - * Returns the result of an operation invocation or an attribute value. - *
          - * If an error occurred on the server, {@link #hasOperationSucceeded(Message)} will return {@code false}. - * and the result will be a String corresponding to the server exception. + * {@return the result of an operation invocation or an attribute value; if an error occurred on the server {@link + * #hasOperationSucceeded(Message)} will return {@code false} and the result will be a {@code String} corresponding + * to the server exception} */ public static Object getResult(final Message message) throws Exception { return getResult(message, null); } /** - * Returns the result of an operation invocation or an attribute value. - *
          - * If an error occurred on the server, {@link #hasOperationSucceeded(Message)} will return {@code false}. - * and the result will be a String corresponding to the server exception. + * {@return the result of an operation invocation or an attribute value; if an error occurred on the server {@link + * #hasOperationSucceeded(Message)} will return {@code false} and the result will be a {@code String} corresponding + * to the server exception} */ public static Object getResult(final Message message, Class desiredType) throws Exception { return ManagementHelper.getResult(JMSManagementHelper.getCoreMessage(message), desiredType); diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java index 8b66bc6ada2..d9f8cc55aad 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java @@ -61,8 +61,8 @@ /** * ActiveMQ Artemis implementation of a JMS Connection. *

          - * The flat implementation of {@link TopicConnection} and {@link QueueConnection} is per design, - * following the common usage of these as one flat API in JMS 1.1. + * The flat implementation of {@link TopicConnection} and {@link QueueConnection} is per design, following the common + * usage of these as one flat API in JMS 1.1. */ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl implements TopicConnection, QueueConnection { @@ -173,12 +173,10 @@ public ActiveMQConnection(final ConnectionFactoryOptions options, } /** - * This internal method serves basically the Resource Adapter. - * The resource adapter plays with an XASession and a non XASession. - * When there is no enlisted transaction, the EE specification mandates that the commit should - * be done as if it was a nonXA Session (i.e. SessionTransacted). - * For that reason we have this method to force that nonXASession, since the JMS Javadoc - * mandates createSession to return a XASession. + * This internal method serves basically the Resource Adapter. The resource adapter plays with an XASession and a non + * XASession. When there is no enlisted transaction, the EE specification mandates that the commit should be done as + * if it was a nonXA Session (i.e. SessionTransacted). For that reason we have this method to force that + * nonXASession, since the JMS Javadoc mandates createSession to return a XASession. */ public synchronized Session createNonXASession(final boolean transacted, final int acknowledgeMode) throws JMSException { checkClosed(); @@ -187,12 +185,10 @@ public synchronized Session createNonXASession(final boolean transacted, final i } /** - * This internal method serves basically the Resource Adapter. - * The resource adapter plays with an XASession and a non XASession. - * When there is no enlisted transaction, the EE specification mandates that the commit should - * be done as if it was a nonXA Session (i.e. SessionTransacted). - * For that reason we have this method to force that nonXASession, since the JMS Javadoc - * mandates createSession to return a XASession. + * This internal method serves basically the Resource Adapter. The resource adapter plays with an XASession and a non + * XASession. When there is no enlisted transaction, the EE specification mandates that the commit should be done as + * if it was a nonXA Session (i.e. SessionTransacted). For that reason we have this method to force that + * nonXASession, since the JMS Javadoc mandates createSession to return a XASession. */ public synchronized Session createNonXATopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException { checkClosed(); @@ -201,12 +197,10 @@ public synchronized Session createNonXATopicSession(final boolean transacted, fi } /** - * This internal method serves basically the Resource Adapter. - * The resource adapter plays with an XASession and a non XASession. - * When there is no enlisted transaction, the EE specification mandates that the commit should - * be done as if it was a nonXA Session (i.e. SessionTransacted). - * For that reason we have this method to force that nonXASession, since the JMS Javadoc - * mandates createSession to return a XASession. + * This internal method serves basically the Resource Adapter. The resource adapter plays with an XASession and a non + * XASession. When there is no enlisted transaction, the EE specification mandates that the commit should be done as + * if it was a nonXA Session (i.e. SessionTransacted). For that reason we have this method to force that + * nonXASession, since the JMS Javadoc mandates createSession to return a XASession. */ public synchronized Session createNonXAQueueSession(final boolean transacted, final int acknowledgeMode) throws JMSException { checkClosed(); @@ -498,7 +492,6 @@ public ConnectionConsumer createSharedDurableConnectionConsumer(Topic topic, * Sets a FailureListener for the session which is notified if a failure occurs on the session. * * @param listener the listener to add - * @throws JMSException */ public void setFailoverListener(final FailoverEventListener listener) throws JMSException { checkClosed(); @@ -510,8 +503,7 @@ public void setFailoverListener(final FailoverEventListener listener) throws JMS } /** - * @return {@link FailoverEventListener} the current failover event listener for this connection - * @throws JMSException + * {@return {@link FailoverEventListener} the current failover event listener for this connection} */ public FailoverEventListener getFailoverListener() throws JMSException { checkClosed(); @@ -612,13 +604,6 @@ public ClientSessionFactory getSessionFactory() { } - /** - * @param transacted - * @param acknowledgeMode - * @param session - * @param type - * @return - */ protected ActiveMQSession createAMQSession(boolean isXA, boolean transacted, int acknowledgeMode, diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java index 0d31706dff1..bb8bd135b14 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java @@ -44,6 +44,7 @@ import java.util.Properties; import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration; +import org.apache.activemq.artemis.api.core.Interceptor; import org.apache.activemq.artemis.api.core.TransportConfiguration; import org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory; import org.apache.activemq.artemis.api.core.client.ActiveMQClient; @@ -63,8 +64,9 @@ import org.apache.activemq.artemis.utils.uri.URISupport; /** - *

          ActiveMQ Artemis implementation of a JMS ConnectionFactory.

          - *

          This connection factory will use defaults defined by {@link DefaultConnectionProperties}. + * ActiveMQ Artemis implementation of a JMS ConnectionFactory. + *

          + * This connection factory will use defaults defined by {@link DefaultConnectionProperties}. */ public class ActiveMQConnectionFactory extends JNDIStorable implements ConnectionFactoryOptions, Externalizable, ConnectionFactory, XAConnectionFactory, AutoCloseable { @@ -239,13 +241,14 @@ public ActiveMQConnectionFactory(String brokerURL) { } } - /** Warning: This method will not clear any previous properties. - * Say, you set the user on a first call. - * Now you just change the brokerURI on a second call without passing the user. - * The previous filled user will be already set, and nothing will clear it out. - * - * Also: you cannot use this method after the connection factory is made readOnly. - * Which happens after you create a first connection. */ + /** + * Warning: This method will not clear any previous properties. For example, if you set the user first then + * you change the brokerURL without passing the user. The previously set user will still exist, and nothing will + * clear it out. + *

          + * Also, you cannot use this method after this {@code ConnectionFactory} is made {@code readOnly} which happens after + * the first time it's used to create a connection. + */ public void setBrokerURL(String brokerURL) throws JMSException { if (readOnly) { throw new javax.jms.IllegalStateException("You cannot use setBrokerURL after the connection factory has been used"); @@ -640,9 +643,6 @@ public synchronized void setProducerWindowSize(final int producerWindowSize) { serverLocator.setProducerWindowSize(producerWindowSize); } - /** - * @param cacheLargeMessagesClient - */ public synchronized void setCacheLargeMessagesClient(final boolean cacheLargeMessagesClient) { checkWrite(); serverLocator.setCacheLargeMessagesClient(cacheLargeMessagesClient); @@ -806,7 +806,10 @@ public void setIgnoreJTA(boolean ignoreJTA) { } /** - * @param interceptorList a comma separated string of incoming interceptor class names to be used. Each interceptor needs a default Constructor to be used with this method. + * Set the list of {@link Interceptor}s to use for incoming packets. + * + * @param interceptorList a comma separated string of incoming interceptor class names to be used. Each interceptor + * needs a default Constructor to be used with this method. */ public void setIncomingInterceptorList(String interceptorList) { checkWrite(); @@ -818,7 +821,10 @@ public String getIncomingInterceptorList() { } /** - * @param interceptorList a comma separated string of incoming interceptor class names to be used. Each interceptor needs a default Constructor to be used with this method. + * Set the list of {@link Interceptor}s to use for outgoing packets. + * + * @param interceptorList a comma separated string of incoming interceptor class names to be used. Each interceptor + * needs a default Constructor to be used with this method. */ public void setOutgoingInterceptorList(String interceptorList) { serverLocator.setOutgoingInterceptorList(interceptorList); diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQDestination.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQDestination.java index 7cacc09e049..a9116684312 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQDestination.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQDestination.java @@ -46,8 +46,9 @@ public class ActiveMQDestination extends JNDIStorable implements Destination, Se public static final String TEMP_QUEUE_QUALIFED_PREFIX = DestinationUtil.TEMP_QUEUE_QUALIFED_PREFIX; public static final String TEMP_TOPIC_QUALIFED_PREFIX = DestinationUtil.TEMP_TOPIC_QUALIFED_PREFIX; - /** createQueue and createTopic from {@link ActiveMQSession} may change the name - * in case Prefix usage */ + /** + * {@code createQueue} and {@code createTopic} from {@link ActiveMQSession} may change the name in case Prefix usage + */ void setName(String name) { this.name = name; } @@ -193,7 +194,8 @@ public static Pair decomposeQueueNameForDurableSubscription(fina } if (currentPart != 1) { - /* JMS 2.0 introduced the ability to create "shared" subscriptions which do not require a clientID. + /* + * JMS 2.0 introduced the ability to create "shared" subscriptions which do not require a clientID. * In this case the subscription name will be the same as the queue name, but the above algorithm will put that * in the wrong position in the array so we need to move it. */ @@ -398,7 +400,7 @@ public void delete() throws JMSException { } try { - /** + /* * The status of the session used to create the temporary destination is uncertain, but the JMS spec states * that the lifetime of the temporary destination is tied to the connection so even if the originating * session is closed the temporary destination should still be deleted. Therefore, just create a new one diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSContext.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSContext.java index 9f13e077ae0..d4f6c952ba0 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSContext.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSContext.java @@ -125,9 +125,6 @@ private synchronized MessageProducer getInnerProducer() throws JMSException { return innerProducer; } - /** - * - */ private void checkSession() { if (session == null) { synchronized (this) { @@ -562,10 +559,8 @@ public void acknowledge() { } /** - * This is to be used on tests only. It's not part of the interface and it's not guaranteed to be kept - * on the API contract. - * - * @return + * This is to be used on tests only. It's not part of the interface and it's not guaranteed to be kept on the API + * contract. */ public Session getUsedSession() { return this.session; diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSProducer.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSProducer.java index c29926a1f05..73479df4161 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSProducer.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQJMSProducer.java @@ -41,10 +41,9 @@ import org.apache.activemq.artemis.utils.collections.TypedProperties; /** - * NOTE: this class forwards {@link #setDisableMessageID(boolean)} and - * {@link #setDisableMessageTimestamp(boolean)} calls their equivalent at the - * {@link MessageProducer}. IF the user is using the producer in async mode, this may lead to races. - * We allow/tolerate this because these are just optional optimizations. + * NOTE: this class forwards {@link #setDisableMessageID(boolean)} and {@link #setDisableMessageTimestamp(boolean)} + * calls their equivalent at the {@link MessageProducer}. IF the user is using the producer in async mode, this may lead + * to races. We allow/tolerate this because these are just optional optimizations. */ public final class ActiveMQJMSProducer implements JMSProducer { @@ -87,8 +86,7 @@ public JMSProducer send(Destination destination, Message message) { if (jmsHeaderType != null) { message.setJMSType(jmsHeaderType); } - // XXX HORNETQ-1209 "JMS 2.0" can this be a foreign msg? - // if so, then "SimpleString" properties will trigger an error. + // Can this be a foreign msg? If so, then "SimpleString" properties will trigger an error. setProperties(message); if (completionListener != null) { CompletionListener wrapped = new CompletionListenerWrapper(completionListener); @@ -104,9 +102,6 @@ public JMSProducer send(Destination destination, Message message) { /** * Sets all properties we carry onto the message. - * - * @param message - * @throws JMSException */ private void setProperties(Message message) throws JMSException { properties.forEach((k, v) -> { diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMapMessage.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMapMessage.java index 2a90916c98f..da0bbe8456f 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMapMessage.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMapMessage.java @@ -46,7 +46,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage { private boolean invalid; - /* + /** * This constructor is used to construct messages prior to sending */ protected ActiveMQMapMessage(final ClientSession session) { @@ -55,7 +55,7 @@ protected ActiveMQMapMessage(final ClientSession session) { invalid = true; } - /* + /** * This constructor is used during reading */ protected ActiveMQMapMessage(final ClientMessage message, final ClientSession session) { @@ -70,9 +70,6 @@ public ActiveMQMapMessage() { /** * Constructor for a foreign MapMessage - * - * @param foreign - * @throws JMSException */ public ActiveMQMapMessage(final MapMessage foreign, final ClientSession session) throws JMSException { super(foreign, ActiveMQMapMessage.TYPE, session); @@ -327,14 +324,6 @@ public void doBeforeReceive() throws ActiveMQException { readBodyMap(message.getBodyBuffer(), map); } - - - - /** - * Check the name - * - * @param name the name - */ private void checkName(final String name) throws JMSException { checkWrite(); diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessage.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessage.java index f95aa8cf903..5f22d8d033a 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessage.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessage.java @@ -60,9 +60,8 @@ /** * ActiveMQ Artemis implementation of a JMS Message. - *
          - * JMS Messages only live on the client side - the server only deals with MessageImpl - * instances + *

          + * JMS Messages only live on the client side - the server only deals with MessageImpl instances */ public class ActiveMQMessage implements javax.jms.Message { @@ -206,7 +205,7 @@ public static ActiveMQMessage createMessage(final ClientMessage message, - /* + /** * Create a new message prior to sending */ protected ActiveMQMessage(final byte type, final ClientSession session) { @@ -232,7 +231,7 @@ public ActiveMQMessage(final ClientMessage message, final ClientSession session) this.session = session; } - /* + /** * A constructor that takes a foreign message */ public ActiveMQMessage(final Message foreign, final ClientSession session) throws JMSException { @@ -263,12 +262,9 @@ protected ActiveMQMessage(final Message foreign, final byte type, final ClientSe } } } else { - // Some providers, like WSMQ do automatic conversions between native byte[] correlation id - // and String correlation id. This makes it impossible for ActiveMQ Artemis to guarantee to return the correct - // type as set by the user - // So we allow the behaviour to be overridden by a system property - // https://jira.jboss.org/jira/browse/HORNETQ-356 - // https://jira.jboss.org/jira/browse/HORNETQ-332 + // Some providers like WSMQ do automatic conversions between native byte[] correlation id and String + // correlation id. This makes it impossible for ActiveMQ Artemis to guarantee to return the correct type as set + // by the user. Therefore, we allow the behaviour to be overridden by a system property. String corrIDString = foreign.getJMSCorrelationID(); if (corrIDString != null) { setJMSCorrelationID(corrIDString); @@ -736,7 +732,6 @@ public T getBody(Class c) throws JMSException { } else if (hasNoBody()) { return null; } - // XXX HORNETQ-1209 Do we need translations here? throw new MessageFormatException("Body not assignable to " + c); } @@ -751,21 +746,21 @@ protected T getBodyInternal(Class c) throws MessageFormatException { } } + /** + * From the specs: + *

          + * If the message is a {@code Message} (but not one of its subtypes) then this method will return {@code true} + * irrespective of the value of this parameter. + */ @Override public boolean isBodyAssignableTo(Class c) { - /** - * From the specs: - *

          - * If the message is a {@code Message} (but not one of its subtypes) then this method will - * return true irrespective of the value of this parameter. - */ return true; } /** * Helper method for {@link #isBodyAssignableTo(Class)}. * - * @return true if the message has no body. + * @return {@code true} if the message has no body */ protected boolean hasNoBody() { return message.getBodySize() == 0; diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageConsumer.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageConsumer.java index 9f146f2b42f..4f6a3bd5d23 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageConsumer.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageConsumer.java @@ -243,8 +243,8 @@ private ActiveMQMessage getMessage(final long timeout, final boolean noWait) thr throw ioob; } - // We Do the ack after doBeforeReceive, as in the case of large messages, this may fail so we don't want messages redelivered - // https://issues.jboss.org/browse/JBPAPP-6110 + // We Do the ack after doBeforeReceive, as in the case of large messages, this may fail so we don't want + // messages redelivered if (session.getAcknowledgeMode() == ActiveMQJMSConstants.INDIVIDUAL_ACKNOWLEDGE) { jmsMsg.setIndividualAcknowledge(); } else if (session.getAcknowledgeMode() == Session.CLIENT_ACKNOWLEDGE) { 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 7da7acbb0e1..68cf2b13e65 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 @@ -473,7 +473,7 @@ private void doSendx(ActiveMQDestination destination, coreMessage.setRoutingType(destination.isQueue() ? RoutingType.ANYCAST : RoutingType.MULTICAST); try { - /** + /* * Using a completionListener requires wrapping using a {@link CompletionListenerWrapper}, * so we avoid it if we can. */ @@ -510,10 +510,6 @@ private static final class CompletionListenerWrapper implements SendAcknowledgem private final Message jmsMessage; private final ActiveMQMessageProducer producer; - /** - * @param jmsMessage - * @param producer - */ private CompletionListenerWrapper(CompletionListener listener, Message jmsMessage, ActiveMQMessageProducer producer) { @@ -553,14 +549,14 @@ public void sendFailed(org.apache.activemq.artemis.api.core.Message clientMessag try { streamMessage.reset(); } catch (JMSException e) { - // HORNETQ-1209 XXX ignore? + // ignore? } } if (jmsMessage instanceof BytesMessage bytesMessage) { try { bytesMessage.reset(); } catch (JMSException e) { - // HORNETQ-1209 XXX ignore? + // ignore? } } diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQObjectMessage.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQObjectMessage.java index e658f428080..63798c8c458 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQObjectMessage.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQObjectMessage.java @@ -32,7 +32,7 @@ /** * ActiveMQ Artemis implementation of a JMS ObjectMessage. - *
          + *

          * Don't used ObjectMessage if you want good performance! *

          * Serialization is slooooow! diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQQueue.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQQueue.java index 6c7dee1b5ac..9802f3cde74 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQQueue.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQQueue.java @@ -22,7 +22,7 @@ /** * ActiveMQ Artemis implementation of a JMS Queue. - *
          + *

          * This class can be instantiated directly. */ public class ActiveMQQueue extends ActiveMQDestination implements Queue { @@ -51,11 +51,6 @@ public ActiveMQQueue(final String address, boolean temporary) { super(address, temporary ? TYPE.TEMP_QUEUE : TYPE.QUEUE, null); } - /** - * @param address - * @param temporary - * @param session - */ public ActiveMQQueue(String address, boolean temporary, ActiveMQSession session) { super(address, temporary ? TYPE.TEMP_QUEUE : TYPE.QUEUE, session); } diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java index 5bb01c07009..2e4edcf2985 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java @@ -79,10 +79,10 @@ import org.apache.activemq.artemis.utils.SelectorTranslator; /** - * ActiveMQ Artemis implementation of a JMS Session. - *
          - * Note that we *do not* support JMS ASF (Application Server Facilities) optional - * constructs such as ConnectionConsumer + * ActiveMQ Artemis implementation of a JMS {@link Session}. + *

          + * Note that we *do not* support JMS ASF (Application Server Facilities) optional constructs such as + * {@code ConnectionConsumer} */ public class ActiveMQSession implements QueueSession, TopicSession { @@ -151,6 +151,10 @@ protected ActiveMQSession(final ConnectionFactoryOptions options, // Session implementation ---------------------------------------- + + /** + * {@inheritDoc} + */ @Override public BytesMessage createBytesMessage() throws JMSException { checkClosed(); @@ -164,6 +168,10 @@ public BytesMessage createBytesMessage() throws JMSException { return message; } + + /** + * {@inheritDoc} + */ @Override public MapMessage createMapMessage() throws JMSException { checkClosed(); @@ -177,6 +185,10 @@ public MapMessage createMapMessage() throws JMSException { return message; } + + /** + * {@inheritDoc} + */ @Override public Message createMessage() throws JMSException { checkClosed(); @@ -190,6 +202,10 @@ public Message createMessage() throws JMSException { return message; } + + /** + * {@inheritDoc} + */ @Override public ObjectMessage createObjectMessage() throws JMSException { checkClosed(); @@ -203,6 +219,10 @@ public ObjectMessage createObjectMessage() throws JMSException { return message; } + + /** + * {@inheritDoc} + */ @Override public ObjectMessage createObjectMessage(final Serializable object) throws JMSException { checkClosed(); @@ -218,6 +238,10 @@ public ObjectMessage createObjectMessage(final Serializable object) throws JMSEx return msg; } + + /** + * {@inheritDoc} + */ @Override public StreamMessage createStreamMessage() throws JMSException { checkClosed(); @@ -231,6 +255,10 @@ public StreamMessage createStreamMessage() throws JMSException { return message; } + + /** + * {@inheritDoc} + */ @Override public TextMessage createTextMessage() throws JMSException { checkClosed(); @@ -246,6 +274,10 @@ public TextMessage createTextMessage() throws JMSException { return msg; } + + /** + * {@inheritDoc} + */ @Override public TextMessage createTextMessage(final String text) throws JMSException { checkClosed(); @@ -261,6 +293,10 @@ public TextMessage createTextMessage(final String text) throws JMSException { return msg; } + + /** + * {@inheritDoc} + */ @Override public boolean getTransacted() throws JMSException { checkClosed(); @@ -268,6 +304,10 @@ public boolean getTransacted() throws JMSException { return transacted; } + + /** + * {@inheritDoc} + */ @Override public int getAcknowledgeMode() throws JMSException { checkClosed(); @@ -279,6 +319,10 @@ public boolean isXA() { return xa; } + + /** + * {@inheritDoc} + */ @Override public void commit() throws JMSException { if (!transacted) { @@ -294,6 +338,10 @@ public void commit() throws JMSException { } } + + /** + * {@inheritDoc} + */ @Override public void rollback() throws JMSException { if (!transacted) { @@ -310,6 +358,10 @@ public void rollback() throws JMSException { } } + + /** + * {@inheritDoc} + */ @Override public void close() throws JMSException { connection.getThreadAwareContext().assertNotCompletionListenerThread(); @@ -331,6 +383,10 @@ public void close() throws JMSException { queueCache.clear(); } + + /** + * {@inheritDoc} + */ @Override public void recover() throws JMSException { if (transacted) { @@ -346,6 +402,10 @@ public void recover() throws JMSException { recoverCalled = true; } + + /** + * {@inheritDoc} + */ @Override public MessageListener getMessageListener() throws JMSException { checkClosed(); @@ -353,15 +413,27 @@ public MessageListener getMessageListener() throws JMSException { return null; } + + /** + * {@inheritDoc} + */ @Override public void setMessageListener(final MessageListener listener) throws JMSException { checkClosed(); } + + /** + * {@inheritDoc} + */ @Override public void run() { } + + /** + * {@inheritDoc} + */ @Override public MessageProducer createProducer(final Destination destination) throws JMSException { if (destination != null && !(destination instanceof ActiveMQDestination)) { @@ -448,17 +520,29 @@ void checkDestination(ActiveMQDestination destination) throws JMSException { } } + + /** + * {@inheritDoc} + */ @Override public MessageConsumer createConsumer(final Destination destination) throws JMSException { return createConsumer(destination, null, false); } + + /** + * {@inheritDoc} + */ @Override public MessageConsumer createConsumer(final Destination destination, final String messageSelector) throws JMSException { return createConsumer(destination, messageSelector, false); } + + /** + * {@inheritDoc} + */ @Override public MessageConsumer createConsumer(final Destination destination, final String messageSelector, @@ -479,6 +563,10 @@ public MessageConsumer createConsumer(final Destination destination, return createConsumer(jbdest, null, messageSelector, noLocal, ConsumerDurability.NON_DURABLE); } + + /** + * {@inheritDoc} + */ @Override public Queue createQueue(final String queueName) throws JMSException { // As per spec. section 4.11 @@ -529,6 +617,10 @@ protected ActiveMQQueue internalCreateQueueCompatibility(String queueName) throw return queue; } + + /** + * {@inheritDoc} + */ @Override public Topic createTopic(final String topicName) throws JMSException { // As per spec. section 4.11 @@ -569,11 +661,17 @@ protected Topic internalCreateTopic(String topicName, boolean retry) throws Acti } } + /** + * {@inheritDoc} + */ @Override public TopicSubscriber createDurableSubscriber(final Topic topic, final String name) throws JMSException { return createDurableSubscriber(topic, name, null, false); } + /** + * {@inheritDoc} + */ @Override public TopicSubscriber createDurableSubscriber(final Topic topic, final String name, @@ -604,24 +702,16 @@ private void checkTopic(Topic topic) throws InvalidDestinationException { } } + /** + * {@inheritDoc} + */ @Override public MessageConsumer createSharedConsumer(Topic topic, String sharedSubscriptionName) throws JMSException { return createSharedConsumer(topic, sharedSubscriptionName, null); } /** - * Note: Needs to throw an exception if a subscriptionName is already in use by another topic, or if the messageSelector is different - * - * validate multiple subscriptions on the same session. - * validate multiple subscriptions on different sessions - * validate failure in one connection while another connection stills fine. - * Validate different filters in different possible scenarios - * - * @param topic - * @param name - * @param messageSelector - * @return - * @throws JMSException + * {@inheritDoc} */ @Override public MessageConsumer createSharedConsumer(Topic topic, String name, String messageSelector) throws JMSException { @@ -638,11 +728,17 @@ public MessageConsumer createSharedConsumer(Topic topic, String name, String mes return internalCreateSharedConsumer(localTopic, name, messageSelector, ConsumerDurability.NON_DURABLE); } + /** + * {@inheritDoc} + */ @Override public MessageConsumer createDurableConsumer(Topic topic, String name) throws JMSException { return createDurableConsumer(topic, name, null, false); } + /** + * {@inheritDoc} + */ @Override public MessageConsumer createDurableConsumer(Topic topic, String name, @@ -661,11 +757,17 @@ public MessageConsumer createDurableConsumer(Topic topic, return createConsumer(localTopic, name, messageSelector, noLocal, ConsumerDurability.DURABLE); } + /** + * {@inheritDoc} + */ @Override public MessageConsumer createSharedDurableConsumer(Topic topic, String name) throws JMSException { return createSharedDurableConsumer(topic, name, null); } + /** + * {@inheritDoc} + */ @Override public MessageConsumer createSharedDurableConsumer(Topic topic, String name, @@ -708,9 +810,6 @@ enum ConsumerDurability { DURABLE, NON_DURABLE; } - /** - * This is an internal method for shared consumers - */ private ActiveMQMessageConsumer internalCreateSharedConsumer(final ActiveMQDestination dest, final String subscriptionName, String selectorString, @@ -965,11 +1064,18 @@ public void ackAllConsumers() throws JMSException { checkClosed(); } + + /** + * {@inheritDoc} + */ @Override public QueueBrowser createBrowser(final Queue queue) throws JMSException { return createBrowser(queue, null); } + /** + * {@inheritDoc} + */ @Override public QueueBrowser createBrowser(final Queue queue, String filterString) throws JMSException { // As per spec. section 4.11 @@ -1016,6 +1122,9 @@ public QueueBrowser createBrowser(final Queue queue, String filterString) throws } + /** + * {@inheritDoc} + */ @Override public TemporaryQueue createTemporaryQueue() throws JMSException { // As per spec. section 4.11 @@ -1045,6 +1154,9 @@ public TemporaryQueue createTemporaryQueue() throws JMSException { } } + /** + * {@inheritDoc} + */ @Override public TemporaryTopic createTemporaryTopic() throws JMSException { // As per spec. section 4.11 @@ -1077,6 +1189,9 @@ public TemporaryTopic createTemporaryTopic() throws JMSException { } } + /** + * {@inheritDoc} + */ @Override public void unsubscribe(final String name) throws JMSException { // As per spec. section 4.11 @@ -1121,16 +1236,25 @@ public XAResource getXAResource() { // QueueSession implementation + /** + * {@inheritDoc} + */ @Override public QueueReceiver createReceiver(final Queue queue, final String messageSelector) throws JMSException { return (QueueReceiver) createConsumer(queue, messageSelector); } + /** + * {@inheritDoc} + */ @Override public QueueReceiver createReceiver(final Queue queue) throws JMSException { return (QueueReceiver) createConsumer(queue); } + /** + * {@inheritDoc} + */ @Override public QueueSender createSender(final Queue queue) throws JMSException { return (QueueSender) createProducer(queue); @@ -1144,11 +1268,17 @@ public QueueSession getQueueSession() throws JMSException { // TopicSession implementation + /** + * {@inheritDoc} + */ @Override public TopicPublisher createPublisher(final Topic topic) throws JMSException { return (TopicPublisher) createProducer(topic); } + /** + * {@inheritDoc} + */ @Override public TopicSubscriber createSubscriber(final Topic topic, final String messageSelector, @@ -1156,6 +1286,9 @@ public TopicSubscriber createSubscriber(final Topic topic, return (TopicSubscriber) createConsumer(topic, messageSelector, noLocal); } + /** + * {@inheritDoc} + */ @Override public TopicSubscriber createSubscriber(final Topic topic) throws JMSException { return (TopicSubscriber) createConsumer(topic); @@ -1167,7 +1300,6 @@ public TopicSession getTopicSession() throws JMSException { return (TopicSession) getSession(); } - @Override public String toString() { return "ActiveMQSession->" + session; diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTemporaryQueue.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTemporaryQueue.java index 74fba37a995..5cd4fbab8bf 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTemporaryQueue.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTemporaryQueue.java @@ -20,7 +20,7 @@ /** * ActiveMQ Artemis implementation of a JMS TemporaryQueue. - *
          + *

          * This class can be instantiated directly. */ public class ActiveMQTemporaryQueue extends ActiveMQQueue implements TemporaryQueue { @@ -35,10 +35,6 @@ public ActiveMQTemporaryQueue() { this(null, null); } - /** - * @param address - * @param session - */ public ActiveMQTemporaryQueue(String address, ActiveMQSession session) { super(address, true, session); } diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTextMessage.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTextMessage.java index 2e213f6054f..7c1c579eb73 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTextMessage.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTextMessage.java @@ -30,8 +30,6 @@ /** * ActiveMQ Artemis implementation of a JMS TextMessage. - *
          - * This class was ported from SpyTextMessage in JBossMQ. */ public class ActiveMQTextMessage extends ActiveMQMessage implements TextMessage { diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTopic.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTopic.java index eeb0d88e619..38c61f7116f 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTopic.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQTopic.java @@ -22,7 +22,7 @@ /** * ActiveMQ Artemis implementation of a JMS Topic. - *
          + *

          * This class can be instantiated directly. */ public class ActiveMQTopic extends ActiveMQDestination implements Topic { @@ -51,11 +51,6 @@ public ActiveMQTopic(final String address, boolean temporary) { this(address, temporary, null); } - /** - * @param address - * @param temporary - * @param session - */ protected ActiveMQTopic(String address, boolean temporary, ActiveMQSession session) { super(address, temporary ? TYPE.TEMP_TOPIC : TYPE.TOPIC, session); } diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXAConnection.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXAConnection.java index c5eea984217..7b2ef06c9c9 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXAConnection.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXAConnection.java @@ -29,8 +29,8 @@ /** * ActiveMQ Artemis implementation of a JMS XAConnection. *

          - * The flat implementation of {@link XATopicConnection} and {@link XAQueueConnection} is per design, - * following common practices of JMS 1.1. + * The flat implementation of {@link XATopicConnection} and {@link XAQueueConnection} is per design, following common + * practices of JMS 1.1. */ public final class ActiveMQXAConnection extends ActiveMQConnection implements XATopicConnection, XAQueueConnection { diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXAConnectionFactory.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXAConnectionFactory.java index ec2ddb22c45..43a32cbc352 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXAConnectionFactory.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXAConnectionFactory.java @@ -27,7 +27,8 @@ /** * A class that represents a XAConnectionFactory. *

          - * We consider the XAConnectionFactory to be the most complete possible option. It can be casted to any other connection factory since it is fully functional + * We consider the XAConnectionFactory to be the most complete possible option. It can be casted to any other connection + * factory since it is fully functional */ public class ActiveMQXAConnectionFactory extends ActiveMQConnectionFactory implements XATopicConnectionFactory, XAQueueConnectionFactory { diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXASession.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXASession.java index 699ecde9c32..06be567929d 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXASession.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQXASession.java @@ -23,14 +23,6 @@ public class ActiveMQXASession extends ActiveMQSession implements XAQueueSession, XATopicSession { - /** - * @param connection - * @param transacted - * @param xa - * @param ackMode - * @param session - * @param sessionType - */ protected ActiveMQXASession(final ConnectionFactoryOptions options, ActiveMQConnection connection, boolean transacted, diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ConnectionFactoryOptions.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ConnectionFactoryOptions.java index bf90387f36d..495dd23cd95 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ConnectionFactoryOptions.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ConnectionFactoryOptions.java @@ -17,8 +17,8 @@ package org.apache.activemq.artemis.jms.client; /** - * Common interface to be used to share common parameters between the RA and client JMS. - * Initially developed to carry on Serialization packages allow list, but it could eventually be expanded. + * Common interface to be used to share common parameters between the RA and client JMS. Initially developed to carry on + * Serialization packages allow list, but it could eventually be expanded. */ public interface ConnectionFactoryOptions { diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/DefaultConnectionProperties.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/DefaultConnectionProperties.java index 03e2e89c8ea..120746b36eb 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/DefaultConnectionProperties.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/DefaultConnectionProperties.java @@ -21,8 +21,7 @@ import java.security.PrivilegedAction; /** - *

          This class will provide default properties for constructors

          - * + * This class will provide default properties for constructors * * * diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/JmsExceptionUtils.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/JmsExceptionUtils.java index aea050fd5b8..f4e49998945 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/JmsExceptionUtils.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/JmsExceptionUtils.java @@ -38,9 +38,6 @@ import javax.jms.TransactionRolledBackException; import javax.jms.TransactionRolledBackRuntimeException; -/** - * - */ public final class JmsExceptionUtils { private JmsExceptionUtils() { @@ -50,9 +47,6 @@ private JmsExceptionUtils() { /** * Converts instances of sub-classes of {@link JMSException} into the corresponding sub-class of * {@link JMSRuntimeException}. - * - * @param e - * @return */ public static JMSRuntimeException convertToRuntimeException(JMSException e) { if (e instanceof javax.jms.IllegalStateException) { diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ThreadAwareContext.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ThreadAwareContext.java index f825408807f..de15fcbd0c9 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ThreadAwareContext.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ThreadAwareContext.java @@ -36,8 +36,8 @@ public class ThreadAwareContext { private Thread completionListenerThread; /** - * Use a set because JMSContext can create more than one JMSConsumer - * to receive asynchronously from different destinations. + * Use a set because JMSContext can create more than one JMSConsumer to receive asynchronously from different + * destinations. */ private final Set messageListenerThreads = new ConcurrentHashSet<>(); @@ -47,8 +47,7 @@ public class ThreadAwareContext { * Meant to inform an JMSContext which is the thread that CANNOT call some of its methods. *

          * - * @param isCompletionListener : indicating whether current thread is from CompletionListener - * or from MessageListener. + * @param isCompletionListener indicating whether current thread is from CompletionListener or from MessageListener. */ public void setCurrentThread(boolean isCompletionListener) { if (isCompletionListener) { @@ -61,8 +60,7 @@ public void setCurrentThread(boolean isCompletionListener) { /** * Clear current thread from the context * - * @param isCompletionListener : indicating whether current thread is from CompletionListener - * or from MessageListener. + * @param isCompletionListener indicating whether current thread is from CompletionListener or from MessageListener. */ public void clearCurrentThread(boolean isCompletionListener) { if (isCompletionListener) { @@ -75,9 +73,8 @@ public void clearCurrentThread(boolean isCompletionListener) { /** * Asserts a {@link javax.jms.CompletionListener} is not calling from its own {@link javax.jms.JMSContext}. *

          - * Note that the code must work without any need for further synchronization, as there is the - * requirement that only one CompletionListener be called at a time. In other words, - * CompletionListener calling is single-threaded. + * Note that the code must work without any need for further synchronization, as there is the requirement that only + * one CompletionListener be called at a time. In other words, CompletionListener calling is single-threaded. * * @see javax.jms.JMSContext#close() * @see javax.jms.JMSContext#stop() @@ -91,12 +88,11 @@ public void assertNotCompletionListenerThreadRuntime() { } /** - * Asserts a {@link javax.jms.CompletionListener} is not calling from its own {@link javax.jms.Connection} or from - * a {@link javax.jms.MessageProducer} . + * Asserts a {@link javax.jms.CompletionListener} is not calling from its own {@link javax.jms.Connection} or from a + * {@link javax.jms.MessageProducer} . *

          - * Note that the code must work without any need for further synchronization, as there is the - * requirement that only one CompletionListener be called at a time. In other words, - * CompletionListener calling is single-threaded. + * Note that the code must work without any need for further synchronization, as there is the requirement that only + * one CompletionListener be called at a time. In other words, CompletionListener calling is single-threaded. * * @see javax.jms.Connection#close() * @see javax.jms.MessageProducer#close() @@ -110,9 +106,8 @@ public void assertNotCompletionListenerThread() throws javax.jms.IllegalStateExc /** * Asserts a {@link javax.jms.MessageListener} is not calling from its own {@link javax.jms.JMSContext}. *

          - * Note that the code must work without any need for further synchronization, as there is the - * requirement that only one MessageListener be called at a time. In other words, - * MessageListener calling is single-threaded. + * Note that the code must work without any need for further synchronization, as there is the requirement that only + * one MessageListener be called at a time. In other words, MessageListener calling is single-threaded. * * @see javax.jms.JMSContext#close() * @see javax.jms.JMSContext#stop() @@ -127,9 +122,8 @@ public void assertNotMessageListenerThreadRuntime() { * Asserts a {@link javax.jms.MessageListener} is not calling from its own {@link javax.jms.Connection} or * {@link javax.jms.MessageConsumer}. *

          - * Note that the code must work without any need for further synchronization, as there is the - * requirement that only one MessageListener be called at a time. In other words, - * MessageListener calling is single-threaded. + * Note that the code must work without any need for further synchronization, as there is the requirement that only + * one MessageListener be called at a time. In other words, MessageListener calling is single-threaded. * * @see javax.jms.Connection#close() * @see javax.jms.MessageConsumer#close() diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ActiveMQInitialContextFactory.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ActiveMQInitialContextFactory.java index d7026b6297e..82146e75ef7 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ActiveMQInitialContextFactory.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ActiveMQInitialContextFactory.java @@ -34,11 +34,9 @@ import org.apache.activemq.artemis.utils.uri.URISchema; /** - * A factory of the ActiveMQ Artemis InitialContext which contains - * {@link javax.jms.ConnectionFactory} instances as well as a child context called - * destinations which contain all of the current active destinations, in - * child context depending on the QoS such as transient or durable and queue or - * topic. + * A factory of the ActiveMQ Artemis InitialContext which contains {@link javax.jms.ConnectionFactory} instances as well + * as a child context called destinations which contain all of the current active destinations, in child context + * depending on the QoS such as transient or durable and queue or topic. */ public class ActiveMQInitialContextFactory implements InitialContextFactory { diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/JNDIReferenceFactory.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/JNDIReferenceFactory.java index 45726b491a7..7d0ad438c8f 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/JNDIReferenceFactory.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/JNDIReferenceFactory.java @@ -26,32 +26,21 @@ import java.util.Hashtable; import java.util.Properties; - /** - * Converts objects implementing JNDIStorable into a property fields so they can be - * stored and regenerated from JNDI - * - * @since 1.0 + * Converts objects implementing JNDIStorable into a property fields so they can be stored and regenerated from JNDI */ public class JNDIReferenceFactory implements ObjectFactory { /** - * This will be called by a JNDIprovider when a Reference is retrieved from - * a JNDI store - and generates the original instance - * - * @param object - * the Reference object - * @param name - * the JNDI name - * @param nameCtx - * the context - * @param environment - * the environment settings used by JNDI + * This will be called by a JNDIprovider when a Reference is retrieved from a JNDI store - and generates the original + * instance * + * @param object the Reference object + * @param name the JNDI name + * @param nameCtx the context + * @param environment the environment settings used by JNDI * @return the instance built from the Reference object - * - * @throws Exception - * if building the instance from Reference fails (usually class not found) + * @throws Exception if building the instance from Reference fails (usually class not found) */ @Override public Object getObjectInstance(Object object, Name name, Context nameCtx, Hashtable environment) @@ -82,13 +71,9 @@ public static Properties getProperties(Reference reference) { /** * Create a Reference instance from a JNDIStorable object * - * @param instanceClassName - * The name of the class that is being created. - * @param po - * The properties object to use when configuring the new instance. - * + * @param instanceClassName The name of the class that is being created. + * @param po The properties object to use when configuring the new instance. * @return Reference - * * @throws NamingException if an error occurs while creating the new instance. */ public static Reference createReference(String instanceClassName, JNDIStorable po) throws NamingException { @@ -108,13 +93,9 @@ public static Reference createReference(String instanceClassName, JNDIStorable p /** * Retrieve the class loader for a named class * - * @param thisObj - * Local object to use when doing the lookup. - * @param className - * The name of the class being loaded. - * - * @return the class that was requested. - * + * @param thisObj Local object to use when doing the lookup. + * @param className The name of the class being loaded. + * @return the class that was requested * @throws ClassNotFoundException if a matching class cannot be created. */ public static Class loadClass(Object thisObj, String className) throws ClassNotFoundException { diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/JNDIStorable.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/JNDIStorable.java index b25dcf24a6a..a7853f4b9a0 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/JNDIStorable.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/JNDIStorable.java @@ -16,15 +16,14 @@ */ package org.apache.activemq.artemis.jndi; +import javax.naming.NamingException; +import javax.naming.Reference; +import javax.naming.Referenceable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.Properties; -import javax.naming.NamingException; -import javax.naming.Reference; -import javax.naming.Referenceable; - /** * Facilitates objects to be stored in JNDI as properties */ @@ -33,26 +32,22 @@ public abstract class JNDIStorable implements Referenceable { /** * Set the properties that will represent the instance in JNDI * - * @param props - * The properties to use when building the new isntance. + * @param props The properties to use when building the new isntance. */ protected abstract void buildFromProperties(Properties props); /** * Initialize the instance from properties stored in JNDI * - * @param props - * The properties to use when initializing the new instance. + * @param props The properties to use when initializing the new instance. */ protected abstract void populateProperties(Properties props); /** * set the properties for this instance as retrieved from JNDI * - * @param props - * The properties to apply to this instance. - * - * @return a new, unmodifiable, map containing any unused properties, or empty if none were. + * @param props The properties to apply to this instance. + * @return a new, unmodifiable, map containing any unused properties, or empty if none were */ synchronized void setProperties(Properties props) { buildFromProperties(props); @@ -73,8 +68,7 @@ synchronized Properties getProperties() { * Retrieve a Reference for this instance to store in JNDI * * @return the built Reference - * @throws NamingException - * if error on building Reference + * @throws NamingException if error on building Reference */ @Override public Reference getReference() throws NamingException { @@ -84,9 +78,6 @@ public Reference getReference() throws NamingException { /** * Method for class's implementing externalizable to delegate to if not custom implementing. * - * @param in - * @throws IOException - * @throws ClassNotFoundException * @see java.io.Externalizable#readExternal(java.io.ObjectInput) */ public void readObject(ObjectInput in) throws IOException, ClassNotFoundException { @@ -99,8 +90,6 @@ public void readObject(ObjectInput in) throws IOException, ClassNotFoundExceptio /** * Method for class's implementing externalizable to delegate to if not custom implementing. * - * @param out - * @throws IOException * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput) */ public void writeObject(ObjectOutput out) throws IOException { diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ReadOnlyContext.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ReadOnlyContext.java index 8f028f32a1c..2f16bb37630 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ReadOnlyContext.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jndi/ReadOnlyContext.java @@ -42,21 +42,19 @@ /** * A read-only Context *

          - * This version assumes it and all its subcontext are - * read-only and any attempt to modify (e.g. through bind) will result in an - * OperationNotSupportedException. Each Context in the tree builds a cache of - * the entries in all sub-contexts to optimise the performance of lookup. + * This version assumes it and all its subcontext are read-only and any attempt to modify (e.g. through bind) will + * result in an {@link OperationNotSupportedException}. Each Context in the tree builds a cache of the entries in all + * sub-contexts to optimise the performance of lookup. *

          - * This implementation is intended to optimise the performance of lookup(String) - * to about the level of a HashMap get. It has been observed that the scheme - * resolution phase performed by the JVM takes considerably longer, so for - * optimum performance lookups should be coded like: - *

          - * + * This implementation is intended to optimise the performance of {@link #lookup(String)} to about the level of a + * {@link HashMap#get(Object)}. It has been observed that the scheme resolution phase performed by the JVM takes + * considerably longer, so for optimum performance lookups should be coded like: + *
          + * {@code
            * Context componentContext = (Context)new InitialContext().lookup("java:comp");
            * String envEntry = (String) componentContext.lookup("env/myEntry");
            * String envEntry2 = (String) componentContext.lookup("env/myEntry2");
          - * 
          + * }
          */ @SuppressWarnings("unchecked") public class ReadOnlyContext implements Context, Serializable { @@ -133,19 +131,11 @@ boolean isFrozen() { } /** - * internalBind is intended for use only during setup or possibly by - * suitably synchronized superclasses. It binds every possible lookup into a - * map in each context. To do this, each context strips off one name segment - * and if necessary creates a new context for it. Then it asks that context - * to bind the remaining name. It returns a map containing all the bindings - * from the next context, plus the context it just created (if it in fact - * created it). (the names are suitably extended by the segment originally - * lopped off). - * - * @param name - * @param value - * @return - * @throws javax.naming.NamingException + * This is intended for use only during setup or possibly by suitably synchronized superclasses. It binds every + * possible lookup into a map in each context. To do this, each context strips off one name segment and if necessary + * creates a new context for it. Then it asks that context to bind the remaining name. It returns a map containing + * all the bindings from the next context, plus the context it just created (if it in fact created it). (the names + * are suitably extended by the segment originally lopped off). */ protected Map internalBind(String name, Object value) throws NamingException { assert name != null && !name.isEmpty(); diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JMSConnectionOptions.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JMSConnectionOptions.java index 86ca9840982..2fc0f101fea 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JMSConnectionOptions.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/uri/JMSConnectionOptions.java @@ -21,9 +21,8 @@ import org.apache.activemq.artemis.uri.schema.serverLocator.ConnectionOptions; /** - * This will represent all the possible options you could setup on URLs - * When parsing the URL this will serve as an intermediate object - * And it could also be a pl + * This will represent all the possible options you could setup on URLs When parsing the URL this will serve as an + * intermediate object And it could also be a pl */ public class JMSConnectionOptions extends ConnectionOptions { diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/bridge/QualityOfServiceMode.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/bridge/QualityOfServiceMode.java index 38ee3d74583..54762be78a6 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/bridge/QualityOfServiceMode.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/bridge/QualityOfServiceMode.java @@ -20,48 +20,36 @@ *

          Quality of server (QoS) levels

          * *

          QOS_AT_MOST_ONCE

          - * - * With this QoS mode messages will reach the destination from the source at - * most once. The messages are consumed from the source and acknowledged before - * sending to the destination. Therefore there is a possibility that if failure - * occurs between removing them from the source and them arriving at the - * destination they could be lost. Hence delivery will occur at most once. This - * mode is available for both persistent and non persistent messages. + *

          + * With this QoS mode messages will reach the destination from the source at most once. The messages are consumed from + * the source and acknowledged before sending to the destination. Therefore there is a possibility that if failure + * occurs between removing them from the source and them arriving at the destination they could be lost. Hence delivery + * will occur at most once. This mode is available for both persistent and non persistent messages. * *

          QOS_DUPLICATES_OK

          - * - * With this QoS mode, the messages are consumed from the source and then - * acknowledged after they have been successfully sent to the destination. - * Therefore there is a possibility that if failure occurs after sending to the - * destination but before acknowledging them, they could be sent again when the - * system recovers. I.e. the destination might receive duplicates after a - * failure. This mode is available for both persistent and non persistent - * messages. + *

          + * With this QoS mode, the messages are consumed from the source and then acknowledged after they have been successfully + * sent to the destination. Therefore there is a possibility that if failure occurs after sending to the destination but + * before acknowledging them, they could be sent again when the system recovers. I.e. the destination might receive + * duplicates after a failure. This mode is available for both persistent and non persistent messages. * *

          QOS_ONCE_AND_ONLY_ONCE

          - * - * This QoS mode ensures messages will reach the destination from the source - * once and only once. (Sometimes this mode is known as "exactly once"). If both - * the source and the destination are on the same ActiveMQ Artemis server - * instance then this can be achieved by sending and acknowledging the messages - * in the same local transaction. If the source and destination are on different - * servers this is achieved by enlisting the sending and consuming sessions in a - * JTA transaction. The JTA transaction is controlled by JBoss Transactions JTA - * implementation which is a fully recovering transaction manager, thus - * providing a very high degree of durability. If JTA is required then both - * supplied connection factories need to be XAConnectionFactory implementations. - * This mode is only available for persistent messages. This is likely to be the - * slowest mode since it requires extra persistence for the transaction logging. - * - * Note: For a specific application it may possible to provide once and only - * once semantics without using the QOS_ONCE_AND_ONLY_ONCE QoS level. This can - * be done by using the QOS_DUPLICATES_OK mode and then checking for duplicates - * at the destination and discarding them. Some JMS servers provide automatic - * duplicate message detection functionality, or this may be possible to - * implement on the application level by maintaining a cache of received message - * ids on disk and comparing received messages to them. The cache would only be - * valid for a certain period of time so this approach is not as watertight as - * using QOS_ONCE_AND_ONLY_ONCE but may be a good choice depending on your + *

          + * This QoS mode ensures messages will reach the destination from the source once and only once. (Sometimes this mode is + * known as "exactly once"). If both the source and the destination are on the same ActiveMQ Artemis server instance + * then this can be achieved by sending and acknowledging the messages in the same local transaction. If the source and + * destination are on different servers this is achieved by enlisting the sending and consuming sessions in a JTA + * transaction. The JTA transaction is controlled by JBoss Transactions JTA implementation which is a fully recovering + * transaction manager, thus providing a very high degree of durability. If JTA is required then both supplied + * connection factories need to be XAConnectionFactory implementations. This mode is only available for persistent + * messages. This is likely to be the slowest mode since it requires extra persistence for the transaction logging. + *

          + * Note: For a specific application it may possible to provide once and only once semantics without using the + * QOS_ONCE_AND_ONLY_ONCE QoS level. This can be done by using the QOS_DUPLICATES_OK mode and then checking for + * duplicates at the destination and discarding them. Some JMS servers provide automatic duplicate message detection + * functionality, or this may be possible to implement on the application level by maintaining a cache of received + * message ids on disk and comparing received messages to them. The cache would only be valid for a certain period of + * time so this approach is not as watertight as using QOS_ONCE_AND_ONLY_ONCE but may be a good choice depending on your * specific application. */ public enum QualityOfServiceMode { 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 a250e99cd9c..80df6c42a85 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 @@ -198,9 +198,7 @@ public final class JMSBridgeImpl implements JMSBridge { private long abortedMessageCount = 0; - /* - * Constructor for MBean - */ + // Constructor for MBean public JMSBridgeImpl() { messages = new LinkedList<>(); executor = createExecutor(); @@ -1138,7 +1136,6 @@ private Connection createConnection(final String username, * * When bridging a batch, we make sure to manually acknowledge the consuming session, if it is CLIENT_ACKNOWLEDGE * *before* the batch has been sent - * */ private boolean setupJMSObjects() { try { @@ -1303,7 +1300,8 @@ private void cleanup() { } /** - * Pause the calling thread for the given {@code millis}: it returns {@code true} if not interrupted, {@code false} otherwise. + * Pause the calling thread for the given {@code millis}: it returns {@code true} if not interrupted, {@code false} + * otherwise. */ private static boolean pause(final long millis) { assert millis >= 0; @@ -1627,8 +1625,8 @@ private static void copyProperties(final Message msg) throws JMSException { } /** - * Creates a 3-sized thread pool executor (1 thread for the sourceReceiver, 1 for the timeChecker - * and 1 for the eventual failureHandler) + * Creates a 3-sized thread pool executor (1 thread for the sourceReceiver, 1 for the timeChecker and 1 for the + * eventual failureHandler) */ private ExecutorService createExecutor() { ExecutorService service = Executors.newFixedThreadPool(3, new ThreadFactory() { @@ -1651,9 +1649,8 @@ public Thread newThread(Runnable r) { } /** - * We use a Thread which polls the sourceDestination instead of a MessageListener - * to ensure that message delivery does not happen concurrently with - * transaction enlistment of the XAResource (see HORNETQ-27) + * We use a Thread which polls the sourceDestination instead of a MessageListener to ensure that message delivery + * does not happen concurrently with transaction enlistment of the XAResource */ private final class SourceReceiver implements Runnable { @@ -1736,8 +1733,8 @@ public void run() { private class FailureHandler implements Runnable { /** - * Start the source connection - note the source connection must not be started before - * otherwise messages will be received and ignored + * Start the source connection - note the source connection must not be started before otherwise messages will be + * received and ignored */ protected void startSourceConnection() { try { @@ -2030,9 +2027,7 @@ public boolean waitForFailover() { return false; } - /* - * make sure we reset the connected flags - * */ + // make sure we reset the connected flags if (result == FailoverEventType.FAILOVER_COMPLETED) { if (isSource) { connectedSource = true; diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/config/PersistedBindings.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/config/PersistedBindings.java index 9d1dbdd2e95..6e970040321 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/config/PersistedBindings.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/config/PersistedBindings.java @@ -26,7 +26,6 @@ public class PersistedBindings implements EncodingSupport { - private long id; private PersistedType type; @@ -39,10 +38,6 @@ public class PersistedBindings implements EncodingSupport { public PersistedBindings() { } - /** - * @param type - * @param name - */ public PersistedBindings(PersistedType type, String name) { super(); this.type = type; @@ -88,37 +83,22 @@ private int sizeOfBindings() { return size; } - /** - * @return the id - */ public long getId() { return id; } - /** - * @param id the id to set - */ public void setId(long id) { this.id = id; } - /** - * @return the type - */ public PersistedType getType() { return type; } - /** - * @return the name - */ public String getName() { return name; } - /** - * @return the bindings - */ public List getBindings() { return bindings; } diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/config/PersistedConnectionFactory.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/config/PersistedConnectionFactory.java index 54d46017e39..a3f2d4ba9e4 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/config/PersistedConnectionFactory.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/config/PersistedConnectionFactory.java @@ -23,7 +23,6 @@ public class PersistedConnectionFactory implements EncodingSupport { - private long id; private ConnectionFactoryConfiguration config; @@ -32,19 +31,11 @@ public PersistedConnectionFactory() { super(); } - /** - * @param config - */ public PersistedConnectionFactory(final ConnectionFactoryConfiguration config) { super(); this.config = config; } - - - /** - * @return the id - */ public long getId() { return id; } @@ -57,9 +48,6 @@ public String getName() { return config.getName(); } - /** - * @return the config - */ public ConnectionFactoryConfiguration getConfig() { return config; } diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerConfigParser.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerConfigParser.java index e1c5554efa5..0ddd4df8dad 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerConfigParser.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerConfigParser.java @@ -38,18 +38,14 @@ public interface JMSServerConfigParser { /** * Parse the topic node as a TopicConfiguration object * - * @param node * @return {@link TopicConfiguration} parsed from the node - * @throws Exception */ TopicConfiguration parseTopicConfiguration(Node node) throws Exception; /** * Parse the Queue Configuration node as a QueueConfiguration object * - * @param node * @return {@link JMSQueueConfiguration} parsed from the node - * @throws Exception */ JMSQueueConfiguration parseQueueConfiguration(Node node) throws Exception; } diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerManager.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerManager.java index e1b22f0b8d1..39ffb5dec27 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerManager.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/JMSServerManager.java @@ -47,36 +47,21 @@ public interface JMSServerManager extends ActiveMQComponent { /** * Creates a JMS Queue. * - * @param queueName The name of the queue to create - * @param selectorString - * @param durable - * @return true if the queue is created or if it existed and was added to - * the Binding Registry + * @param queueName The name of the queue to create + * @return true if the queue is created or if it existed and was added to the Binding Registry * @throws Exception if problems were encountered creating the queue. */ - boolean createQueue(boolean storeConfig, - String queueName, - String selectorString, - boolean durable, - String... bindings) throws Exception; + boolean createQueue(boolean storeConfig, String queueName, String selectorString, boolean durable, String... bindings) throws Exception; /** * Creates a JMS Queue. * - * @param queueName The name of the core queue to create + * @param queueName The name of the core queue to create * @param jmsQueueName the name of this JMS queue - * @param selectorString - * @param durable - * @return true if the queue is created or if it existed and was added to - * the Binding Registry + * @return true if the queue is created or if it existed and was added to the Binding Registry * @throws Exception if problems were encountered creating the queue. */ - boolean createQueue(boolean storeConfig, - String queueName, - String jmsQueueName, - String selectorString, - boolean durable, - String... bindings) throws Exception; + boolean createQueue(boolean storeConfig, String queueName, String jmsQueueName, String selectorString, boolean durable, String... bindings) throws Exception; boolean addTopicToBindingRegistry(String topicName, String binding) throws Exception; @@ -87,10 +72,9 @@ boolean createQueue(boolean storeConfig, /** * Creates a JMS Topic * - * @param address the core addres of thetopic - * @param bindings the names of the binding for the Binding Registry or BindingRegistry - * @return true if the topic was created or if it existed and was added to - * the Binding Registry + * @param address the core addres of thetopic + * @param bindings the names of the binding for the Binding Registry or BindingRegistry + * @return true if the topic was created or if it existed and was added to the Binding Registry * @throws Exception if a problem occurred creating the topic */ boolean createTopic(boolean storeConfig, String address, String... bindings) throws Exception; @@ -98,39 +82,21 @@ boolean createQueue(boolean storeConfig, /** * Creates a JMS Topic * - * @param address the core addres of thetopic + * @param address the core addres of thetopic * @param topicName the name of the topic * @param bindings the names of the binding for the Binding Registry or BindingRegistry - * @return true if the topic was created or if it existed and was added to - * the Binding Registry + * @return true if the topic was created or if it existed and was added to the Binding Registry * @throws Exception if a problem occurred creating the topic */ boolean createTopic(String address, boolean storeConfig, String topicName, String... bindings) throws Exception; - /** - * @param storeConfig - * @param address - * @param autoCreated - * @param bindings - * @return - * @throws Exception - */ boolean createTopic(boolean storeConfig, String address, boolean autoCreated, String... bindings) throws Exception; - /** - * @param storeConfig - * @param address - * @param topicName - * @param autoCreated - * @param bindings - * @return - * @throws Exception - */ boolean createTopic(boolean storeConfig, String address, String topicName, boolean autoCreated, String... bindings) throws Exception; /** - * Remove the topic from the Binding Registry or BindingRegistry. - * Calling this method does not destroy the destination. + * Remove the topic from the Binding Registry or BindingRegistry. Calling this method does not destroy the + * destination. * * @param name the name of the destination to remove from the BindingRegistry * @return true if removed @@ -139,8 +105,7 @@ boolean createQueue(boolean storeConfig, boolean removeTopicFromBindingRegistry(String name, String binding) throws Exception; /** - * Remove the topic from the BindingRegistry. - * Calling this method does not destroy the destination. + * Remove the topic from the BindingRegistry. Calling this method does not destroy the destination. * * @param name the name of the destination to remove from the BindingRegistry * @return true if removed @@ -149,8 +114,7 @@ boolean createQueue(boolean storeConfig, boolean removeTopicFromBindingRegistry(String name) throws Exception; /** - * Remove the queue from the BindingRegistry. - * Calling this method does not destroy the destination. + * Remove the queue from the BindingRegistry. Calling this method does not destroy the destination. * * @param name the name of the destination to remove from the BindingRegistry * @return true if removed @@ -159,8 +123,7 @@ boolean createQueue(boolean storeConfig, boolean removeQueueFromBindingRegistry(String name, String binding) throws Exception; /** - * Remove the queue from the BindingRegistry. - * Calling this method does not destroy the destination. + * Remove the queue from the BindingRegistry. Calling this method does not destroy the destination. * * @param name the name of the destination to remove from the BindingRegistry * @return true if removed @@ -182,8 +145,7 @@ boolean createQueue(boolean storeConfig, boolean destroyQueue(String name) throws Exception; /** - * destroys a queue and removes it from the BindingRegistry. - * disconnects any consumers connected to the queue. + * destroys a queue and removes it from the BindingRegistry. disconnects any consumers connected to the queue. * * @param name the name of the queue to destroy * @return true if destroyed @@ -217,8 +179,6 @@ boolean createQueue(boolean storeConfig, /** * Call this method to have a CF rebound to the Binding Registry and stored on the Journal - * - * @throws Exception */ ActiveMQConnectionFactory recreateCF(String name, ConnectionFactoryConfiguration cf) throws Exception; @@ -356,8 +316,6 @@ void createConnectionFactory(boolean storeConfig, /** * Set this property if you want JMS resources bound to a registry - * - * @param registry */ void setRegistry(BindingRegistry registry); } diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java index 38c549b1787..9f7da8e3d09 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java @@ -32,9 +32,11 @@ /** * This class contains the configuration properties of a connection factory. *

          - * It is also persisted on the journal at the time of management is used to created a connection factory and set to store. + * It is also persisted on the journal at the time of management is used to created a connection factory and set to + * store. *

          - * Every property on this class has to be also set through encoders through EncodingSupport implementation at this class. + * Every property on this class has to be also set through encoders through EncodingSupport implementation at this + * class. */ public class ConnectionFactoryConfigurationImpl implements ConnectionFactoryConfiguration { @@ -162,17 +164,11 @@ public boolean isPersisted() { return persisted; } - /** - * @return the discoveryGroupName - */ @Override public String getDiscoveryGroupName() { return discoveryGroupName; } - /** - * @param discoveryGroupName the discoveryGroupName to set - */ @Override public ConnectionFactoryConfiguration setDiscoveryGroupName(String discoveryGroupName) { this.discoveryGroupName = discoveryGroupName; diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/FileJMSConfiguration.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/FileJMSConfiguration.java index 104cde99301..b2c92287979 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/FileJMSConfiguration.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/FileJMSConfiguration.java @@ -126,9 +126,7 @@ public void parseConfiguration(final Node rootnode) throws Exception { /** * Parse the topic node as a TopicConfiguration object * - * @param node * @return topic configuration - * @throws Exception */ public static TopicConfiguration parseTopicConfiguration(final Node node) throws Exception { String topicName = node.getAttributes().getNamedItem(NAME_ATTR).getNodeValue(); @@ -139,9 +137,7 @@ public static TopicConfiguration parseTopicConfiguration(final Node node) throws /** * Parse the Queue Configuration node as a QueueConfiguration object * - * @param node * @return jms queue configuration - * @throws Exception */ public static JMSQueueConfiguration parseQueueConfiguration(final Node node) throws Exception { Element e = (Element) node; @@ -163,20 +159,10 @@ public static JMSQueueConfiguration parseQueueConfiguration(final Node node) thr return newQueue(queueName, selectorString, durable); } - /** - * @param topicName - * @return - */ protected static TopicConfiguration newTopic(final String topicName) { return new TopicConfigurationImpl().setName(topicName); } - /** - * @param queueName - * @param selectorString - * @param durable - * @return - */ protected static JMSQueueConfiguration newQueue(final String queueName, final String selectorString, final boolean durable) { @@ -186,11 +172,6 @@ protected static JMSQueueConfiguration newQueue(final String queueName, setDurable(durable); } - /** - * @param queues - * @param topics - * @param domain - */ protected void newConfig(final List queues, final List topics, String domain) { diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/embedded/EmbeddedJMS.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/embedded/EmbeddedJMS.java index 150988317ed..a597706a0ea 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/embedded/EmbeddedJMS.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/embedded/EmbeddedJMS.java @@ -33,12 +33,12 @@ * Deprecated in favor of org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ. Since Artemis 2.0 all JMS * specific broker management classes, interfaces, and methods have been deprecated in favor of their more general * counter-parts. - * - * Simple bootstrap class that parses activemq config files (server and jms and security) and starts - * an ActiveMQServer instance and populates it with configured JMS endpoints. *

          - * JMS Endpoints are registered with a simple MapBindingRegistry. If you want to use a different registry - * you must set the registry property of this class or call the setRegistry() method if you want to use JNDI + * Simple bootstrap class that parses activemq config files (server and jms and security) and starts an ActiveMQServer + * instance and populates it with configured JMS endpoints. + *

          + * JMS Endpoints are registered with a simple MapBindingRegistry. If you want to use a different registry you must set + * the registry property of this class or call the setRegistry() method if you want to use JNDI */ @Deprecated public class EmbeddedJMS extends EmbeddedActiveMQ { @@ -58,8 +58,6 @@ public JMSServerManager getJMSServerManager() { /** * Only set this property if you are using a custom BindingRegistry - * - * @param registry */ public EmbeddedJMS setRegistry(BindingRegistry registry) { this.registry = registry; @@ -68,8 +66,6 @@ public EmbeddedJMS setRegistry(BindingRegistry registry) { /** * By default, this class uses file-based configuration. Set this property to override it. - * - * @param jmsConfiguration */ public EmbeddedJMS setJmsConfiguration(JMSConfiguration jmsConfiguration) { this.jmsConfiguration = jmsConfiguration; @@ -78,8 +74,6 @@ public EmbeddedJMS setJmsConfiguration(JMSConfiguration jmsConfiguration) { /** * If you want to use JNDI instead of an internal map, set this property - * - * @param context */ public EmbeddedJMS setContext(Context context) { this.context = context; @@ -96,8 +90,6 @@ public EmbeddedJMS setConfiguration(Configuration configuration) { * Lookup in the registry for registered object, i.e. a ConnectionFactory. *

          * This is a convenience method. - * - * @param name */ public Object lookup(String name) { return serverManager.getRegistry().lookup(name); diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java index 4b8892e013f..115f194a6a9 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java @@ -85,16 +85,14 @@ import org.w3c.dom.NodeList; /** - * A Deployer used to create and add to Bindings queues, topics and connection - * factories. Typically this would only be used in an app server env. + * A Deployer used to create and add to Bindings queues, topics and connection factories. Typically this would only be + * used in an app server env. *

          - * JMS Connection Factories and Destinations can be configured either - * using configuration files or using a JMSConfiguration object. + * JMS Connection Factories and Destinations can be configured either using configuration files or using a + * JMSConfiguration object. *

          - * If configuration files are used, JMS resources are redeployed if the - * files content is changed. - * If a JMSConfiguration object is used, the JMS resources can not be - * redeployed. + * If configuration files are used, JMS resources are redeployed if the files content is changed. If a JMSConfiguration + * object is used, the JMS resources can not be redeployed. */ @Deprecated public class JMSServerManagerImpl extends CleaningActivateCallback implements JMSServerManager { @@ -140,10 +138,6 @@ public JMSServerManagerImpl(final ActiveMQServer server) throws Exception { /** * This constructor is used by the Application Server's integration - * - * @param server - * @param registry - * @throws Exception */ public JMSServerManagerImpl(final ActiveMQServer server, final BindingRegistry registry) throws Exception { this.server = server; @@ -183,8 +177,6 @@ public synchronized void activated() { run.run(); } - // do not clear the cachedCommands - HORNETQ-1047 - recoverBindings(); } catch (Exception e) { @@ -327,9 +319,8 @@ private void recoverBindings() throws Exception { // ActiveMQComponent implementation ----------------------------------- /** - * Notice that this component has a {@link #startCalled} boolean to control its internal - * life-cycle, but its {@link #isStarted()} returns the value of {@code server.isStarted()} and - * not the value of {@link #startCalled}. + * Notice that this component has a {@link #startCalled} boolean to control its internal life-cycle, but its + * {@link #isStarted()} returns the value of {@code server.isStarted()} and not the value of {@link #startCalled}. *

          * This method and {@code server.start()} are interdependent in the following way: *

            @@ -354,12 +345,10 @@ public synchronized void start() throws Exception { // server.registerPostQueueCreationCallback(new JMSPostQueueCreationCallback()); // // server.registerPostQueueDeletionCallback(new JMSPostQueueDeletionCallback()); - /** + /* * See this method's javadoc. - *

            - * start_called MUST be set to true BEFORE calling server.start(). - *

            - * start_called is NOT used at {@link JMSServerManager#isStarted()} + * startCalled MUST be set to true BEFORE calling server.start(). + * startCalled is NOT used at isStarted(). */ startCalled = true; server.start(); @@ -678,7 +667,7 @@ public boolean removeQueueFromBindingRegistry(String name, String bindings) thro public boolean removeQueueFromBindingRegistry(final String name) throws Exception { final AtomicBoolean valueReturn = new AtomicBoolean(false); - // HORNETQ-911 - make this runAfterActive to prevent WARN messages on shutdown/undeployment when the backup was never activated + // make this runAfterActive to prevent WARN messages on shutdown/undeployment when the backup was never activated runAfterActive(new WrappedRunnable() { @Override public String toString() { @@ -711,14 +700,11 @@ public boolean removeTopicFromBindingRegistry(String name, String bindings) thro } } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.jms.server.JMSServerManager#removeTopicFromBindings(java.lang.String, java.lang.String) - */ @Override public boolean removeTopicFromBindingRegistry(final String name) throws Exception { final AtomicBoolean valueReturn = new AtomicBoolean(false); - // HORNETQ-911 - make this runAfterActive to prevent WARN messages on shutdown/undeployment when the backup was never activated + // make this runAfterActive to prevent WARN messages on shutdown/undeployment when the backup was never activated runAfterActive(new WrappedRunnable() { @Override public String toString() { @@ -1085,12 +1071,7 @@ private synchronized boolean internalCreateQueue(final String queueName, } /** - * Performs the internal creation without activating any storage. - * The storage load will call this method - * - * @param address - * @return - * @throws Exception + * Performs the internal creation without activating any storage. The storage load will call this method */ private synchronized boolean internalCreateTopic(final String address) throws Exception { return internalCreateTopic(address, address, false); @@ -1115,10 +1096,6 @@ private synchronized boolean internalCreateTopic(final String address, } } - /** - * @param cfConfig - * @throws Exception - */ private ActiveMQConnectionFactory internalCreateCF(final ConnectionFactoryConfiguration cfConfig) throws Exception { checkInitialised(); @@ -1133,11 +1110,6 @@ private ActiveMQConnectionFactory internalCreateCF(final ConnectionFactoryConfig return cf; } - /** - * @param cfConfig - * @return - * @throws ActiveMQException - */ protected ActiveMQConnectionFactory internalCreateCFPOJO(final ConnectionFactoryConfiguration cfConfig) throws ActiveMQException { ActiveMQConnectionFactory cf; if (cfConfig.getDiscoveryGroupName() != null) { @@ -1222,7 +1194,7 @@ protected ActiveMQConnectionFactory internalCreateCFPOJO(final ConnectionFactory public synchronized boolean destroyConnectionFactory(final String name) throws Exception { final AtomicBoolean valueReturn = new AtomicBoolean(false); - // HORNETQ-911 - make this runAfterActive to prevent WARN messages on shutdown/undeployment when the backup was never activated + // make this runAfterActive to prevent WARN messages on shutdown/undeployment when the backup was never activated runAfterActive(new WrappedRunnable() { @Override @@ -1246,10 +1218,6 @@ public void runException() throws Exception { return valueReturn.get(); } - /** - * @param name - * @throws Exception - */ protected boolean shutdownConnectionFactory(final String name) throws Exception { checkInitialised(); List registryBindings = connectionFactoryBindings.get(name); @@ -1382,9 +1350,6 @@ private void deploy() throws Exception { } } - /** - * @param param - */ private void unbindBindings(Map> param) { if (registry != null) { for (List elementList : param.values()) { @@ -1399,9 +1364,6 @@ private void unbindBindings(Map> param) { } } - /** - * @throws Exception - */ private void initJournal() throws Exception { this.coreConfig = server.getConfiguration(); @@ -1426,9 +1388,6 @@ private void initJournal() throws Exception { } } - /** - * @throws Exception - */ private void createJournal() throws Exception { if (storage != null) { storage.stop(); 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 df8bfe9e495..b94198363e8 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 @@ -60,15 +60,11 @@ public abstract class AbstractSequentialFile implements SequentialFile { protected TimedBuffer timedBuffer; /** - * Instead of having AIOSequentialFile implementing the Observer, I have done it on an inner class. - * This is the class returned to the factory when the file is being activated. + * Instead of having AIOSequentialFile implementing the Observer, I have done it on an inner class. This is the class + * returned to the factory when the file is being activated. */ protected final TimedBufferObserver timedBufferObserver = createTimedBufferObserver(); - /** - * @param file - * @param directory - */ public AbstractSequentialFile(final File directory, final String file, final SequentialFileFactory factory, @@ -170,8 +166,7 @@ public final void renameTo(final String newFileName) throws IOException, Interru } /** - * @throws IOException we declare throwing IOException because sub-classes need to do it - * @throws ActiveMQException + * @throws IOException we declare throwing IOException because sub-classes need to do it */ @Override public synchronized void close() throws IOException, InterruptedException, ActiveMQException { 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 e5a848d21b2..046f73b6672 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 @@ -63,9 +63,9 @@ public abstract class AbstractSequentialFileFactory implements SequentialFileFac protected final CriticalAnalyzer criticalAnalyzer; /** - * Asynchronous writes need to be done at another executor. - * This needs to be done at NIO, or else we would have the callers thread blocking for the return. - * At AIO this is necessary as context switches on writes would fire flushes at the kernel. + * Asynchronous writes need to be done at another executor. This needs to be done at NIO, or else we would have the + * callers thread blocking for the return. At AIO this is necessary as context switches on writes would fire flushes + * at the kernel. */ protected ExecutorService writeExecutor; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCallback.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCallback.java index 8eed9d23a2d..2f391a0a7f7 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCallback.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/IOCallback.java @@ -26,14 +26,16 @@ public interface IOCallback { /** - * Method for sync notifications. When this callback method is called, there is a guarantee the data is written on the disk. - *
            Note:Leave this method as soon as possible, or you would be blocking the whole notification thread + * Method for sync notifications. When this callback method is called, there is a guarantee the data is written on + * the disk. + *

            + * Note:Leave this method as soon as possible, or you would be blocking the whole notification thread */ void done(); /** - * Method for error notifications. - * Observation: The whole file will be probably failing if this happens. Like, if you delete the file, you will start to get errors for these operations + * Method for error notifications. Observation: The whole file will be probably failing if this happens. Like, if you + * delete the file, you will start to get errors for these operations */ void onError(int errorCode, String errorMessage); diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFile.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFile.java index a285d84f842..f90a39da7d2 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFile.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFile.java @@ -43,9 +43,6 @@ default void afterComplete(Runnable run) { /** * The maximum number of simultaneous writes accepted - * - * @param maxIO - * @throws Exception */ void open(int maxIO, boolean useExecutor) throws Exception; @@ -69,50 +66,50 @@ default void afterComplete(Runnable run) { void write(EncodingSupport bytes, boolean sync) throws Exception; - /** * Write directly to the file without using any buffer * - * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or - * NIO). To be safe, use a buffer from the corresponding - * {@link SequentialFileFactory#newBuffer(int)}. + * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, + * use a buffer from the corresponding {@link SequentialFileFactory#newBuffer(int)}. */ void writeDirect(ByteBuffer bytes, boolean sync, IOCallback callback); /** * Write directly to the file without using intermediate any buffer * - * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or - * NIO). To be safe, use a buffer from the corresponding - * {@link SequentialFileFactory#newBuffer(int)}. + * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, + * use a buffer from the corresponding {@link SequentialFileFactory#newBuffer(int)}. */ void writeDirect(ByteBuffer bytes, boolean sync) throws Exception; /** - * Write directly to the file without using any intermediate buffer and wait completion.
            - * If {@code releaseBuffer} is {@code true} the provided {@code bytes} should be released - * through {@link SequentialFileFactory#releaseBuffer(ByteBuffer)}, if supported. + * Write directly to the file without using any intermediate buffer and wait completion. + *

            + * If {@code releaseBuffer} is {@code true} the provided {@code bytes} should be released through + * {@link SequentialFileFactory#releaseBuffer(ByteBuffer)}, if supported. * - * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or - * NIO). If {@code releaseBuffer} is {@code true} use a buffer from - * {@link SequentialFileFactory#newBuffer(int)}, {@link SequentialFileFactory#allocateDirectBuffer(int)} - * otherwise. + * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). If + * {@code releaseBuffer} is {@code true} use a buffer from + * {@link SequentialFileFactory#newBuffer(int)}, + * {@link SequentialFileFactory#allocateDirectBuffer(int)} otherwise. * @param sync if {@code true} will durable flush the written data on the file, {@code false} otherwise * @param releaseBuffer if {@code true} will release the buffer, {@code false} otherwise */ void blockingWriteDirect(ByteBuffer bytes, boolean sync, boolean releaseBuffer) throws Exception; /** - * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or - * NIO). To be safe, use a buffer from the corresponding - * {@link SequentialFileFactory#newBuffer(int)}. + * Read the file. + * + * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, + * use a buffer from the corresponding {@link SequentialFileFactory#newBuffer(int)}. */ int read(ByteBuffer bytes, IOCallback callback) throws Exception; /** - * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or - * NIO). To be safe, use a buffer from the corresponding - * {@link SequentialFileFactory#newBuffer(int)}. + * Read the file. + * + * @param bytes the ByteBuffer must be compatible with the SequentialFile implementation (AIO or NIO). To be safe, + * use a buffer from the corresponding {@link SequentialFileFactory#newBuffer(int)}. */ int read(ByteBuffer bytes) throws Exception; @@ -122,8 +119,10 @@ default void afterComplete(Runnable run) { void close() throws Exception; - /** When closing a file from a finalize block, you cant wait on syncs or anything like that. - * otherwise the VM may hung. Especially on the testsuite. */ + /** + * When closing a file from a finalize block, you cant wait on syncs or anything like that. otherwise the VM may + * hung. Especially on the testsuite. + */ default void close(boolean waitSync, boolean blockOnWait) throws Exception { // by default most implementations are just using the regular close.. // if the close needs sync, please use this parameter or fianlizations may get stuck @@ -143,17 +142,15 @@ default void close(boolean waitSync, boolean blockOnWait) throws Exception { void setTimedBuffer(TimedBuffer buffer); /** - * Returns a native File of the file underlying this sequential file. + * {@return a native {@code File} of the file underlying this sequential file} */ File getJavaFile(); static long appendTo(Path src, Path dst) throws IOException { - try (FileChannel srcChannel = FileChannel.open(src, StandardOpenOption.CREATE, StandardOpenOption.READ, StandardOpenOption.WRITE); - FileLock srcLock = srcChannel.lock()) { + try (FileChannel srcChannel = FileChannel.open(src, StandardOpenOption.CREATE, StandardOpenOption.READ, StandardOpenOption.WRITE); FileLock srcLock = srcChannel.lock()) { final long readableBytes = srcChannel.size(); if (readableBytes > 0) { - try (FileChannel dstChannel = FileChannel.open(dst, StandardOpenOption.CREATE, StandardOpenOption.READ, StandardOpenOption.WRITE); - FileLock dstLock = dstChannel.lock()) { + try (FileChannel dstChannel = FileChannel.open(dst, StandardOpenOption.CREATE, StandardOpenOption.READ, StandardOpenOption.WRITE); FileLock dstLock = dstChannel.lock()) { final long oldLength = dstChannel.size(); final long transferred = dstChannel.transferFrom(srcChannel, oldLength, readableBytes); if (transferred != readableBytes) { diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFileFactory.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFileFactory.java index b4c9567bafe..390339ca400 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFileFactory.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/SequentialFileFactory.java @@ -54,10 +54,6 @@ default boolean isSyncSupported() { * Lists files that end with the given extension. *

            * This method inserts a ".' before the extension. - * - * @param extension - * @return - * @throws Exception */ List listFiles(String extension) throws Exception; @@ -77,32 +73,31 @@ default void onIOError(Throwable exception, String message) { } /** - * used for cases where you need direct buffer outside of the journal context. - * This is because the native layer has a method that can be reused in certain cases like paging + * used for cases where you need direct buffer outside of the journal context. This is because the native layer has a + * method that can be reused in certain cases like paging */ ByteBuffer allocateDirectBuffer(int size); /** - * used for cases where you need direct buffer outside of the journal context. - * This is because the native layer has a method that can be reused in certain cases like paging + * used for cases where you need direct buffer outside of the journal context. This is because the native layer has a + * method that can be reused in certain cases like paging */ void releaseDirectBuffer(ByteBuffer buffer); /** - * Note: You need to release the buffer if is used for reading operations. You don't need to do - * it if using writing operations (AIO Buffer Lister will take of writing operations) + * Note: You need to release the buffer if is used for reading operations. You don't need to do it if using writing + * operations (AIO Buffer Lister will take of writing operations) * - * @param size * @return the allocated ByteBuffer */ ByteBuffer newBuffer(int size); /** - * Note: You need to release the buffer if is used for reading operations. You don't need to do - * it if using writing operations (AIO Buffer Lister will take of writing operations) + * Note: You need to release the buffer if is used for reading operations. You don't need to do it if using writing + * operations (AIO Buffer Lister will take of writing operations) * - * @param size - * @param zeroed if {@code true} the returned {@link ByteBuffer} must be zeroed, otherwise it tries to save zeroing it. + * @param zeroed if {@code true} the returned {@link ByteBuffer} must be zeroed, otherwise it tries to save zeroing + * it. * @return the allocated ByteBuffer */ default ByteBuffer newBuffer(int size, boolean zeroed) { @@ -149,9 +144,10 @@ default String getDirectoryName() { long getBufferSize(); - /** Only JDBC supports individual context. - * Meaning for Files we need to use the Sync scheduler. - * for JDBC we need to use a callback from the JDBC completion thread to complete the IOContexts. */ + /** + * Only JDBC supports individual context. Meaning for Files we need to use the Sync scheduler. for JDBC we need to + * use a callback from the JDBC completion thread to complete the IOContexts. + */ default boolean supportsIndividualContext() { return false; } 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 d7d737d0797..0c3012d135e 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 @@ -35,7 +35,9 @@ import java.lang.invoke.MethodHandles; import org.slf4j.Logger; -/** This class is implementing Runnable to reuse a callback to close it. */ +/** + * This class is implementing Runnable to reuse a callback to close it. + */ public class AIOSequentialFile extends AbstractSequentialFile { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -53,14 +55,13 @@ public class AIOSequentialFile extends AbstractSequentialFile { /** * AIO can't guarantee ordering over callbacks. - *
            + *

            * We use this {@link PriorityQueue} to hold values until they are in order */ final PriorityQueue pendingCallbackList = new PriorityQueue<>(); /** - * Used to determine the next writing sequence. - * This is accessed from a single thread (the Poller Thread) + * Used to determine the next writing sequence. This is accessed from a single thread (the Poller Thread) */ private long nextReadSequence = 0; 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 2b403c00d04..3f37958be98 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 @@ -268,15 +268,13 @@ public int calculateBlockSize(final int position) { } /** - * It can be used to align {@code size} if alignment is not a power of 2: otherwise better to use {@link PowerOf2Util#align(int, int)} instead. + * It can be used to align {@code size} if alignment is not a power of 2: otherwise better to use + * {@link PowerOf2Util#align(int, int)} instead. */ private static int align(int size, int alignment) { return (size / alignment + (size % alignment != 0 ? 1 : 0)) * alignment; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFileFactory#releaseBuffer(java.nio.ByteBuffer) - */ @Override public synchronized void releaseBuffer(final ByteBuffer buffer) { LibaioContext.freeBuffer(buffer); @@ -322,8 +320,7 @@ public void stop() { } /** - * The same callback is used for Runnable executor. - * This way we can save some memory over the pool. + * The same callback is used for Runnable executor. This way we can save some memory over the pool. */ public class AIOSequentialCallback implements SubmitInfo, Runnable, Comparable { 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 a46c2a9e9fb..e73371deb37 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 @@ -208,8 +208,6 @@ public void setObserver(final TimedBufferObserver observer) { /** * Verify if the size fits the buffer - * - * @param sizeChecked */ public boolean checkSize(final int sizeChecked) { try (ArtemisCloseable measure = measureCritical(CRITICAL_PATH_CHECK_SIZE)) { @@ -366,8 +364,6 @@ public boolean flushBatch() { /** * Sub classes (tests basically) can use this to override how the sleep is being done - * - * @param sleepNanos */ protected void sleep(long sleepNanos) { LockSupport.parkNanos(sleepNanos); @@ -496,9 +492,9 @@ public void run() { } /** - * We will attempt to use sleep only if the system supports nano-sleep. - * we will on that case verify up to MAX_CHECKS if nano sleep is behaving well. - * if more than 50% of the checks have failed we will cancel the sleep and just use regular spin + * We will attempt to use sleep only if the system supports nano-sleep. we will on that case verify up to + * MAX_CHECKS if nano sleep is behaving well. if more than 50% of the checks have failed we will cancel the sleep + * and just use regular spin */ private boolean sleepIfPossible(long nanosToSleep) { boolean useSleep = true; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBufferObserver.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBufferObserver.java index 9e877d3d192..22aa7e5fb25 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBufferObserver.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBufferObserver.java @@ -24,7 +24,8 @@ public interface TimedBufferObserver { /** - * It flushes {@link ByteBuf#readableBytes()} of {@code buffer} without changing its reader/writer indexes.
            + * It flushes {@link ByteBuf#readableBytes()} of {@code buffer} without changing its reader/writer indexes. + *

            * It just use {@code buffer} temporary: it can be reused by the caller right after this call. */ void flushBuffer(ByteBuf buffer, boolean syncRequested, List callbacks); 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 b7a11642fb6..f8159d1ee79 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 @@ -107,8 +107,8 @@ private void rawMovePositionAndLength(int position) { /** * Reads a sequence of bytes from this file into the given buffer. *

            - *

            Bytes are read starting at this file's current position, and - * then the position is updated with the number of bytes actually read. + * Bytes are read starting at this file's current position, and then the position is updated with the number of bytes + * actually read. */ public int read(ByteBuffer dst, int dstStart, int dstLength) throws IOException { final int remaining = this.length - this.position; @@ -128,7 +128,7 @@ public int read(ByteBuffer dst, int dstStart, int dstLength) throws IOException /** * Writes an encoded sequence of bytes to this file from the given buffer. *

            - *

            Bytes are written starting at this file's current position, + * Bytes are written starting at this file's current position, */ public void write(EncodingSupport encodingSupport) throws IOException { final int encodedSize = encodingSupport.getEncodeSize(); @@ -143,7 +143,7 @@ public void write(EncodingSupport encodingSupport) throws IOException { /** * Writes a sequence of bytes to this file from the given buffer. *

            - *

            Bytes are written starting at this file's current position, + * Bytes are written starting at this file's current position, */ public void write(ByteBuf src, int srcStart, int srcLength) throws IOException { final int nextPosition = this.position + srcLength; @@ -164,7 +164,7 @@ public void write(ByteBuf src, int srcStart, int srcLength) throws IOException { /** * Writes a sequence of bytes to this file from the given buffer. *

            - *

            Bytes are written starting at this file's current position, + * Bytes are written starting at this file's current position, */ public void write(ByteBuffer src, int srcStart, int srcLength) throws IOException { final int nextPosition = this.position + srcLength; @@ -183,7 +183,7 @@ public void write(ByteBuffer src, int srcStart, int srcLength) throws IOExceptio /** * Writes a sequence of bytes to this file from the given buffer. *

            - *

            Bytes are written starting at this file's current position, + * Bytes are written starting at this file's current position, */ public void zeros(int position, final int count) throws IOException { checkCapacity(position + count); 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 be95bf918b7..3580daa7939 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 @@ -53,7 +53,8 @@ public class NIOSequentialFile extends AbstractSequentialFile { private static final boolean DEBUG_OPENS = false; - /* This value has been tuned just to reduce the memory footprint + /* + * This value has been tuned just to reduce the memory footprint of read/write of the whole file size: given that this value is > 8192, RandomAccessFile JNI code will use malloc/free instead of using a copy on the stack, but it has been proven to NOT be @@ -94,8 +95,8 @@ public synchronized boolean isOpen() { } /** - * this.maxIO represents the default maxIO. - * Some operations while initializing files on the journal may require a different maxIO + * this.maxIO represents the default maxIO. Some operations while initializing files on the journal may require a + * different maxIO */ @Override public synchronized void open() throws IOException { @@ -420,13 +421,6 @@ private synchronized void internalWrite(final ByteBuffer bytes, } } - /** - * @param bytes - * @param sync - * @param callback - * @throws IOException - * @throws Exception - */ private void doInternalWrite(final ByteBuffer bytes, final boolean sync, final IOCallback callback, diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFileFactory.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFileFactory.java index 0be3009c13a..8674a5767b1 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFileFactory.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFileFactory.java @@ -81,7 +81,7 @@ public NIOSequentialFileFactory(final File journalDir, } public static ByteBuffer allocateDirectByteBuffer(final int size) { - // Using direct buffer, as described on https://jira.jboss.org/browse/HORNETQ-467 + // Using direct buffer ByteBuffer buffer2 = null; try { buffer2 = ByteBuffer.allocateDirect(size); diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/util/ByteBufferPool.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/util/ByteBufferPool.java index 7aac7506b6d..48ed0d4f19b 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/util/ByteBufferPool.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/util/ByteBufferPool.java @@ -19,7 +19,8 @@ import java.nio.ByteBuffer; /** - * Object Pool that allows to borrow and release {@link ByteBuffer}s according to a specific type (direct/heap).
            + * Object Pool that allows to borrow and release {@link ByteBuffer}s according to a specific type (direct/heap). + *

            * The suggested usage pattern is: *

            {@code
              *    ByteBuffer buffer = pool.borrow(size);
            @@ -30,19 +31,23 @@
             public interface ByteBufferPool {
             
                /**
            -    * It returns a {@link ByteBuffer} with {@link ByteBuffer#capacity()} >= {@code size}.
            - * The {@code buffer} is zeroed until {@code size} if {@code zeroed=true}, with {@link ByteBuffer#position()}=0 and {@link ByteBuffer#limit()}={@code size}. + * It returns a {@link ByteBuffer} with {@link ByteBuffer#capacity()} >= {@code size}. + *

            + * The {@code buffer} is zeroed until {@code size} if {@code zeroed=true}, with {@link ByteBuffer#position()}=0 and + * {@link ByteBuffer#limit()}={@code size}. */ ByteBuffer borrow(int size, boolean zeroed); /** - * It pools or free {@code buffer} that cannot be used anymore.
            + * It pools or free {@code buffer} that cannot be used anymore. + *

            * If {@code buffer} is of a type different from the one that the pool can borrow, it will ignore it. */ void release(ByteBuffer buffer); /** - * Factory method that creates a thread-local pool of capacity 1 of {@link ByteBuffer}s of the specified type (direct/heap). + * Factory method that creates a thread-local pool of capacity 1 of {@link ByteBuffer}s of the specified type + * (direct/heap). */ static ByteBufferPool threadLocal(boolean direct) { return new ThreadLocalByteBufferPool(direct); diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/EncoderPersister.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/EncoderPersister.java index 164bfa451ea..9fec1696691 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/EncoderPersister.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/EncoderPersister.java @@ -20,8 +20,10 @@ import org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools; import org.apache.activemq.artemis.core.persistence.Persister; -/** This is a facade between the new Persister and the former EncodingSupport. - * Methods using the old interface will use this as a facade to provide the previous semantic. */ +/** + * This is a facade between the new Persister and the former EncodingSupport. Methods using the old interface will use + * this as a facade to provide the previous semantic. + */ public class EncoderPersister implements Persister { private static final EncoderPersister theInstance = new EncoderPersister(); diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/Journal.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/Journal.java index 67915fc9da4..f727dfc7464 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/Journal.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/Journal.java @@ -29,34 +29,33 @@ import org.apache.activemq.artemis.utils.collections.SparseArrayLinkedList; /** - * Most methods on the journal provide a blocking version where you select the sync mode and a non - * blocking mode where you pass a completion callback as a parameter. + * Most methods on the journal provide a blocking version where you select the sync mode and a non blocking mode where + * you pass a completion callback as a parameter. *

            - * Notice also that even on the callback methods it's possible to pass the sync mode. That will only - * make sense on the NIO operations. + * Notice also that even on the callback methods it's possible to pass the sync mode. That will only make sense on the + * NIO operations. */ public interface Journal extends ActiveMQComponent { enum JournalState { STOPPED, /** - * The journal has some fields initialized and services running. But it is not fully - * operational. See {@link JournalState#LOADED}. + * The journal has some fields initialized and services running. But it is not fully operational. See + * {@link JournalState#LOADED}. */ STARTED, /** - * When a replicating server is still not synchronized with its replica. So if the replicating - * server stops, the replica may not fail-over and will stop as well. + * When a replicating server is still not synchronized with its replica. So if the replicating server stops, the + * replica may not fail-over and will stop as well. */ SYNCING, /** - * Journal is being used by a replicating server which is up-to-date with its replica. That means - * that if the replicating server stops, the replica can fail-over. + * Journal is being used by a replicating server which is up-to-date with its replica. That means that if the + * replicating server stops, the replica can fail-over. */ SYNCING_UP_TO_DATE, /** - * The journal is fully operational. This is the state the journal should be when its server - * is active. + * The journal is fully operational. This is the state the journal should be when its server is active. */ LOADED; } @@ -94,8 +93,10 @@ void appendAddRecord(long id, boolean sync, IOCompletion completionCallback) throws Exception; - /** An event is data recorded on the journal, but it won't have any weight or deletes. It's always ready to be removed. - * It is useful on recovery data while in use with backup history journal. */ + /** + * An event is data recorded on the journal, but it won't have any weight or deletes. It's always ready to be + * removed. It is useful on recovery data while in use with backup history journal. + */ void appendAddEvent(long id, byte recordType, Persister persister, @@ -213,24 +214,18 @@ default void appendUpdateRecordTransactional(long txID, long id, byte recordType void appendCommitRecord(long txID, boolean sync, IOCompletion callback) throws Exception; /** - * @param txID - * @param sync - * @param callback - * @param lineUpContext if appendCommitRecord should call a storeLineUp. This is because the - * caller may have already taken into account - * @throws Exception + * append a commit record to this {@code Journal} implementation + * + * @param lineUpContext if appendCommitRecord should call a storeLineUp. This is because the caller may have already + * taken into account */ void appendCommitRecord(long txID, boolean sync, IOCompletion callback, boolean lineUpContext) throws Exception; /** - *

            If the system crashed after a prepare was called, it should store information that is required to bring the transaction - * back to a state it could be committed.

            + * If the system crashed after a prepare was called, it should store information that is required to bring the + * transaction back to a state it could be committed. * - *

            transactionData allows you to store any other supporting user-data related to the transaction

            - * - * @param txID - * @param transactionData - extra user data for the prepare - * @throws Exception + * @param transactionData allows you to store any extra supporting user-data related to the transaction */ void appendPrepareRecord(long txID, EncodingSupport transactionData, boolean sync) throws Exception; @@ -250,9 +245,8 @@ void appendPrepareRecord(long txID, JournalLoadInformation load(LoaderCallback reloadManager) throws Exception; /** - * Load internal data structures and not expose any data. This is only useful if you're using the - * journal but not interested on the current data. Useful in situations where the journal is - * being replicated, copied... etc. + * Load internal data structures and not expose any data. This is only useful if you're using the journal but not + * interested on the current data. Useful in situations where the journal is being replicated, copied... etc. */ JournalLoadInformation loadInternalOnly() throws Exception; @@ -294,22 +288,21 @@ JournalLoadInformation load(SparseArrayLinkedList committedRecords, int getUserVersion(); /** - * Reserves journal file IDs, creates the necessary files for synchronization, and places - * references to these (reserved for sync) files in the map. + * Reserves journal file IDs, creates the necessary files for synchronization, and places references to these + * (reserved for sync) files in the map. *

            - * During the synchronization between a replicating server and replica, we reserve in the - * replica the journal file IDs used in the replicating server. This call also makes sure - * the files are created empty without any kind of headers added. + * During the synchronization between a replicating server and replica, we reserve in the replica the journal file + * IDs used in the replicating server. This call also makes sure the files are created empty without any kind of + * headers added. * * @param fileIds IDs to reserve for synchronization - * @return map to be filled with id and journal file pairs for synchronization. - * @throws Exception + * @return map to be filled with id and journal file pairs for synchronization */ Map createFilesForBackupSync(long[] fileIds) throws Exception; /** - * Write lock the Journal and write lock the compacting process. Necessary only during - * replication for backup synchronization. + * Write lock the Journal and write lock the compacting process. Necessary only during replication for backup + * synchronization. */ void synchronizationLock(); @@ -331,21 +324,17 @@ default void processBackup() { */ default void processBackupCleanup() { } + /** * Force the usage of a new {@link JournalFile}. - * - * @throws Exception */ void forceMoveNextFile() throws Exception; default void forceBackup(int timeout, TimeUnit unit) throws Exception { } - /** - * Returns the {@link JournalFile}s in use. - * - * @return array with all {@link JournalFile}s in use + * {@return array with all {@link JournalFile}s in use} */ JournalFile[] getDataFiles(); @@ -357,35 +346,32 @@ default void forceBackup(int timeout, TimeUnit unit) throws Exception { * This method will start compact using the compactorExecutor and block up to timeout seconds * * @param timeout the timeout in seconds or block forever if {@code <= 0} - * @throws Exception */ void scheduleCompactAndBlock(int timeout) throws Exception; /** * Stops any operation that may delete or modify old (stale) data. *

            - * Meant to be used during synchronization of data between a replicating server and its - * replica. Old files must not be compacted or deleted during synchronization. + * Meant to be used during synchronization of data between a replicating server and its replica. Old files must not + * be compacted or deleted during synchronization. */ void replicationSyncPreserveOldFiles(); /** * Restarts file reclaim and compacting on the journal. *

            - * Meant to be used to revert the effect of {@link #replicationSyncPreserveOldFiles()}. - * it should only be called once the synchronization of the replica and replicating - * servers is completed. + * Meant to be used to revert the effect of {@link #replicationSyncPreserveOldFiles()}. it should only be called once + * the synchronization of the replica and replicating servers is completed. */ void replicationSyncFinished(); /** * It will make sure there are no more pending operations on the Executors. - * */ + */ void flush() throws Exception; /** - * The max size record that can be stored in the journal - * @return + * {@return the max size record that can be stored in the journal} */ long getMaxRecordSize(); diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/JournalLoadInformation.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/JournalLoadInformation.java index fe9fdc65d3f..e4d1596650c 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/JournalLoadInformation.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/JournalLoadInformation.java @@ -29,40 +29,24 @@ public JournalLoadInformation() { super(); } - /** - * @param numberOfRecords - * @param maxID - */ public JournalLoadInformation(final int numberOfRecords, final long maxID) { super(); this.numberOfRecords = numberOfRecords; this.maxID = maxID; } - /** - * @return the numberOfRecords - */ public int getNumberOfRecords() { return numberOfRecords; } - /** - * @param numberOfRecords the numberOfRecords to set - */ public void setNumberOfRecords(final int numberOfRecords) { this.numberOfRecords = numberOfRecords; } - /** - * @return the maxID - */ public long getMaxID() { return maxID; } - /** - * @param maxID the maxID to set - */ public void setMaxID(final long maxID) { this.maxID = maxID; } diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/RecordInfo.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/RecordInfo.java index 11ec27496a7..cdefb8714e7 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/RecordInfo.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/RecordInfo.java @@ -42,8 +42,7 @@ public RecordInfo(final long id, } /** - * How many times this record was compacted (up to 7 times) - * After the record has reached 7 times, it will always be 7 + * How many times this record was compacted (up to 7 times) After the record has reached 7 times, it will always be 7 * As we only store up to 0x7 binary, as part of the recordID (binary 111) */ public final short compactCount; diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/TransactionFailureCallback.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/TransactionFailureCallback.java index a64a8a76e59..e738f182614 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/TransactionFailureCallback.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/TransactionFailureCallback.java @@ -19,13 +19,14 @@ import java.util.List; /** - * A Callback to receive information about bad transactions for extra cleanup required for broken transactions such as large messages. + * A Callback to receive information about bad transactions for extra cleanup required for broken transactions such as + * large messages. */ public interface TransactionFailureCallback { /** - * To be used to inform about transactions without commit records. - * This could be used to remove extra resources associated with the transactions (such as external files received during the transaction) + * To be used to inform about transactions without commit records. This could be used to remove extra resources + * associated with the transactions (such as external files received during the transaction) */ void failedTransaction(long transactionID, List records, List recordsToDelete); diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/collections/JournalHashMap.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/collections/JournalHashMap.java index 3fa3e77cd92..77bfbaf444a 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/collections/JournalHashMap.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/collections/JournalHashMap.java @@ -41,7 +41,7 @@ * K = Key * V = Value * C = Context - * */ + */ public class JournalHashMap implements Map { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -191,7 +191,9 @@ public synchronized V get(Object key) { } } - /** This is to be called from a single thread during reload, no need to be synchronized */ + /** + * This is to be called from a single thread during reload, no need to be synchronized + */ public void reload(MapRecord reloadValue) { map.put(reloadValue.getKey(), reloadValue); } @@ -259,9 +261,12 @@ public synchronized V remove(Object key) { return record.value; } - /** This method will remove the element from the HashMap immediately however the record is still part of a transaction. - * This is not playing with rollbacks. So a rollback on the transaction wouldn't place the elements back. - * This is intended to make sure the operation would be atomic in case of a failure, while an appendRollback is not expected. */ + /** + * This method will remove the element from the HashMap immediately however the record is still part of a + * transaction. This is not playing with rollbacks. So a rollback on the transaction wouldn't place the elements + * back. This is intended to make sure the operation would be atomic in case of a failure, while an appendRollback is + * not expected. + */ public synchronized V remove(Object key, long transactionID) { MapRecord record = map.remove(key); this.removed(record, transactionID); @@ -284,7 +289,9 @@ public Set keySet() { return map.keySet(); } - /** Not implemented yet, you may use valuesCopy.*/ + /** + * Not implemented yet, you may use valuesCopy. + */ @Override public Collection values() { throw new UnsupportedOperationException("not implemented yet. You may use valuesCopy"); @@ -296,7 +303,9 @@ public synchronized Collection valuesCopy() { return values; } - /** Not implemented yet, you may use entrySetCoy */ + /** + * Not implemented yet, you may use entrySetCoy + */ @Override public synchronized Set> entrySet() { throw new UnsupportedOperationException("not implemented yet. You may use entrySetCopy"); diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/AbstractJournalUpdateTask.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/AbstractJournalUpdateTask.java index f2c143706d8..eb9cb101f01 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/AbstractJournalUpdateTask.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/AbstractJournalUpdateTask.java @@ -247,12 +247,6 @@ public boolean containsRecord(final long id) { return recordsSnapshot.contains(id); } - - - /** - * @throws Exception - */ - protected void openFile() throws Exception { flush(false); @@ -286,9 +280,6 @@ protected void addToRecordsSnaptshot(final long id) { recordsSnapshot.add(id); } - /** - * @return the writingChannel - */ protected ActiveMQBuffer getWritingChannel() { return writingChannel; } diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/FileWrapperJournal.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/FileWrapperJournal.java index 798260572b0..2ecd8aeecd0 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/FileWrapperJournal.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/FileWrapperJournal.java @@ -46,9 +46,9 @@ import org.apache.activemq.artemis.utils.collections.SparseArrayLinkedList; /** - * Journal used at a replicating backup server during the synchronization of data with the 'live' - * server. It just wraps a single {@link JournalFile}. - * + * Journal used at a replicating backup server during the synchronization of data with the 'live' server. It just wraps + * a single {@link JournalFile}. + *

            * Its main purpose is to store the data as a Journal would, but without verifying records. */ public final class FileWrapperJournal extends JournalBase { @@ -64,10 +64,6 @@ public void replaceableRecord(byte recordType) { journal.replaceableRecord(recordType); } - /** - * @param journal - * @throws Exception - */ public FileWrapperJournal(Journal journal) throws Exception { super(journal.getFileFactory().isSupportsCallbacks(), journal.getFileSize()); this.journal = (JournalImpl) journal; @@ -123,8 +119,6 @@ public void flush() throws Exception { /** * The max size record that can be stored in the journal - * - * @return */ @Override public long getMaxRecordSize() { 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 1e4ea2e8dd9..05357eaf594 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 @@ -65,9 +65,8 @@ public class JournalCompactor extends AbstractJournalUpdateTask implements Journ private final ConcurrentLongHashMap newTransactions = new ConcurrentLongHashMap<>(); /** - * Commands that happened during compacting - * We can't process any counts during compacting, as we won't know in what files the records are taking place, so - * we cache those updates. As soon as we are done we take the right account. + * Commands that happened during compacting. We can't process any counts during compacting, as we won't know in what + * files the records are taking place, so we cache those updates. As soon as we are done we take the right account. */ private final LinkedList pendingCommands = new LinkedList<>(); @@ -117,8 +116,10 @@ public void addCommandCommit(final JournalTransaction liveTransaction, final Jou ids2 = oldTransaction.pendingIDs; } - /** If a delete comes for these records, while the compactor still working, we need to be able to take them into account for later deletes - * instead of throwing exceptions about non existent records */ + /* + * If a delete comes for these records, while the compactor still working, we need to be able to take them into + * account for later deletes instead of throwing exceptions about non existent records. + */ if (ids != null) { for (long id : ids) { addToRecordsSnaptshot(id); @@ -137,10 +138,6 @@ public void addCommandRollback(final JournalTransaction liveTransaction, final J pendingCommands.add(new RollbackCompactCommand(liveTransaction, currentFile)); } - /** - * @param id - * @param usedFile - */ public void addCommandDelete(final long id, final JournalFile usedFile) { if (logger.isTraceEnabled()) { logger.trace("addCommandDelete id {} usedFile {}", id, usedFile); @@ -148,10 +145,6 @@ public void addCommandDelete(final long id, final JournalFile usedFile) { pendingCommands.add(new DeleteCompactCommand(id, usedFile)); } - /** - * @param id - * @param usedFile - */ public void addCommandUpdate(final long id, final JournalFile usedFile, final int size, final boolean replaceableUpdate) { if (logger.isTraceEnabled()) { logger.trace("addCommandUpdate id {} usedFile {} size {}", id, usedFile, size); @@ -475,10 +468,6 @@ private void produceUpdateRecordTX(long transactionID, RecordInfo info) throws E newTransaction.addPositive(currentFile, info.id, updateRecordTX.getEncodeSize(), info.replaceableUpdate); } - /** - * @param transactionID - * @return - */ private JournalTransaction getNewJournalTransaction(final long transactionID) { JournalTransaction newTransaction = newTransactions.get(transactionID); if (newTransaction == null) { diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalConstants.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalConstants.java index 052b84be798..dd9de77c1c4 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalConstants.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalConstants.java @@ -18,9 +18,10 @@ import org.apache.activemq.artemis.ArtemisConstants; -@Deprecated /** - * @deprecated Use ArtemisConstants instead. - */ public final class JournalConstants extends ArtemisConstants { + * @deprecated use {@link ArtemisConstants} instead + */ +@Deprecated +public final class JournalConstants extends ArtemisConstants { } diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFile.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFile.java index f7048d844bf..cc39ff67988 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFile.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFile.java @@ -60,7 +60,6 @@ default void setReclaimable(boolean reclaimable) { /** * Callback for when a file is removed. to cleanup negatives and avoid leaks. - * @param fileRemoved */ void fileRemoved(JournalFile fileRemoved); @@ -81,13 +80,13 @@ default void setReclaimable(boolean reclaimable) { /** * Whether this file's contents can deleted and the file reused. * - * @return {@code true} if the file can already be deleted. + * @return {@code true} if the file can already be deleted */ boolean isCanReclaim(); /** - * This is a field to identify that records on this file actually belong to the current file. - * The possible implementation for this is fileID & Integer.MAX_VALUE + * This is a field to identify that records on this file actually belong to the current file. The possible + * implementation for this is fileID & Integer.MAX_VALUE */ int getRecordID(); 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 35a8cc52548..5329b61ea9d 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 @@ -57,7 +57,7 @@ public class JournalFilesRepository { /** * Used to debug the consistency of the journal ordering. - *
            + *

            * This is meant to be false as these extra checks would cause performance issues */ private static final boolean CHECK_CONSISTENCE = false; @@ -193,13 +193,10 @@ public void calculateNextfileID(final List files) { } /** - * Set the {link #nextFileID} value to {@code targetUpdate} if the current value is less than - * {@code targetUpdate}. - * + * Set the {link #nextFileID} value to {@code targetUpdate} if the current value is less than {@code targetUpdate}. + *

            * Notice that {@code nextFileID} is incremented before being used, see * {@link JournalFilesRepository#generateFileID()}. - * - * @param targetUpdate */ public void setNextFileID(final long targetUpdate) { while (true) { @@ -352,19 +349,15 @@ public int getFreeFilesCount() { return freeFilesCount.get(); } - /** - * @param file - * @throws Exception - */ public synchronized void addFreeFile(final JournalFile file, final boolean renameTmp) throws Exception { addFreeFile(file, renameTmp, true); } /** - * @param file + * add a free file + * * @param renameTmp - should rename the file as it's being added to free files * @param checkDelete - should delete the file if max condition has been met - * @throws Exception */ public synchronized void addFreeFile(final JournalFile file, final boolean renameTmp, @@ -466,9 +459,11 @@ public JournalFile openFileCMP() throws Exception { } /** - *

            This method will instantly return the opened file, and schedule opening and reclaiming.

            - *

            In case there are no cached opened files, this method will block until the file was opened, - * what would happen only if the system is under heavy load by another system (like a backup system, or a DB sharing the same box as ActiveMQ).

            + * This method will instantly return the opened file, and schedule opening and reclaiming. + *

            + * In case there are no cached opened files, this method will block until the file was opened, what would happen only + * if the system is under heavy load by another system (like a backup system, or a DB sharing the same box as + * ActiveMQ). * * @throws ActiveMQIOErrorException In case the file could not be opened */ @@ -555,7 +550,6 @@ public void closeFile(final JournalFile file, boolean block) throws Exception { * This will get a File from freeFile without initializing it * * @return uninitialized JournalFile - * @throws Exception * @see JournalImpl#initFileHeader(SequentialFileFactory, SequentialFile, int, long) */ private JournalFile takeFile(final boolean keepOpened, @@ -587,9 +581,8 @@ private JournalFile takeFile(final boolean keepOpened, /** * Creates files for journal synchronization of a replicated backup. - * - * In order to simplify synchronization, the file IDs in the backup match those in the live - * server. + *

            + * In order to simplify synchronization, the file IDs in the backup match those in the live server. * * @param fileID the fileID to use when creating the file. */ @@ -600,9 +593,7 @@ public JournalFile createRemoteBackupSyncFile(long fileID) throws Exception { /** * This method will create a new file on the file system, pre-fill it with FILL_CHARACTER * - * @param keepOpened * @return an initialized journal file - * @throws Exception */ private JournalFile createFile(final boolean keepOpened, final boolean multiAIO, @@ -674,11 +665,6 @@ private JournalFile createFile0(final boolean keepOpened, return new JournalFileImpl(sequentialFile, fileID, JournalImpl.FORMAT_VERSION); } - /** - * @param tmpCompact - * @param fileID - * @return - */ private String createFileName(final boolean tmpCompact, final long fileID) { String fileName; if (tmpCompact) { 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 b9468efe3c1..0933f402902 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 @@ -99,28 +99,30 @@ import static org.apache.activemq.artemis.core.journal.impl.Reclaimer.scan; /** - *

            A circular log implementation.

            - *

            Look at {@link JournalImpl#load(LoaderCallback)} for the file layout + * A circular log implementation. + *

            + * 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(MethodHandles.lookup().lookupClass()); - /** * this is a factor where when you have more than UPDATE_FACTOR updates for every ADD. - * + *

            * When this happens we should issue a compacting event. - * - * I don't foresee users needing to configure this value. However if this ever happens we would have a system property aligned for this. - * - * With that being said, if you needed this, please raise an issue on why you needed to use this, so we may eventually add it to broker.xml when a real - * use case would determine the configuration exposed in there. - * - * To update this value, define a System Property org.apache.activemq.artemis.core.journal.impl.JournalImpl.UPDATE_FACTOR=YOUR VALUE - * - * We only calculate this against replaceable updates, on this case for redelivery counts and rescheduled redelivery in artemis server - * - * */ + *

            + * I don't foresee users needing to configure this value. However if this ever happens we would have a system + * property aligned for this. + *

            + * With that being said, if you needed this, please raise an issue on why you needed to use this, so we may + * eventually add it to broker.xml when a real use case would determine the configuration exposed in there. + *

            + * To update this value, define a System Property + * org.apache.activemq.artemis.core.journal.impl.JournalImpl.UPDATE_FACTOR=YOUR VALUE + *

            + * We only calculate this against replaceable updates, on this case for redelivery counts and rescheduled redelivery + * in artemis server + */ public static final double UPDATE_FACTOR; private static final String BKP_EXTENSION = "bkp"; public static final String BKP = "." + BKP_EXTENSION; @@ -320,10 +322,9 @@ public JournalImpl setHistoryFolder(File historyFolder, long maxBytes, long peri ThreadLocal calendarThreadLocal = ThreadLocal.withInitial(() -> new GregorianCalendar()); /** - * We don't lock the journal during the whole compacting operation. During compacting we only - * lock it (i) when gathering the initial structure, and (ii) when replicating the structures - * after finished compacting. - * + * We don't lock the journal during the whole compacting operation. During compacting we only lock it (i) when + * gathering the initial structure, and (ii) when replicating the structures after finished compacting. + *

            * However we need to lock it while taking and updating snapshots */ private final ReadWriteLock journalLock = new ReentrantReadWriteLock(); @@ -331,10 +332,10 @@ public JournalImpl setHistoryFolder(File historyFolder, long maxBytes, long peri ByteObjectHashMap replaceableRecords; - - /** This will declare a record type as being replaceable on updates. - * Certain update records only need the last value, and they could be replaceable during compacting. - * */ + /** + * This will declare a record type as being replaceable on updates. Certain update records only need the last value, + * and they could be replaceable during compacting. + */ @Override public void replaceableRecord(byte recordType) { if (replaceableRecords == null) { @@ -517,8 +518,8 @@ public JournalCompactor getCompactor() { } /** - * this method is used internally only however tools may use it to maintenance. - * It won't be part of the interface as the tools should be specific to the implementation + * this method is used internally only however tools may use it to maintenance. It won't be part of the interface as + * the tools should be specific to the implementation */ public List orderFiles() throws Exception { List fileNames = fileFactory.listFiles(filesRepository.getFileExtension()); @@ -1382,14 +1383,13 @@ public void appendDeleteRecordTransactional(final long txID, } /** - *

            If the system crashed after a prepare was called, it should store information that is required to bring the transaction + *

            If the system crashed after a prepare was called, it should store information that is required to bring the + * transaction * back to a state it could be committed.

            *

            transactionData allows you to store any other supporting user-data related to the transaction

            *

            This method also uses the same logic applied on {@link JournalImpl#appendCommitRecord(long, boolean)} * - * @param txID * @param transactionData extra user data for the prepare - * @throws Exception */ @Override public void appendPrepareRecord(final long txID, @@ -1567,7 +1567,6 @@ public void appendRollbackRecord(final long txID, final boolean sync, final IOCo } } - // XXX make it protected? @Override public int getAlignment() throws Exception { return fileFactory.getAlignment(); @@ -1647,7 +1646,7 @@ public synchronized JournalLoadInformation load(final SparseArrayLinkedList DELETE_FLUSH && runtime.freeMemory() < runtime.maxMemory() * 0.2) { if (logger.isDebugEnabled()) { logger.debug("Flushing deletes during loading, deleteCount = {}", recordsToDelete.size()); @@ -1739,13 +1738,11 @@ public void scheduleCompactAndBlock(int timeout) throws Exception { } /** - * Note: This method can't be called from the main executor, as it will invoke other methods - * depending on it. - * - * Note: only synchronized methods on journal are methods responsible for the life-cycle such as - * stop, start records will still come as this is being executed + * Note: This method can't be called from the main executor, as it will invoke other methods depending on it. + *

            + * Note: only synchronized methods on journal are methods responsible for the life-cycle such as stop, start records + * will still come as this is being executed */ - public synchronized void compact() { if (compactor != null) { @@ -1885,9 +1882,11 @@ public synchronized void compact() { } - /** this private method will return a list of data files that need to be cleaned up. - * It will get the list, and replace it on the journal structure, while a separate thread would be able - * to read it, and append to a new list that will be replaced on the journal. */ + /** + * this private method will return a list of data files that need to be cleaned up. It will get the list, and replace + * it on the journal structure, while a separate thread would be able to read it, and append to a new list that will + * be replaced on the journal. + */ private List getDataListToCompact() throws Exception { List dataFilesToProcess = new ArrayList<>(filesRepository.getDataFilesCount()); // We need to guarantee that the journal is frozen for this short time @@ -1978,11 +1977,7 @@ public JournalLoadInformation load(final LoaderCallback loadManager) throws Exce } /** - * @param loadManager - * @param changeData * @param replicationSync {@code true} will place - * @return - * @throws Exception */ private synchronized JournalLoadInformation load(final LoaderCallback loadManager, final boolean changeData, @@ -2377,7 +2372,9 @@ public void processBackupCleanup() { } } - /** With the exception of initialization, this has to be always called within the compactorExecutor */ + /** + * With the exception of initialization, this has to be always called within the compactorExecutor + */ @Override public void processBackup() { if (this.journalRetentionFolder == null) { @@ -2638,7 +2635,7 @@ public final boolean isAutoReclaim() { return autoReclaim; } - /* Only meant to be used in tests. */ + // Only meant to be used in tests. @Override public String debug() throws Exception { scan(getDataFiles()); @@ -2678,8 +2675,8 @@ public String debug() throws Exception { } /** - * Method for use on testcases. - * It will call waitComplete on every transaction, so any assertions on the file system will be correct after this + * Method for use on testcases. It will call waitComplete on every transaction, so any assertions on the file system + * will be correct after this */ @Override public void debugWait() throws InterruptedException { @@ -2703,8 +2700,6 @@ public void flush() throws Exception { /** * The max size record that can be stored in the journal - * - * @return */ @Override public long getMaxRecordSize() { @@ -2984,30 +2979,28 @@ protected void renameFiles(final List oldFiles, final List * Checks for holes on the transaction (a commit written but with an incomplete transaction). - *
            - * This method will validate if the transaction (PREPARE/COMMIT) is complete as stated on the - * COMMIT-RECORD. - *
            + *

            + * This method will validate if the transaction (PREPARE/COMMIT) is complete as stated on the COMMIT-RECORD. + *

            * For details see {@link JournalCompleteRecordTX} about how the transaction-summary is recorded. - * - * @param journalTransaction - * @param orderedFiles - * @param numberOfRecords - * @return */ private boolean checkTransactionHealth(final JournalFile currentFile, final JournalTransaction journalTransaction, @@ -3073,11 +3059,6 @@ private static int getRecordSize(final byte recordType, final int journalVersion } } - /** - * @param file - * @return - * @throws Exception - */ public JournalFileImpl readFileHeader(final SequentialFile file) throws Exception { ByteBuffer bb = fileFactory.newBuffer(JournalImpl.SIZE_HEADER); @@ -3114,11 +3095,6 @@ public JournalFileImpl readFileHeader(final SequentialFile file) throws Exceptio return new JournalFileImpl(file, fileID, journalVersion); } - /** - * @param fileID - * @param sequentialFile - * @throws Exception - */ public static int initFileHeader(final SequentialFileFactory fileFactory, final SequentialFile sequentialFile, final int userVersion, @@ -3145,11 +3121,6 @@ public static int initFileHeader(final SequentialFileFactory fileFactory, } } - /** - * @param buffer - * @param userVersion - * @param fileID - */ public static void writeHeader(final ActiveMQBuffer buffer, final int userVersion, final long fileID) { buffer.writeInt(JournalImpl.FORMAT_VERSION); @@ -3159,9 +3130,8 @@ public static void writeHeader(final ActiveMQBuffer buffer, final int userVersio } /** - * @param completeTransaction If the appendRecord is for a prepare or commit, where we should - * update the number of pendingTransactions on the current file - * @throws Exception + * @param completeTransaction If the appendRecord is for a prepare or commit, where we should update the number of + * pendingTransactions on the current file */ private JournalFile appendRecord(final JournalInternalRecord encoder, final boolean completeTransaction, @@ -3264,9 +3234,6 @@ private JournalTransaction getTransactionInfo(final long txID) { } } - /** - * @throws Exception - */ private void checkControlFile(AtomicReference wholeFileBufferRef) throws Exception { List dataFiles = new ArrayList<>(); List newFiles = new ArrayList<>(); @@ -3311,9 +3278,6 @@ private void checkControlFile(AtomicReference wholeFileBufferRef) th return; } - /** - * @throws Exception - */ private void cleanupTmpFiles(final String extension) throws Exception { List leftFiles = fileFactory.listFiles(getFileExtension() + extension); @@ -3378,13 +3342,8 @@ public final void synchronizationUnlock() { } /** - * Returns Map with a {@link JournalFile} for all existing files. - * - * These are the files needed to be sent to a backup in order to synchronize it. - * - * @param fileIds - * @return map with the IDs and corresponding {@link JournalFile}s - * @throws Exception + * {@return map with the IDs and corresponding {@link JournalFile}s; these are the files needed to be sent to a + * backup in order to synchronize it} */ @Override public synchronized Map createFilesForBackupSync(long[] fileIds) throws Exception { @@ -3408,11 +3367,6 @@ public SequentialFileFactory getFileFactory() { return fileFactory; } - /** - * @param lastDataPos - * @return - * @throws Exception - */ protected JournalFile setUpCurrentFile(int lastDataPos) throws Exception { // Create any more files we need @@ -3436,11 +3390,6 @@ protected JournalFile setUpCurrentFile(int lastDataPos) throws Exception { return currentFile; } - /** - * @param size - * @return - * @throws Exception - */ protected JournalFile switchFileIfNecessary(int size) throws Exception { // We take into account the fileID used on the Header diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalReaderCallback.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalReaderCallback.java index c52c9ee3f36..bcde1e90c95 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalReaderCallback.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalReaderCallback.java @@ -29,62 +29,29 @@ default void done() { default void onReadAddRecord(RecordInfo info) throws Exception { } - /** - * @param recordInfo - * @throws Exception - */ default void onReadUpdateRecord(RecordInfo recordInfo) throws Exception { } - /** - * @param recordID - */ default void onReadDeleteRecord(long recordID) throws Exception { } - /** - * @param transactionID - * @param recordInfo - * @throws Exception - */ default void onReadAddRecordTX(long transactionID, RecordInfo recordInfo) throws Exception { } - /** - * @param transactionID - * @param recordInfo - * @throws Exception - */ default void onReadUpdateRecordTX(long transactionID, RecordInfo recordInfo) throws Exception { } - /** - * @param transactionID - * @param recordInfo - */ default void onReadDeleteRecordTX(long transactionID, RecordInfo recordInfo) throws Exception { } - /** - * @param transactionID - * @param extraData - * @param numberOfRecords - */ default void onReadPrepareRecord(long transactionID, byte[] extraData, int numberOfRecords) throws Exception { } - /** - * @param transactionID - * @param numberOfRecords - */ default void onReadCommitRecord(long transactionID, int numberOfRecords) throws Exception { } - /** - * @param transactionID - */ default void onReadRollbackRecord(long transactionID) throws Exception { } diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecord.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecord.java index 7a2722e4ad6..5a95945c27b 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecord.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecord.java @@ -19,9 +19,9 @@ import static org.apache.activemq.artemis.utils.Preconditions.checkNotNull; /** - * This holds the relationship a record has with other files in regard to reference counting. - * Note: This class used to be called PosFiles - * + * This holds the relationship a record has with other files in regard to reference counting. Note: This class used to + * be called PosFiles + *

            * Used on the ref-count for reclaiming */ public class JournalRecord { diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecordProvider.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecordProvider.java index c9c92f44071..e58f1219527 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecordProvider.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalRecordProvider.java @@ -20,9 +20,10 @@ /** * This is an interface used only internally. - * - * During a TX.commit, the JournalTransaction needs to get a valid list of records from either the JournalImpl or JournalCompactor. - * + *

            + * During a TX.commit, the JournalTransaction needs to get a valid list of records from either the JournalImpl or + * JournalCompactor. + *

            * when a commit is read, the JournalTransaction will inquire the JournalCompactor about the existent records */ public interface JournalRecordProvider { 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 b7bd3bbc836..08409d44802 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 @@ -74,9 +74,6 @@ public void replaceRecordProvider(final JournalRecordProvider provider) { journal = provider; } - /** - * @return the id - */ public long getId() { return id; } @@ -149,9 +146,6 @@ public void merge(final JournalTransaction other) { compacting = false; } - /** - * - */ public void clear() { // / Compacting is recreating all the previous files and everything // / so we just clear the list of previous files, previous pos and previous adds @@ -175,10 +169,6 @@ public void clear() { } - /** - * @param currentFile - * @param data - */ public void fillNumberOfRecords(final JournalFile currentFile, final JournalInternalRecord data) { data.setNumberOfRecords(getCounter(currentFile)); } @@ -214,7 +204,8 @@ public void addNegative(final JournalFile file, final long id) { } /** - * The caller of this method needs to guarantee appendLock.lock at the journal. (unless this is being called from load what is a single thread process). + * The caller of this method needs to guarantee appendLock.lock at the journal. (unless this is being called from + * load what is a single thread process). */ public void commit(final JournalFile file) { JournalCompactor compactor = journal.getCompactor(); @@ -277,8 +268,8 @@ public void commit(final JournalFile file) { } /** - * The caller of this method needs to guarantee appendLock.lock before calling this method if being used outside of the lock context. - * or else potFilesMap could be affected + * The caller of this method needs to guarantee appendLock.lock before calling this method if being used outside of + * the lock context. or else potFilesMap could be affected */ public void rollback(final JournalFile file) { JournalCompactor compactor = journal.getCompactor(); @@ -303,8 +294,8 @@ public void rollback(final JournalFile file) { } /** - * The caller of this method needs to guarantee appendLock.lock before calling this method if being used outside of the lock context. - * or else potFilesMap could be affected + * The caller of this method needs to guarantee appendLock.lock before calling this method if being used outside of + * the lock context. or else potFilesMap could be affected */ public void prepare(final JournalFile file) { // We don't want the prepare record getting deleted before time @@ -355,11 +346,6 @@ private static class JournalUpdate { final boolean replaceableUpdate; - /** - * @param file - * @param id - * @param size - */ private JournalUpdate(final JournalFile file, final long id, final int size, final boolean replaceableUpdate) { super(); this.file = file; @@ -368,15 +354,11 @@ private JournalUpdate(final JournalFile file, final long id, final int size, fin this.replaceableUpdate = replaceableUpdate; } - /** - * @return the id - */ public long getId() { return id; } } - public void countUp() { upUpdater.incrementAndGet(this); } @@ -403,33 +385,19 @@ public void onError(final int errorCode, final String errorMessage) { } } - /** - * @return the delegateCompletion - */ public IOCallback getDelegateCompletion() { return delegateCompletion; } - /** - * @param delegateCompletion the delegateCompletion to set - */ public void setDelegateCompletion(final IOCallback delegateCompletion) { this.delegateCompletion = delegateCompletion; } - /** - * @return the errorMessage - */ public String getErrorMessage() { return errorMessage; } - /** - * @return the errorCode - */ public int getErrorCode() { return errorCode; } - - } diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/ObjIntIntArrayList.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/ObjIntIntArrayList.java index 289b2be22c1..3c2dd237d6d 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/ObjIntIntArrayList.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/ObjIntIntArrayList.java @@ -20,9 +20,10 @@ import java.util.Objects; /** - * Ordered collection of (T, int, int) tuples with positive integers and not null T.
            - * This isn't supposed to be a generic collection, but with some effort can became one and - * could be moved into commons utils. + * Ordered collection of (T, int, int) tuples with positive integers and not null T. + *

            + * This isn't supposed to be a generic collection, but with some effort can became one and could be moved into commons + * utils. */ final class ObjIntIntArrayList { 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 bb3df9ecc8a..a6d5f86baa6 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 @@ -21,18 +21,16 @@ import org.slf4j.Logger; /** - *

            The journal consists of an ordered list of journal files Fn where {@code 0 <= n <= N}

            - * - *

            A journal file can contain either positives (pos) or negatives (neg)

            - * - *

            (Positives correspond either to adds or updates, and negatives correspond to deletes).

            - * - *

            A file Fn can be deleted if, and only if the following criteria are satisfied

            - * - *

            1) All pos in a file Fn, must have corresponding neg in any file Fm where {@code m >= n}.

            - * - *

            2) All pos that correspond to any neg in file Fn, must all live in any file Fm where {@code 0 <= m <= n} - * which are also marked for deletion in the same pass of the algorithm.

            + * The journal consists of an ordered list of journal files Fn where {@code 0 <= n <= N}. A journal file can contain + * either positives (pos) or negatives (neg) (Positives correspond either to adds or updates, and negatives correspond + * to deletes). + *

            + * A file Fn can be deleted if and only if the following criteria are satisfied: + *

              + *
            1. All pos in a file Fn must have corresponding neg in any file Fm where {@code m >= n}. * + *
            2. All pos that correspond to any neg in file Fn, must all live in any file Fm where {@code 0 <= m <= n} which are + * also marked for deletion in the same pass of the algorithm. + *
            */ public final class Reclaimer { diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecord.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecord.java index 8067da6e3ea..5ecfc949dae 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecord.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecord.java @@ -32,11 +32,6 @@ public class JournalAddRecord extends JournalInternalRecord { protected final byte journalType; - /** - * @param id - * @param recordType - * @param record - */ public JournalAddRecord(final byte journalType, final long id, final byte recordType, final Persister persister, Object record) { this.id = id; @@ -49,11 +44,6 @@ public JournalAddRecord(final byte journalType, final long id, final byte record this.persister = persister; } - /** - * @param id - * @param recordType - * @param record - */ public JournalAddRecord(final boolean add, final long id, final byte recordType, final Persister persister, Object record) { this(add ? JournalImpl.ADD_RECORD : JournalImpl.UPDATE_RECORD, id, recordType, persister, record); } diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecordTX.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecordTX.java index eff5fbf3463..ef60eb18623 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecordTX.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalAddRecordTX.java @@ -34,11 +34,6 @@ public class JournalAddRecordTX extends JournalInternalRecord { private final boolean add; - /** - * @param id - * @param recordType - * @param record - */ public JournalAddRecordTX(final boolean add, final long txID, final long id, diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalCompleteRecordTX.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalCompleteRecordTX.java index ff106d4c090..b213e0eceec 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalCompleteRecordTX.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalCompleteRecordTX.java @@ -21,16 +21,13 @@ import org.apache.activemq.artemis.core.journal.impl.JournalImpl; /** + * A transaction record (Commit or Prepare), will hold the number of elements the transaction has in the current file. *

            - * A transaction record (Commit or Prepare), will hold the number of elements the transaction has in - * the current file. + * While loading the {@link org.apache.activemq.artemis.core.journal.impl.JournalFile}, the number of operations found + * is matched against this number. If for any reason there are missing operations, the transaction will be ignored. *

            - * While loading the {@link org.apache.activemq.artemis.core.journal.impl.JournalFile}, the number of operations found is matched against this - * number. If for any reason there are missing operations, the transaction will be ignored. - *

            - * We can't just use a global counter as reclaiming could delete files after the transaction was - * successfully committed. That also means not having a whole file on journal-reload doesn't mean we - * have to invalidate the transaction + * We can't just use a global counter as reclaiming could delete files after the transaction was successfully committed. + * That also means not having a whole file on journal-reload doesn't mean we have to invalidate the transaction *

            * The commit operation itself is not included in this total. */ diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalDeleteRecord.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalDeleteRecord.java index 779eb78afbe..1e6a9e865bc 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalDeleteRecord.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalDeleteRecord.java @@ -23,9 +23,6 @@ public class JournalDeleteRecord extends JournalInternalRecord { private final long id; - /** - * @param id - */ public JournalDeleteRecord(final long id) { this.id = id; } diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalDeleteRecordTX.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalDeleteRecordTX.java index 32dfc364722..c76e0df5f43 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalDeleteRecordTX.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/dataformat/JournalDeleteRecordTX.java @@ -28,11 +28,6 @@ public class JournalDeleteRecordTX extends JournalInternalRecord { private final EncodingSupport record; - /** - * @param txID - * @param id - * @param record - */ public JournalDeleteRecordTX(final long txID, final long id, final EncodingSupport record) { this.id = id; diff --git a/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java b/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java index b1b46bd4ac2..1ecafa76243 100644 --- a/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java +++ b/artemis-journal/src/test/java/org/apache/activemq/artemis/core/io/aio/FileIOUtilTest.java @@ -38,10 +38,10 @@ public class FileIOUtilTest { @TempDir(factory = TargetTempDirFactory.class) public File temporaryFolder; - /** Since the introduction of asynchronous close on AsyncIO journal - there was a situation that if you open a file while it was pending to close - you could have many issues with file not open, NPEs - this is to capture and fix that race + /** + * Since the introduction of asynchronous close on AsyncIO journal there was a situation that if you open a file + * while it was pending to close you could have many issues with file not open, NPEs this is to capture and fix that + * race */ @Test public void testOpenClose() throws Exception { diff --git a/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java b/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java index b6f310895c4..0d95b635889 100644 --- a/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java +++ b/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerResource.java @@ -24,25 +24,22 @@ import org.junit.rules.ExternalResource; /** - * A JUnit Rule that embeds an ActiveMQ Artemis ClientConsumer into a test. This JUnit Rule is - * designed to simplify using ActiveMQ Artemis clients in unit tests. Adding the rule to a test will - * startup a ClientConsumer, which can then be used to consume messages from an ActiveMQ Artemis - * server. + * A JUnit Rule that embeds an ActiveMQ Artemis ClientConsumer into a test. This JUnit Rule is designed to simplify + * using ActiveMQ Artemis clients in unit tests. Adding the rule to a test will startup a ClientConsumer, which can then + * be used to consume messages from an ActiveMQ Artemis server. * - *

            - * 
            + * 
            {@code
              * public class SimpleTest {
            - *     @Rule
            + *     @Rule
              *     public ActiveMQConsumerResource client = new ActiveMQProducerResource( "vm://0", "test.queue" );
              *
            - *     @Test
            + *     @Test
              *     public void testSomething() throws Exception {
              *         // Use the embedded client here
              *         ClientMessage message = client.receiveMessage();
              *     }
              * }
            - * 
            - * 
            + * }
            */ public class ActiveMQConsumerResource extends ExternalResource implements ActiveMQConsumerOperations { diff --git a/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java b/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java index 42338930b96..720418d46fc 100644 --- a/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java +++ b/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerResource.java @@ -24,25 +24,22 @@ import org.junit.rules.ExternalResource; /** - * A JUnit Rule that embeds an dynamic (i.e. unbound) ActiveMQ Artemis ClientProducer into a test. - * This JUnit Rule is designed to simplify using ActiveMQ Artemis clients in unit tests. Adding the - * rule to a test will startup an unbound ClientProducer, which can then be used to feed messages to - * any address on the ActiveMQ Artemis server. + * A JUnit Rule that embeds an dynamic (i.e. unbound) ActiveMQ Artemis ClientProducer into a test. This JUnit Rule is + * designed to simplify using ActiveMQ Artemis clients in unit tests. Adding the rule to a test will startup an unbound + * ClientProducer, which can then be used to feed messages to any address on the ActiveMQ Artemis server. * - *
            - * 
            + * 
            {@code
              * public class SimpleTest {
            - *     @Rule
            + *     @Rule
              *     public ActiveMQDynamicProducerResource producer = new ActiveMQDynamicProducerResource( "vm://0");
              *
            - *     @Test
            + *     @Test
              *     public void testSomething() throws Exception {
              *         // Use the embedded ClientProducer here
              *         producer.sendMessage( "test.address", "String Body" );
              *     }
              * }
            - * 
            - * 
            + * }
            */ public class ActiveMQDynamicProducerResource extends ExternalResource implements ActiveMQDynamicProducerOperations, ActiveMQProducerOperations { diff --git a/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java b/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java index a2665f4d5ad..dbf4d97ed97 100644 --- a/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java +++ b/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerResource.java @@ -31,20 +31,18 @@ * rule to a test will startup a ClientProducer, which can then be used to feed messages to the * bound address on an ActiveMQ Artemis server. * - *
            - * 
            + * 
            {@code
              * public class SimpleTest {
            - *     @Rule
            + *     @Rule
              *     public ActiveMQProducerResource producer = new ActiveMQProducerResource( "vm://0", "test.queue");
              *
            - *     @Test
            + *     @Test
              *     public void testSomething() throws Exception {
              *         // Use the embedded ClientProducer here
              *         producer.sendMessage( "String Body" );
              *     }
              * }
            - * 
            - * 
            + * }
            */ public class ActiveMQProducerResource extends ExternalResource implements ActiveMQProducerOperations { diff --git a/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java b/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java index daac2f27c78..e94bca43d84 100644 --- a/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java +++ b/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java @@ -30,23 +30,21 @@ import org.slf4j.LoggerFactory; /** - * A JUnit Rule that embeds an ActiveMQ Artemis server into a test. This JUnit Rule is designed to - * simplify using embedded servers in unit tests. Adding the rule to a test will startup an embedded - * server, which can then be used by client applications. + * A JUnit Rule that embeds an ActiveMQ Artemis server into a test. This JUnit Rule is designed to simplify using + * embedded servers in unit tests. Adding the rule to a test will startup an embedded server, which can then be used by + * client applications. * - *
            - * 
            + * 
            {@code
              * public class SimpleTest {
            - *     @Rule
            + *     @Rule
              *     public EmbeddedActiveMQResource server = new EmbeddedActiveMQResource();
              *
            - *     @Test
            + *     @Test
              *     public void testSomething() throws Exception {
              *         // Use the embedded server here
              *     }
              * }
            - * 
            - * 
            + * }
            */ public class EmbeddedActiveMQResource extends ExternalResource implements EmbeddedActiveMQOperations { @@ -63,6 +61,7 @@ public EmbeddedActiveMQResource() { /** * Create a default EmbeddedActiveMQResource with the specified serverId + * * @param serverId server id */ public EmbeddedActiveMQResource(int serverId) { @@ -71,6 +70,7 @@ public EmbeddedActiveMQResource(int serverId) { /** * Creates an EmbeddedActiveMQResource using the specified configuration + * * @param configuration ActiveMQServer configuration */ public EmbeddedActiveMQResource(Configuration configuration) { @@ -79,6 +79,7 @@ public EmbeddedActiveMQResource(Configuration configuration) { /** * Creates an EmbeddedActiveMQResource using the specified configuration file + * * @param filename ActiveMQServer configuration file name */ public EmbeddedActiveMQResource(String filename) { @@ -86,6 +87,8 @@ public EmbeddedActiveMQResource(String filename) { } /** + * Add the specified properties to the specified message. + * * @see EmbeddedActiveMQDelegate#addMessageProperties(ClientMessage, Map) */ public static void addMessageProperties(ClientMessage message, Map properties) { diff --git a/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java b/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java index 46a9b4f9708..ddaea2dc9ca 100644 --- a/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java +++ b/artemis-junit/artemis-junit-4/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSResource.java @@ -36,14 +36,12 @@ import org.slf4j.LoggerFactory; /** - * Deprecated in favor of EmbeddedActiveMQResource. Since Artemis 2.0 all JMS specific broker - * management classes, interfaces, and methods have been deprecated in favor of their more general - * counter-parts. A JUnit Rule that embeds an ActiveMQ Artemis JMS server into a test. This JUnit - * Rule is designed to simplify using embedded servers in unit tests. Adding the rule to a test will - * startup an embedded JMS server, which can then be used by client applications. + * Deprecated in favor of EmbeddedActiveMQResource. Since Artemis 2.0 all JMS specific broker management classes, + * interfaces, and methods have been deprecated in favor of their more general counter-parts. A JUnit Rule that embeds + * an ActiveMQ Artemis JMS server into a test. This JUnit Rule is designed to simplify using embedded servers in unit + * tests. Adding the rule to a test will startup an embedded JMS server, which can then be used by client applications. * - *
            - * 
            + * 
            {@code
              * public class SimpleTest {
              *     @Rule
              *     public EmbeddedJMSResource server = new EmbeddedJMSResource();
            @@ -53,8 +51,7 @@
              *         // Use the embedded server here
              *     }
              * }
            - * 
            - * 
            + * }
            */ @Deprecated public class EmbeddedJMSResource extends ExternalResource implements EmbeddedJMSOperations { @@ -86,7 +83,8 @@ public EmbeddedJMSResource(int serverId) { /** * Create an EmbeddedJMSResource with the specified configurations - * @param configuration ActiveMQServer configuration + * + * @param configuration ActiveMQServer configuration * @param jmsConfiguration JMSServerManager configuration */ public EmbeddedJMSResource(Configuration configuration, JMSConfiguration jmsConfiguration) { @@ -95,6 +93,7 @@ public EmbeddedJMSResource(Configuration configuration, JMSConfiguration jmsConf /** * Create an EmbeddedJMSResource with the specified configuration file + * * @param filename configuration file name */ public EmbeddedJMSResource(String filename) { @@ -103,8 +102,9 @@ public EmbeddedJMSResource(String filename) { /** * Create an EmbeddedJMSResource with the specified configuration file + * * @param serverConfigurationFileName ActiveMQServer configuration file name - * @param jmsConfigurationFileName JMSServerManager configuration file name + * @param jmsConfigurationFileName JMSServerManager configuration file name */ public EmbeddedJMSResource(String serverConfigurationFileName, String jmsConfigurationFileName) { this.embeddedJMSDelegate = new EmbeddedJMSDelegate(serverConfigurationFileName, jmsConfigurationFileName); diff --git a/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerExtension.java b/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerExtension.java index 73624123600..6817f7ca3dd 100644 --- a/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerExtension.java +++ b/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerExtension.java @@ -28,21 +28,21 @@ /** * A JUnit Extension that embeds an ActiveMQ Artemis ClientConsumer into a test. *

            - * This JUnit Extension is designed to simplify using ActiveMQ Artemis clients in unit tests. Adding the extension to a test will startup - * a ClientConsumer, which can then be used to consume messages from an ActiveMQ Artemis server. + * This JUnit Extension is designed to simplify using ActiveMQ Artemis clients in unit tests. Adding the extension to a + * test will startup a ClientConsumer, which can then be used to consume messages from an ActiveMQ Artemis server. * - *

            
            + * 
            {@code
              * public class SimpleTest {
            - *     @RegisterExtension
            + *     @RegisterExtension
              *     private ActiveMQConsumerExtension client = new ActiveMQConsumerExtension( "vm://0", "test.queue" );
              *
            - *     @Test
            + *     @Test
              *     public void testSomething() throws Exception {
              *         // Use the embedded client here
              *         ClientMessage message = client.receiveMessage();
              *     }
              * }
            - * 
            + * }
            */ public class ActiveMQConsumerExtension implements BeforeAllCallback, AfterAllCallback, ActiveMQConsumerOperations { diff --git a/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerExtension.java b/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerExtension.java index b02e199a8be..9e173b077ff 100644 --- a/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerExtension.java +++ b/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerExtension.java @@ -28,21 +28,22 @@ /** * A JUnit Extension that embeds an dynamic (i.e. unbound) ActiveMQ Artemis ClientProducer into a test. *

            - * This JUnit Extension is designed to simplify using ActiveMQ Artemis clients in unit tests. Adding the extension to a test will startup - * an unbound ClientProducer, which can then be used to feed messages to any address on the ActiveMQ Artemis server. + * This JUnit Extension is designed to simplify using ActiveMQ Artemis clients in unit tests. Adding the extension to a + * test will startup an unbound ClientProducer, which can then be used to feed messages to any address on the ActiveMQ + * Artemis server. * - *

            
            + * 
            {@code
              * public class SimpleTest {
            - *     @RegisterExtension
            + *     @RegisterExtension
              *     private ActiveMQDynamicProducerExtension producer = new ActiveMQDynamicProducerExtension("vm://0");
              *
            - *     @Test
            + *     @Test
              *     public void testSomething() throws Exception {
              *         // Use the embedded ClientProducer here
              *         producer.sendMessage( "test.address", "String Body" );
              *     }
              * }
            - * 
            + * }
            */ public class ActiveMQDynamicProducerExtension implements BeforeAllCallback, AfterAllCallback, ActiveMQDynamicProducerOperations, ActiveMQProducerOperations { diff --git a/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerExtension.java b/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerExtension.java index 22b8655a818..3d7b023891f 100644 --- a/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerExtension.java +++ b/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerExtension.java @@ -28,21 +28,22 @@ /** * A JUnit Extension that embeds an ActiveMQ Artemis ClientProducer bound to a specific address into a test. *

            - * This JUnit Extension is designed to simplify using ActiveMQ Artemis clients in unit tests. Adding the extension to a test will startup - * a ClientProducer, which can then be used to feed messages to the bound address on an ActiveMQ Artemis server. + * This JUnit Extension is designed to simplify using ActiveMQ Artemis clients in unit tests. Adding the extension to a + * test will startup a ClientProducer, which can then be used to feed messages to the bound address on an ActiveMQ + * Artemis server. * - *

            
            + * 
            {@code
              * public class SimpleTest {
            - *     @RegisterExtension
            + *     @RegisterExtension
              *     private ActiveMQProducerExtension producer = new ActiveMQProducerExtension( "vm://0", "test.queue");
              *
            - *     @Test
            + *     @Test
              *     public void testSomething() throws Exception {
              *         // Use the embedded ClientProducer here
              *         producer.sendMessage( "String Body" );
              *     }
              * }
            - * 
            + * }
            */ public class ActiveMQProducerExtension implements BeforeAllCallback, AfterAllCallback, ActiveMQProducerOperations { diff --git a/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQExtension.java b/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQExtension.java index e201ddc8684..363fe4b0ad2 100644 --- a/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQExtension.java +++ b/artemis-junit/artemis-junit-5/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQExtension.java @@ -37,7 +37,7 @@ * This JUnit Extension is designed to simplify using embedded servers in unit tests. Adding the extension to a test will startup * an embedded server, which can then be used by client applications. * - *
            
            + * 
            {@code
              * public class SimpleTest {
              *     @RegisterExtension
              *     private EmbeddedActiveMQExtension server = new EmbeddedActiveMQExtension();
            @@ -47,7 +47,7 @@
              *         // Use the embedded server here
              *     }
              * }
            - * 
            + * }
            */ public class EmbeddedActiveMQExtension implements BeforeAllCallback, AfterAllCallback, EmbeddedActiveMQOperations { diff --git a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientDelegate.java b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientDelegate.java index 2b44908ecdf..19a3668ad52 100644 --- a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientDelegate.java +++ b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/AbstractActiveMQClientDelegate.java @@ -77,8 +77,6 @@ public AbstractActiveMQClientDelegate(ServerLocator serverLocator) { /** * Adds properties to a ClientMessage - * @param message - * @param properties */ public static void addMessageProperties(ClientMessage message, Map properties) { if (properties != null && !properties.isEmpty()) { diff --git a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerOperations.java b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerOperations.java index 0b82adb7760..688d93a284a 100644 --- a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerOperations.java +++ b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQConsumerOperations.java @@ -23,8 +23,8 @@ public interface ActiveMQConsumerOperations { long getDefaultReceiveTimeout(); /** - * Sets the default timeout in milliseconds used when receiving messages. Defaults to 50 - * milliseconds + * Sets the default timeout in milliseconds used when receiving messages. Defaults to 50 milliseconds + * * @param defaultReceiveTimeout received timeout in milliseconds */ void setDefaultReceiveTimeout(long defaultReceiveTimeout); @@ -32,9 +32,8 @@ public interface ActiveMQConsumerOperations { boolean isAutoCreateQueue(); /** - * Enable/Disable the automatic creation of non-existent queues. The default is to automatically - * create non-existent queues - * @param autoCreateQueue + * Enable/Disable the automatic creation of non-existent queues. The default is to automatically create non-existent + * queues */ void setAutoCreateQueue(boolean autoCreateQueue); diff --git a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerOperations.java b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerOperations.java index f9b46d4b2f7..e62f6157cc9 100644 --- a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerOperations.java +++ b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQDynamicProducerOperations.java @@ -25,54 +25,60 @@ public interface ActiveMQDynamicProducerOperations { /** * Send a ClientMessage to the default address on the server + * * @param message the message to send */ void sendMessage(ClientMessage message); /** * Send a ClientMessage to the specified address on the server + * * @param targetAddress the target address - * @param message the message to send + * @param message the message to send */ void sendMessage(SimpleString targetAddress, ClientMessage message); /** - * Create a new ClientMessage with the specified body and send to the specified address on the - * server + * Create a new ClientMessage with the specified body and send to the specified address on the server + * * @param targetAddress the target address - * @param body the body for the new message + * @param body the body for the new message * @return the message that was sent */ ClientMessage sendMessage(SimpleString targetAddress, byte[] body); /** * Create a new ClientMessage with the specified body and send to the server + * * @param targetAddress the target address - * @param body the body for the new message + * @param body the body for the new message * @return the message that was sent */ ClientMessage sendMessage(SimpleString targetAddress, String body); /** * Create a new ClientMessage with the specified properties and send to the server + * * @param targetAddress the target address - * @param properties the properties for the new message + * @param properties the properties for the new message * @return the message that was sent */ ClientMessage sendMessage(SimpleString targetAddress, Map properties); /** * Create a new ClientMessage with the specified body and and properties and send to the server + * * @param targetAddress the target address - * @param properties the properties for the new message + * @param properties the properties for the new message * @return the message that was sent */ ClientMessage sendMessage(SimpleString targetAddress, byte[] body, Map properties); /** * Create a new ClientMessage with the specified body and and properties and send to the server + * * @param targetAddress the target address - * @param properties the properties for the new message + * @param properties the properties for the new message * @return the message that was sent */ ClientMessage sendMessage(SimpleString targetAddress, String body, Map properties); diff --git a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerOperations.java b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerOperations.java index 2ec01a32733..a0e08a8cfb0 100644 --- a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerOperations.java +++ b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/ActiveMQProducerOperations.java @@ -26,15 +26,16 @@ public interface ActiveMQProducerOperations { /** * Disables/Enables creating durable messages. By default, durable messages are created. - * @param useDurableMessage if true, durable messages will be created + * + * @param useDurableMessage if {@code true}, durable messages will be created */ void setUseDurableMessage(boolean useDurableMessage); /** * Create a ClientMessage. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * * @return a new ClientMessage */ ClientMessage createMessage(); @@ -42,8 +43,8 @@ public interface ActiveMQProducerOperations { /** * Create a ClientMessage with the specified body. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * * @param body the body for the new message * @return a new ClientMessage with the specified body */ @@ -52,8 +53,8 @@ public interface ActiveMQProducerOperations { /** * Create a ClientMessage with the specified body. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * * @param body the body for the new message * @return a new ClientMessage with the specified body */ @@ -62,8 +63,8 @@ public interface ActiveMQProducerOperations { /** * Create a ClientMessage with the specified message properties. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * * @param properties message properties for the new message * @return a new ClientMessage with the specified message properties */ @@ -72,9 +73,9 @@ public interface ActiveMQProducerOperations { /** * Create a ClientMessage with the specified body and message properties. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. - * @param body the body for the new message + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * + * @param body the body for the new message * @param properties message properties for the new message * @return a new ClientMessage with the specified body and message properties */ @@ -83,9 +84,9 @@ public interface ActiveMQProducerOperations { /** * Create a ClientMessage with the specified body and message properties. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. - * @param body the body for the new message + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * + * @param body the body for the new message * @param properties message properties for the new message * @return a new ClientMessage with the specified body and message properties */ @@ -93,12 +94,14 @@ public interface ActiveMQProducerOperations { /** * Send a ClientMessage to the server. + * * @param message the message to send */ void sendMessage(ClientMessage message); /** * Create a new ClientMessage with the specified body and send to the server. + * * @param body the body for the new message * @return the message that was sent */ @@ -106,6 +109,7 @@ public interface ActiveMQProducerOperations { /** * Create a new ClientMessage with the specified body and send to the server. + * * @param body the body for the new message * @return the message that was sent */ @@ -113,6 +117,7 @@ public interface ActiveMQProducerOperations { /** * Create a new ClientMessage with the specified properties and send to the server + * * @param properties the properties for the new message * @return the message that was sent */ @@ -120,6 +125,7 @@ public interface ActiveMQProducerOperations { /** * Create a new ClientMessage with the specified body and and properties and send to the server + * * @param properties the properties for the new message * @return the message that was sent */ @@ -127,6 +133,7 @@ public interface ActiveMQProducerOperations { /** * Create a new ClientMessage with the specified body and and properties and send to the server + * * @param properties the properties for the new message * @return the message that was sent */ diff --git a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQDelegate.java b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQDelegate.java index 2c291c770aa..f1e469a8490 100644 --- a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQDelegate.java +++ b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQDelegate.java @@ -82,6 +82,7 @@ protected EmbeddedActiveMQDelegate() { /** * Create a default EmbeddedActiveMQResource with the specified serverId + * * @param serverId server id */ protected EmbeddedActiveMQDelegate(int serverId) { @@ -98,6 +99,7 @@ protected EmbeddedActiveMQDelegate(int serverId) { /** * Creates an EmbeddedActiveMQResource using the specified configuration + * * @param configuration ActiveMQServer configuration */ protected EmbeddedActiveMQDelegate(Configuration configuration) { @@ -107,6 +109,7 @@ protected EmbeddedActiveMQDelegate(Configuration configuration) { /** * Creates an EmbeddedActiveMQResource using the specified configuration file + * * @param filename ActiveMQServer configuration file name */ protected EmbeddedActiveMQDelegate(String filename) { @@ -128,8 +131,6 @@ protected EmbeddedActiveMQDelegate(String filename) { /** * Adds properties to a ClientMessage - * @param message - * @param properties */ public static void addMessageProperties(ClientMessage message, Map properties) { if (properties != null && !properties.isEmpty()) { diff --git a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQOperations.java b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQOperations.java index 82ca3d36f52..732aa0c6986 100644 --- a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQOperations.java +++ b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQOperations.java @@ -27,16 +27,14 @@ public interface EmbeddedActiveMQOperations { /** - * Start the embedded ActiveMQ Artemis server. The server will normally be started by JUnit using - * the before() method. This method allows the server to be started manually to support advanced - * testing scenarios. + * Start the embedded ActiveMQ Artemis server. The server will normally be started by JUnit using the before() + * method. This method allows the server to be started manually to support advanced testing scenarios. */ void start(); /** - * Stop the embedded ActiveMQ Artemis server The server will normally be stopped by JUnit using - * the after() method. This method allows the server to be stopped manually to support advanced - * testing scenarios. + * Stop the embedded ActiveMQ Artemis server The server will normally be stopped by JUnit using the after() method. + * This method allows the server to be stopped manually to support advanced testing scenarios. */ void stop(); @@ -44,6 +42,7 @@ public interface EmbeddedActiveMQOperations { /** * Disables/Enables creating durable messages. By default, durable messages are created + * * @param useDurableMessage if true, durable messages will be created */ void setUseDurableMessage(boolean useDurableMessage); @@ -52,6 +51,7 @@ public interface EmbeddedActiveMQOperations { /** * Disables/Enables creating durable queues. By default, durable queues are created + * * @param useDurableQueue if true, durable messages will be created */ void setUseDurableQueue(boolean useDurableQueue); @@ -59,33 +59,36 @@ public interface EmbeddedActiveMQOperations { long getDefaultReceiveTimeout(); /** - * Sets the default timeout in milliseconds used when receiving messages. Defaults to 50 - * milliseconds + * Sets the default timeout in milliseconds used when receiving messages. Defaults to 50 milliseconds + * * @param defaultReceiveTimeout received timeout in milliseconds */ void setDefaultReceiveTimeout(long defaultReceiveTimeout); /** - * Get the EmbeddedActiveMQ server. This may be required for advanced configuration of the - * EmbeddedActiveMQ server. + * Get the EmbeddedActiveMQ server. This may be required for advanced configuration of the EmbeddedActiveMQ server. + * * @return the embedded ActiveMQ broker */ EmbeddedActiveMQ getServer(); /** * Get the name of the EmbeddedActiveMQ server + * * @return name of the embedded server */ String getServerName(); /** * Get the VM URL for the embedded EmbeddedActiveMQ server + * * @return the VM URL for the embedded server */ String getVmURL(); /** * Get the number of messages in a specific queue. + * * @param queueName the name of the queue * @return the number of messages in the queue; -1 if queue is not found */ @@ -93,6 +96,7 @@ public interface EmbeddedActiveMQOperations { /** * Get the number of messages in a specific queue. + * * @param queueName the name of the queue * @return the number of messages in the queue; -1 if queue is not found */ @@ -121,8 +125,8 @@ public interface EmbeddedActiveMQOperations { /** * Create a ClientMessage. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * * @return a new ClientMessage */ ClientMessage createMessage(); @@ -130,8 +134,8 @@ public interface EmbeddedActiveMQOperations { /** * Create a ClientMessage with the specified body. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * * @param body the body for the new message * @return a new ClientMessage with the specified body */ @@ -140,8 +144,8 @@ public interface EmbeddedActiveMQOperations { /** * Create a ClientMessage with the specified body. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * * @param body the body for the new message * @return a new ClientMessage with the specified body */ @@ -150,8 +154,8 @@ public interface EmbeddedActiveMQOperations { /** * Create a ClientMessage with the specified message properties. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * * @param properties message properties for the new message * @return a new ClientMessage with the specified message properties */ @@ -160,9 +164,9 @@ public interface EmbeddedActiveMQOperations { /** * Create a ClientMessage with the specified body and message properties. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. - * @param body the body for the new message + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * + * @param body the body for the new message * @param properties message properties for the new message * @return a new ClientMessage with the specified body and message properties */ @@ -171,9 +175,9 @@ public interface EmbeddedActiveMQOperations { /** * Create a ClientMessage with the specified body and message properties. *

            - * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message - * is created. - * @param body the body for the new message + * If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created. + * + * @param body the body for the new message * @param properties message properties for the new message * @return a new ClientMessage with the specified body and message properties */ @@ -181,6 +185,7 @@ public interface EmbeddedActiveMQOperations { /** * Send a message to an address + * * @param address the target queueName for the message * @param message the message to send */ @@ -188,43 +193,46 @@ public interface EmbeddedActiveMQOperations { /** * Create a new message with the specified body, and send the message to an address + * * @param address the target queueName for the message - * @param body the body for the new message + * @param body the body for the new message * @return the message that was sent */ ClientMessage sendMessage(String address, byte[] body); /** * Create a new message with the specified body, and send the message to an address + * * @param address the target queueName for the message - * @param body the body for the new message + * @param body the body for the new message * @return the message that was sent */ ClientMessage sendMessage(String address, String body); /** * Create a new message with the specified properties, and send the message to an address - * @param address the target queueName for the message + * + * @param address the target queueName for the message * @param properties message properties for the new message * @return the message that was sent */ ClientMessage sendMessageWithProperties(String address, Map properties); /** - * Create a new message with the specified body and properties, and send the message to an - * address - * @param address the target queueName for the message - * @param body the body for the new message + * Create a new message with the specified body and properties, and send the message to an address + * + * @param address the target queueName for the message + * @param body the body for the new message * @param properties message properties for the new message * @return the message that was sent */ ClientMessage sendMessageWithProperties(String address, byte[] body, Map properties); /** - * Create a new message with the specified body and properties, and send the message to an - * address - * @param address the target queueName for the message - * @param body the body for the new message + * Create a new message with the specified body and properties, and send the message to an address + * + * @param address the target queueName for the message + * @param body the body for the new message * @param properties message properties for the new message * @return the message that was sent */ @@ -232,6 +240,7 @@ public interface EmbeddedActiveMQOperations { /** * Send a message to an queueName + * * @param address the target queueName for the message * @param message the message to send */ @@ -239,43 +248,46 @@ public interface EmbeddedActiveMQOperations { /** * Create a new message with the specified body, and send the message to an queueName + * * @param address the target queueName for the message - * @param body the body for the new message + * @param body the body for the new message * @return the message that was sent */ ClientMessage sendMessage(SimpleString address, byte[] body); /** * Create a new message with the specified body, and send the message to an queueName + * * @param address the target queueName for the message - * @param body the body for the new message + * @param body the body for the new message * @return the message that was sent */ ClientMessage sendMessage(SimpleString address, String body); /** * Create a new message with the specified properties, and send the message to an queueName - * @param address the target queueName for the message + * + * @param address the target queueName for the message * @param properties message properties for the new message * @return the message that was sent */ ClientMessage sendMessageWithProperties(SimpleString address, Map properties); /** - * Create a new message with the specified body and properties, and send the message to an - * queueName - * @param address the target queueName for the message - * @param body the body for the new message + * Create a new message with the specified body and properties, and send the message to an queueName + * + * @param address the target queueName for the message + * @param body the body for the new message * @param properties message properties for the new message * @return the message that was sent */ ClientMessage sendMessageWithProperties(SimpleString address, byte[] body, Map properties); /** - * Create a new message with the specified body and properties, and send the message to an - * queueName - * @param address the target queueName for the message - * @param body the body for the new message + * Create a new message with the specified body and properties, and send the message to an queueName + * + * @param address the target queueName for the message + * @param body the body for the new message * @param properties message properties for the new message * @return the message that was sent */ @@ -283,6 +295,7 @@ public interface EmbeddedActiveMQOperations { /** * Receive a message from the specified queue using the default receive timeout + * * @param queueName name of the source queue * @return the received ClientMessage, null if the receive timed-out */ @@ -290,14 +303,16 @@ public interface EmbeddedActiveMQOperations { /** * Receive a message from the specified queue using the specified receive timeout + * * @param queueName name of the source queue - * @param timeout receive timeout in milliseconds + * @param timeout receive timeout in milliseconds * @return the received ClientMessage, null if the receive timed-out */ ClientMessage receiveMessage(String queueName, long timeout); /** * Receive a message from the specified queue using the default receive timeout + * * @param queueName name of the source queue * @return the received ClientMessage, null if the receive timed-out */ @@ -305,42 +320,45 @@ public interface EmbeddedActiveMQOperations { /** * Receive a message from the specified queue using the specified receive timeout + * * @param queueName name of the source queue - * @param timeout receive timeout in milliseconds + * @param timeout receive timeout in milliseconds * @return the received ClientMessage, null if the receive timed-out */ ClientMessage receiveMessage(SimpleString queueName, long timeout); /** - * Browse a message (receive but do not consume) from the specified queue using the default - * receive timeout + * Browse a message (receive but do not consume) from the specified queue using the default receive timeout + * * @param queueName name of the source queue * @return the received ClientMessage, null if the receive timed-out */ ClientMessage browseMessage(String queueName); /** - * Browse a message (receive but do not consume) a message from the specified queue using the - * specified receive timeout + * Browse a message (receive but do not consume) a message from the specified queue using the specified receive + * timeout + * * @param queueName name of the source queue - * @param timeout receive timeout in milliseconds + * @param timeout receive timeout in milliseconds * @return the received ClientMessage, null if the receive timed-out */ ClientMessage browseMessage(String queueName, long timeout); /** - * Browse a message (receive but do not consume) from the specified queue using the default - * receive timeout + * Browse a message (receive but do not consume) from the specified queue using the default receive timeout + * * @param queueName name of the source queue * @return the received ClientMessage, null if the receive timed-out */ ClientMessage browseMessage(SimpleString queueName); /** - * Browse a message (receive but do not consume) a message from the specified queue using the - * specified receive timeout + * Browse a message (receive but do not consume) a message from the specified queue using the specified receive + * timeout + * * @param queueName name of the source queue - * @param timeout receive timeout in milliseconds + * @param timeout receive timeout in milliseconds * @return the received ClientMessage, null if the receive timed-out */ ClientMessage browseMessage(SimpleString queueName, long timeout); diff --git a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSDelegate.java b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSDelegate.java index ffa14a28934..9767da39a6b 100644 --- a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSDelegate.java +++ b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSDelegate.java @@ -57,10 +57,11 @@ import org.slf4j.LoggerFactory; /** - * Deprecated in favor of EmbeddedActiveMQDelegate. Since Artemis 2.0 all JMS specific broker - * management classes, interfaces, and methods have been deprecated in favor of their more general - * counter-parts. + * Deprecated in favor of EmbeddedActiveMQDelegate. Since Artemis 2.0 all JMS specific broker management classes, + * interfaces, and methods have been deprecated in favor of their more general counter-parts. + * * @see EmbeddedActiveMQDelegate + * @deprecated use {@link EmbeddedActiveMQDelegate} instead */ @Deprecated public class EmbeddedJMSDelegate implements EmbeddedJMSOperations { @@ -136,7 +137,8 @@ protected EmbeddedJMSDelegate(int serverId) { /** * Create an EmbeddedJMSResource with the specified configurations - * @param configuration ActiveMQServer configuration + * + * @param configuration ActiveMQServer configuration * @param jmsConfiguration JMSServerManager configuration */ protected EmbeddedJMSDelegate(Configuration configuration, JMSConfiguration jmsConfiguration) { @@ -147,6 +149,7 @@ protected EmbeddedJMSDelegate(Configuration configuration, JMSConfiguration jmsC /** * Create an EmbeddedJMSResource with the specified configuration file + * * @param filename configuration file name */ protected EmbeddedJMSDelegate(String filename) { @@ -155,8 +158,9 @@ protected EmbeddedJMSDelegate(String filename) { /** * Create an EmbeddedJMSResource with the specified configuration file + * * @param serverConfigurationFileName ActiveMQServer configuration file name - * @param jmsConfigurationFileName JMSServerManager configuration file name + * @param jmsConfigurationFileName JMSServerManager configuration file name */ protected EmbeddedJMSDelegate(String serverConfigurationFileName, String jmsConfigurationFileName) { if (serverConfigurationFileName == null) { @@ -216,8 +220,8 @@ private void init() { /** * Start the embedded EmbeddedJMSResource. *

            - * The server will normally be started by JUnit using the before() method. This method allows the - * server to be started manually to support advanced testing scenarios. + * The server will normally be started by JUnit using the before() method. This method allows the server to be + * started manually to support advanced testing scenarios. */ @Override public void start() { @@ -234,8 +238,8 @@ public void start() { /** * Stop the embedded ActiveMQ broker, blocking until the broker has stopped. *

            - * The broker will normally be stopped by JUnit using the after() method. This method allows the - * broker to be stopped manually to support advanced testing scenarios. + * The broker will normally be stopped by JUnit using the after() method. This method allows the broker to be stopped + * manually to support advanced testing scenarios. */ @Override public void stop() { diff --git a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSOperations.java b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSOperations.java index e0e2e0c1f6a..bdd07be50f7 100644 --- a/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSOperations.java +++ b/artemis-junit/artemis-junit-commons/src/main/java/org/apache/activemq/artemis/junit/EmbeddedJMSOperations.java @@ -16,26 +16,26 @@ */ package org.apache.activemq.artemis.junit; -import java.io.Serializable; -import java.util.List; -import java.util.Map; - import javax.jms.BytesMessage; import javax.jms.MapMessage; import javax.jms.Message; import javax.jms.ObjectMessage; import javax.jms.StreamMessage; import javax.jms.TextMessage; +import java.io.Serializable; +import java.util.List; +import java.util.Map; import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS; /** - * Deprecated in favor of EmbeddedActiveMQDelegate. Since Artemis 2.0 all JMS specific broker - * management classes, interfaces, and methods have been deprecated in favor of their more general - * counter-parts. + * Deprecated in favor of EmbeddedActiveMQDelegate. Since Artemis 2.0 all JMS specific broker management classes, + * interfaces, and methods have been deprecated in favor of their more general counter-parts. + * * @param implementing type * @see EmbeddedActiveMQDelegate + * @deprecated use {@link EmbeddedActiveMQDelegate} instead */ @Deprecated public interface EmbeddedJMSOperations { @@ -48,16 +48,16 @@ public interface EmbeddedJMSOperations { /** * Start the embedded EmbeddedJMSResource. *

            - * The server will normally be started by JUnit using the before() method. This method allows the - * server to be started manually to support advanced testing scenarios. + * The server will normally be started by JUnit using the before() method. This method allows the server to be + * started manually to support advanced testing scenarios. */ void start(); /** * Stop the embedded ActiveMQ broker, blocking until the broker has stopped. *

            - * The broker will normally be stopped by JUnit using the after() method. This method allows the - * broker to be stopped manually to support advanced testing scenarios. + * The broker will normally be stopped by JUnit using the after() method. This method allows the broker to be stopped + * manually to support advanced testing scenarios. */ void stop(); @@ -65,18 +65,19 @@ public interface EmbeddedJMSOperations { * Get the EmbeddedJMS server. *

            * This may be required for advanced configuration of the EmbeddedJMS server. - * @return */ EmbeddedJMS getJmsServer(); /** * Get the name of the EmbeddedJMS server + * * @return name of the server */ String getServerName(); /** * Get the VM URL for the embedded EmbeddedActiveMQ server + * * @return the VM URL for the embedded server */ String getVmURL(); @@ -84,9 +85,10 @@ public interface EmbeddedJMSOperations { /** * Get the Queue corresponding to a JMS Destination. *

            - * The full name of the JMS destination including the prefix should be provided - i.e. - * queue://myQueue or topic://myTopic. If the destination type prefix is not included in the - * destination name, a prefix of "queue://" is assumed. + * The full name of the JMS destination including the prefix should be provided - i.e. queue://myQueue or + * topic://myTopic. If the destination type prefix is not included in the destination name, a prefix of "queue://" is + * assumed. + * * @param destinationName the full name of the JMS Destination * @return the number of messages in the JMS Destination */ @@ -95,9 +97,9 @@ public interface EmbeddedJMSOperations { /** * Get the Queues corresponding to a JMS Topic. *

            - * The full name of the JMS Topic including the prefix should be provided - i.e. topic://myTopic. - * If the destination type prefix is not included in the destination name, a prefix of "topic://" - * is assumed. + * The full name of the JMS Topic including the prefix should be provided - i.e. topic://myTopic. If the destination + * type prefix is not included in the destination name, a prefix of "topic://" is assumed. + * * @param topicName the full name of the JMS Destination * @return the number of messages in the JMS Destination */ @@ -106,12 +108,12 @@ public interface EmbeddedJMSOperations { /** * Get the number of messages in a specific JMS Destination. *

            - * The full name of the JMS destination including the prefix should be provided - i.e. - * queue://myQueue or topic://myTopic. If the destination type prefix is not included in the - * destination name, a prefix of "queue://" is assumed. NOTE: For JMS Topics, this returned count - * will be the total number of messages for all subscribers. For example, if there are two - * subscribers on the topic and a single message is published, the returned count will be two - * (one message for each subscriber). + * The full name of the JMS destination including the prefix should be provided - i.e. queue://myQueue or + * topic://myTopic. If the destination type prefix is not included in the destination name, a prefix of "queue://" is + * assumed. NOTE: For JMS Topics, this returned count will be the total number of messages for all subscribers. For + * example, if there are two subscribers on the topic and a single message is published, the returned count will be + * two (one message for each subscriber). + * * @param destinationName the full name of the JMS Destination * @return the number of messages in the JMS Destination */ diff --git a/artemis-lockmanager/artemis-lockmanager-ri/src/main/java/org/apache/activemq/artemis/lockmanager/file/FileBasedLockManager.java b/artemis-lockmanager/artemis-lockmanager-ri/src/main/java/org/apache/activemq/artemis/lockmanager/file/FileBasedLockManager.java index a8092b5b5dd..dcd5b19d887 100644 --- a/artemis-lockmanager/artemis-lockmanager-ri/src/main/java/org/apache/activemq/artemis/lockmanager/file/FileBasedLockManager.java +++ b/artemis-lockmanager/artemis-lockmanager-ri/src/main/java/org/apache/activemq/artemis/lockmanager/file/FileBasedLockManager.java @@ -32,9 +32,8 @@ import org.apache.activemq.artemis.lockmanager.UnavailableStateException; /** - * This is an implementation suitable to be used just on unit tests and it won't attempt - * to manage nor purge existing stale locks files. It's part of the tests life-cycle to properly - * set-up and tear-down the environment. + * This is an implementation suitable to be used just on unit tests and it won't attempt to manage nor purge existing + * stale locks files. It's part of the tests life-cycle to properly set-up and tear-down the environment. */ public class FileBasedLockManager implements DistributedLockManager { diff --git a/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/GetLogger.java b/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/GetLogger.java index 477e0e26fa7..680db9469c1 100644 --- a/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/GetLogger.java +++ b/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/GetLogger.java @@ -21,7 +21,9 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -/** This tells the processor this method should return the Logger used by the instance */ +/** + * This tells the processor this method should return the Logger used by the instance + */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.SOURCE) public @interface GetLogger { diff --git a/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/LogBundle.java b/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/LogBundle.java index 7611c5859c6..9c2df3eafd9 100644 --- a/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/LogBundle.java +++ b/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/LogBundle.java @@ -27,13 +27,14 @@ String projectCode(); - /** If set, every code generated must match this regular expression. - * This is useful to validate ranges. + /** + * If set, every code generated must match this regular expression. This is useful to validate ranges. */ String regexID() default ""; - /** If set, no ID from this list can be used. - * This is useful to ensure we do not re-use IDs which were used and removed in the past. + /** + * If set, no ID from this list can be used. This is useful to ensure we do not re-use IDs which were used and + * removed in the past. */ int[] retiredIDs() default {}; } diff --git a/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/LogMessage.java b/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/LogMessage.java index dca280f1cb6..0f2148642ab 100644 --- a/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/LogMessage.java +++ b/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/LogMessage.java @@ -37,17 +37,15 @@ enum Level { INFO, /** - * @deprecated Typically debug/trace logging will use class-level loggers - * rather than generated loggers with codes. This mostly exists - * for existing historic uses and any unexpected level down-grades. + * @deprecated Typically debug/trace logging will use class-level loggers rather than generated loggers with + * codes. This mostly exists for existing historic uses and any unexpected level down-grades. */ @Deprecated DEBUG, /** - * @deprecated Typically debug/trace logging will use class-level loggers - * rather than generated loggers with codes. This mostly exists - * for existing historic uses and any unexpected level down-grades. + * @deprecated Typically debug/trace logging will use class-level loggers rather than generated loggers with + * codes. This mostly exists for existing historic uses and any unexpected level down-grades. */ @Deprecated TRACE; diff --git a/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/processor/LogAnnotationProcessor.java b/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/processor/LogAnnotationProcessor.java index 3281548078b..eab4e055864 100644 --- a/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/processor/LogAnnotationProcessor.java +++ b/artemis-log-annotation-processor/src/main/java/org/apache/activemq/artemis/logs/annotation/processor/LogAnnotationProcessor.java @@ -65,9 +65,7 @@ public class LogAnnotationProcessor extends AbstractProcessor { DEBUG = debugResult; } - /* - * define environment variable ARTEMIS_LOG_ANNOTATION_PROCESSOR_DEBUG=true in order to see debug output - */ + // define environment variable ARTEMIS_LOG_ANNOTATION_PROCESSOR_DEBUG=true in order to see debug output protected static void debug(String debugMessage) { if (DEBUG) { System.out.println(debugMessage); diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java index 2264cbadac4..80e2a0f6e62 100644 --- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java +++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisCreatePlugin.java @@ -137,7 +137,9 @@ public class ArtemisCreatePlugin extends ArtemisAbstractPlugin { @Parameter private String[] webListWithDeps; - /** Folders with libs to be copied into target */ + /** + * Folders with libs to be copied into target + */ @Parameter() private String[] libFolders; diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisDependencyDocPlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisDependencyDocPlugin.java index c07e0fdd969..1c62d629f9b 100644 --- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisDependencyDocPlugin.java +++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisDependencyDocPlugin.java @@ -35,17 +35,21 @@ import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactResult; -/** The following substitutions are made for each line - * X{group} with the groupID - * X{artifact} with the artifactID - * X{version} with the version - * X{classifier} with the classifier of the component - * X{package} a combination of the maven group:artifact:classifier - * X{url} with the url - * X{file} with the fileName - * X{fileMD} with the fileName on a LINK with MD style - * X{URI} with the URI - * X{detail} with the detail provided in the config */ +/** + * The following substitutions are made for each line + *

              + *
            • {@code X{group}} with the groupID + *
            • {@code X{artifact}} with the artifactID + *
            • {@code X{version}} with the version + *
            • {@code X{classifier}} with the classifier of the component + *
            • {@code X{package}} a combination of the maven group:artifact:classifier + *
            • {@code X{url}} with the url + *
            • {@code X{file}} with the fileName + *
            • {@code X{fileMD}} with the fileName on a LINK with MD style + *
            • {@code X{URI}} with the URI + *
            • {@code X{detail}} with the detail provided in the config + *
            + */ @Mojo(name = "dependency-doc", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true) public class ArtemisDependencyDocPlugin extends ArtemisAbstractPlugin { diff --git a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisDependencyScanPlugin.java b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisDependencyScanPlugin.java index de2c1da4456..d93861188ff 100644 --- a/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisDependencyScanPlugin.java +++ b/artemis-maven-plugin/src/main/java/org/apache/activemq/artemis/maven/ArtemisDependencyScanPlugin.java @@ -53,7 +53,9 @@ public class ArtemisDependencyScanPlugin extends ArtemisAbstractPlugin { @Parameter private String pathSeparator = File.pathSeparator; - /** Where to copy the exploded dependencies. */ + /** + * Where to copy the exploded dependencies. + */ @Parameter private File targetFolder; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPLargeMessage.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPLargeMessage.java index 71f708873b4..c43fe56bc62 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPLargeMessage.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPLargeMessage.java @@ -84,7 +84,7 @@ public Message getMessage() { /** * AMQPLargeMessagePersister will save the buffer here. - * */ + */ private ByteBuf temporaryBuffer; private final LargeBody largeBody; @@ -96,7 +96,9 @@ public Message getMessage() { private StorageManager storageManager; - /** this is used to parse the initial packets from the buffer */ + /** + * this is used to parse the initial packets from the buffer + */ private CompositeReadableBuffer parsingBuffer; private void checkDebug() { @@ -149,9 +151,10 @@ public void releaseEncodedBuffer() { internalReleaseBuffer(1); } - /** {@link #getSavedEncodeBuffer()} will retain two counters from the buffer, one meant for the call, - * and one that must be released only after encoding. - * + /** + * {@link #getSavedEncodeBuffer()} will retain two counters from the buffer, one meant for the call, and one that + * must be released only after encoding. + *

            * This method is meant to be called when the buffer is actually encoded on the journal, meaning both refs are gone. * and the actual buffer can be released. */ @@ -170,7 +173,9 @@ public void checkReference(MessageReference reference) { } } - /** during large message deliver, we need this calculation to place a new delivery annotation */ + /** + * during large message deliver, we need this calculation to place a new delivery annotation + */ public int getPositionAfterDeliveryAnnotations() { return encodedHeaderSize + encodedDeliveryAnnotationsSize; } @@ -185,7 +190,9 @@ private void internalReleaseBuffer(int releases) { } } - /** This is used on test assertions to make sure the buffers are released corrected */ + /** + * This is used on test assertions to make sure the buffers are released corrected + */ public ByteBuf inspectTemporaryBuffer() { return temporaryBuffer; } 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 b6767d1976b..dc46ae80ba1 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 @@ -141,8 +141,8 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache. protected static final int VALUE_NOT_PRESENT = -1; /** - * This has been made public just for testing purposes: it's not stable - * and developers shouldn't rely on this for developing purposes. + * This has been made public just for testing purposes: it's not stable and developers shouldn't rely on this for + * developing purposes. */ public enum MessageDataScanningStatus { NOT_SCANNED(0), RELOAD_PERSISTENCE(1), SCANNED(2); @@ -235,10 +235,8 @@ private static void checkCode(int code) { /** * Creates a new {@link AMQPMessage} instance from binary encoded message data. * - * @param messageFormat - * The Message format tag given the in Transfer that carried this message - * @param extraProperties - * Broker specific extra properties that should be carried with this message + * @param messageFormat The Message format tag given the in Transfer that carried this message + * @param extraProperties Broker specific extra properties that should be carried with this message */ public AMQPMessage(long messageFormat, TypedProperties extraProperties, CoreMessageObjectPools coreMessageObjectPools) { this.messageFormat = messageFormat; @@ -303,9 +301,11 @@ public void setPaged() { isPaged = true; } - /** This will return application properties without attempting to decode it. - * That means, if applicationProperties were never parsed before, this will return null, even if there is application properties. - * This was created as an internal method for testing, as we need to validate if the application properties are not decoded until needed. */ + /** + * This will return application properties without attempting to decode it. That means, if applicationProperties were + * never parsed before, this will return null, even if there is application properties. This was created as an + * internal method for testing, as we need to validate if the application properties are not decoded until needed. + */ protected ApplicationProperties getDecodedApplicationProperties() { return applicationProperties; } @@ -322,8 +322,8 @@ protected MessageAnnotations getDecodedMessageAnnotations() { // must be used to make changes to mutable portions of the message. /** - * Creates and returns a Proton-J MessageImpl wrapper around the message data. Changes to - * the returned Message are not reflected in this message. + * Creates and returns a Proton-J MessageImpl wrapper around the message data. Changes to the returned Message are + * not reflected in this message. * * @return a MessageImpl that wraps the AMQP message data in this {@link AMQPMessage} */ @@ -362,10 +362,8 @@ public Object getObjectPropertyForFilter(SimpleString key) { } /** - * Returns a copy of the message Header if one is present, changes to the returned - * Header instance do not affect the original Message. - * - * @return a copy of the Message Header if one exists or null if none present. + * {@return a copy of this message's {@code Header} if one exists or {@code null} if none present; changes + * to the returned {@code Header} instance do not affect the original message} */ public final Header getHeader() { ensureScanning(); @@ -373,12 +371,16 @@ public final Header getHeader() { } - /** Returns the current already scanned header. */ + /** + * {@return the current, already scanned {@code Header}} + */ final Header getCurrentHeader() { return header; } - /** Return the current already scanned properties.*/ + /** + * {@return the current already scanned {@coce Properties}} + */ final Properties getCurrentProperties() { return properties; } @@ -401,10 +403,8 @@ Object getDeliveryAnnotationProperty(Symbol symbol) { } /** - * Returns a copy of the MessageAnnotations in the message if present or null. Changes to the - * returned DeliveryAnnotations instance do not affect the original Message. - * - * @return a copy of the {@link DeliveryAnnotations} present in the message or null if non present. + * {@return a copy of the {@link DeliveryAnnotations} present in the message or {@code null} if non + * present; changes to the returned DeliveryAnnotations instance do not affect the original message} */ public final DeliveryAnnotations getDeliveryAnnotations() { ensureScanning(); @@ -413,15 +413,15 @@ public final DeliveryAnnotations getDeliveryAnnotations() { /** * Sets the delivery annotations to be included when encoding the message for sending it on the wire. + *

            + * The broker can add additional message annotations as long as the annotations being added follow the rules from the + * spec. If the user adds something that the remote doesn't understand and it is not prefixed with "x-opt" the remote + * can just kill the link. See: + *

            + * http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-annotations * - * The broker can add additional message annotations as long as the annotations being added follow the - * rules from the spec. If the user adds something that the remote doesn't understand and it is not - * prefixed with "x-opt" the remote can just kill the link. See: - * - * http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-annotations - * - * @deprecated use MessageReference.setProtocolData(deliveryAnnotations) * @param deliveryAnnotations delivery annotations used in the sendBuffer() method + * @deprecated use {@link MessageReference#setProtocolData(Class, Object)} */ @Deprecated public final void setDeliveryAnnotationsForSendBuffer(DeliveryAnnotations deliveryAnnotations) { @@ -429,10 +429,8 @@ public final void setDeliveryAnnotationsForSendBuffer(DeliveryAnnotations delive } /** - * Returns a copy of the DeliveryAnnotations in the message if present or null. Changes to the - * returned MessageAnnotations instance do not affect the original Message. - * - * @return a copy of the {@link MessageAnnotations} present in the message or null if non present. + * {@return a copy of the message's {@link MessageAnnotations} or {@code null} if none present; changes to + * the returned {@link MessageAnnotations} instance do not affect the original message} */ public final MessageAnnotations getMessageAnnotations() { ensureScanning(); @@ -440,10 +438,8 @@ public final MessageAnnotations getMessageAnnotations() { } /** - * Returns a copy of the message Properties if one is present, changes to the returned - * Properties instance do not affect the original Message. - * - * @return a copy of the Message Properties if one exists or null if none present. + * {@return a copy of the message's {@link Properties} if one exists or {@code null} if none present; + * changes to the returned {@link Properties} instance do not affect the original message} */ public final Properties getProperties() { ensureScanning(); @@ -451,28 +447,27 @@ public final Properties getProperties() { } /** - * Returns a copy of the {@link ApplicationProperties} present in the message if present or null. - * Changes to the returned MessageAnnotations instance do not affect the original Message. - * - * @return a copy of the {@link ApplicationProperties} present in the message or null if non present. + * {@return a copy of the message's {@link ApplicationProperties} or {@code null} if none present; changes + * to the returned {@link ApplicationProperties} instance do not affect the original message} */ public final ApplicationProperties getApplicationProperties() { ensureScanning(); return scanForMessageSection(applicationPropertiesPosition, ApplicationProperties.class); } - /** This is different from toString, as this will print an expanded version of the buffer - * in Hex and programmers's readable format */ + /** + * This is different from toString, as this will print an expanded version of the buffer in Hex and programmers's + * readable format + */ public final String toDebugString() { return ByteUtil.debugByteArray(getData().array()); } /** - * Retrieves the AMQP Section that composes the body of this message by decoding a - * fresh copy from the encoded message data. Changes to the returned value are not - * reflected in the value encoded in the original message. + * Retrieves the AMQP Section that composes the body of this message by decoding a fresh copy from the encoded + * message data. Changes to the returned value are not reflected in the value encoded in the original message. * - * @return the Section that makes up the body of this message. + * @return the Section that makes up the body of this message */ public final Section getBody() { ensureScanning(); @@ -484,11 +479,10 @@ public final Section getBody() { } /** - * Retrieves the AMQP Footer encoded in the data of this message by decoding a - * fresh copy from the encoded message data. Changes to the returned value are not - * reflected in the value encoded in the original message. + * Retrieves the AMQP Footer encoded in the data of this message by decoding a fresh copy from the encoded message + * data. Changes to the returned value are not reflected in the value encoded in the original message. * - * @return the Footer that was encoded into this AMQP Message. + * @return the Footer that was encoded into this AMQP Message */ public final Footer getFooter() { ensureScanning(); @@ -763,9 +757,8 @@ protected synchronized void scanMessageData(ReadableBuffer data) { // utilities for checking memory usage and encoded size characteristics. /** - * Would be called by the Artemis Core components to encode the message into - * the provided send buffer. Because of how Proton message data handling works - * this method is not currently used by the AMQP protocol head and will not be + * Would be called by the Artemis Core components to encode the message into the provided send buffer. Because of + * how Proton message data handling works this method is not currently used by the AMQP protocol head and will not be * called for out-bound sends. * * @see #getSendBuffer(int, MessageReference) for the actual method used for message sends. @@ -780,15 +773,12 @@ public final void sendBuffer(ByteBuf buffer, int deliveryCount) { /** * Gets a ByteBuf from the Message that contains the encoded bytes to be sent on the wire. *

            - * When possible this method will present the bytes to the caller without copying them into - * a new buffer copy. If copying is needed a new Netty buffer is created and returned. The - * caller should ensure that the reference count on the returned buffer is always decremented - * to avoid a leak in the case of a copied buffer being returned. + * When possible this method will present the bytes to the caller without copying them into a new buffer copy. If + * copying is needed a new Netty buffer is created and returned. The caller should ensure that the reference count on + * the returned buffer is always decremented to avoid a leak in the case of a copied buffer being returned. * - * @param deliveryCount - * The new delivery count for this message. - * - * @return a Netty ByteBuf containing the encoded bytes of this Message instance. + * @param deliveryCount The new delivery count for this message. + * @return a Netty ByteBuf containing the encoded bytes of this Message instance */ public ReadableBuffer getSendBuffer(int deliveryCount, MessageReference reference) { ensureMessageDataScanned(); @@ -810,7 +800,9 @@ public ReadableBuffer getSendBuffer(int deliveryCount, MessageReference referenc } } - /** it will create a copy with the relevant delivery annotation and its copy */ + /** + * it will create a copy with the relevant delivery annotation and its copy + */ protected ReadableBuffer createDeliveryCopy(int deliveryCount, DeliveryAnnotations deliveryAnnotations) { ReadableBuffer duplicate = getData().duplicate(); @@ -1183,12 +1175,12 @@ public final Object getUserID() { } /** - * Before we added AMQP into Artemis the name getUserID was already taken by JMSMessageID. - * We cannot simply change the names now as it would break the API for existing clients. - * + * Before we added AMQP into Artemis the name getUserID was already taken by JMSMessageID. We cannot simply change + * the names now as it would break the API for existing clients. + *

            * This is to return and read the proper AMQP userID. * - * @return the UserID value in the AMQP Properties if one is present. + * @return the UserID value in the AMQP Properties if one is present */ public final Object getAMQPUserID() { ensureMessageDataScanned(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageBrokerAccessor.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageBrokerAccessor.java index 977a5d61298..a04bda3f668 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageBrokerAccessor.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageBrokerAccessor.java @@ -25,16 +25,22 @@ import static org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerSource.ACK_REASON; -/** Warning: do not use this class outside of the broker implementation. - * This is exposing package methods on this package that are not meant to be used on user's application. */ +/** + * Warning: do not use this class outside of the broker implementation. + * This is exposing package methods on this package that are not meant to be used on user's application. + */ public class AMQPMessageBrokerAccessor { - /** Warning: this is a method specific to the broker. Do not use it on user's application. */ + /** + * Warning: this is a method specific to the broker. Do not use it on user's application. + */ public static Object getDeliveryAnnotationProperty(AMQPMessage message, Symbol symbol) { return message.getDeliveryAnnotationProperty(symbol); } - /** Warning: this is a method specific to the broker. Do not use it on user's application. */ + /** + * Warning: this is a method specific to the broker. Do not use it on user's application. + */ public static Object getMessageAnnotationProperty(AMQPMessage message, Symbol symbol) { return message.getMessageAnnotation(symbol); } @@ -44,22 +50,30 @@ public static AckReason getMessageAnnotationAckReason(AMQPMessage message) { return reasonVal == null ? AckReason.NORMAL : AckReason.fromValue(reasonVal.byteValue()); } - /** Warning: this is a method specific to the broker. Do not use it on user's application. */ + /** + * Warning: this is a method specific to the broker. Do not use it on user's application. + */ public static Header getCurrentHeader(AMQPMessage message) { return message.getCurrentHeader(); } - /** Warning: this is a method specific to the broker. Do not use it on user's application. */ + /** + * Warning: this is a method specific to the broker. Do not use it on user's application. + */ public static ApplicationProperties getDecodedApplicationProperties(AMQPMessage message) { return message.getDecodedApplicationProperties(); } - /** Warning: this is a method specific to the broker. Do not use it on user's application. */ + /** + * Warning: this is a method specific to the broker. Do not use it on user's application. + */ public static int getRemainingBodyPosition(AMQPMessage message) { return message.remainingBodyPosition; } - /** Warning: this is a method specific to the broker. Do not use it on user's application. */ + /** + * Warning: this is a method specific to the broker. Do not use it on user's application. + */ public static Properties getCurrentProperties(AMQPMessage message) { return message.getCurrentProperties(); } diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersister.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersister.java index 29fb7036810..bc3d0903326 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersister.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersister.java @@ -51,7 +51,9 @@ public int getEncodeSize(Message record) { SimpleString.sizeofNullableString(record.getAddressSimpleString()) + DataConstants.SIZE_LONG + DataConstants.SIZE_LONG; } - /** Sub classes must add the first short as the protocol-id */ + /** + * Sub classes must add the first short as the protocol-id + */ @Override public void encode(ActiveMQBuffer buffer, Message record) { super.encode(buffer, record); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersisterV2.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersisterV2.java index b0f84d189c9..7d599d12114 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersisterV2.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersisterV2.java @@ -57,7 +57,9 @@ public int getEncodeSize(Message record) { } - /** Sub classes must add the first short as the protocol-id */ + /** + * Sub classes must add the first short as the protocol-id + */ @Override public void encode(ActiveMQBuffer buffer, Message record) { super.encode(buffer, record); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersisterV3.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersisterV3.java index 8be510cbcc7..b3d86d055e8 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersisterV3.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessagePersisterV3.java @@ -54,7 +54,9 @@ public int getEncodeSize(Message record) { } - /** Sub classes must add the first short as the protocol-id */ + /** + * Sub classes must add the first short as the protocol-id + */ @Override public void encode(ActiveMQBuffer buffer, Message record) { super.encode(buffer, record); 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 a7926096925..5db9fb981d3 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 @@ -231,21 +231,15 @@ public void start() { } /** - * Creates a server consume that reads from the given named queue and forwards the read messages to - * the AMQP sender to dispatch to the remote peer. The consumer priority value is extracted from the - * remote link properties that were assigned by the remote receiver. - * - * @param protonSender - * The {@link ProtonServerReceiverContext} that will be attached to the resulting consumer - * @param queue - * The target queue that the consumer reads from. - * @param filter - * The filter assigned to the consumer of the target queue. - * @param browserOnly - * Should the consumer act as a browser on the target queue. - * - * @return a new {@link ServerConsumer} attached to the given queue. + * Creates a server consume that reads from the given named queue and forwards the read messages to the AMQP sender + * to dispatch to the remote peer. The consumer priority value is extracted from the remote link properties that were + * assigned by the remote receiver. * + * @param protonSender The {@link ProtonServerReceiverContext} that will be attached to the resulting consumer + * @param queue The target queue that the consumer reads from. + * @param filter The filter assigned to the consumer of the target queue. + * @param browserOnly Should the consumer act as a browser on the target queue. + * @return a new {@link ServerConsumer} attached to the given queue * @throws Exception if an error occurs while creating the consumer instance. */ public ServerConsumer createSender(ProtonServerSenderContext protonSender, @@ -256,22 +250,15 @@ public ServerConsumer createSender(ProtonServerSenderContext protonSender, } /** - * Creates a server consume that reads from the given named queue and forwards the read messages to - * the AMQP sender to dispatch to the remote peer. - * - * @param protonSender - * The {@link ProtonServerReceiverContext} that will be attached to the resulting consumer - * @param queue - * The target queue that the consumer reads from. - * @param filter - * The filter assigned to the consumer of the target queue. - * @param browserOnly - * Should the consumer act as a browser on the target queue. - * @param priority - * The priority to assign the new consumer (server defaults are used if not set). - * - * @return a new {@link ServerConsumer} attached to the given queue. + * Creates a server consume that reads from the given named queue and forwards the read messages to the AMQP sender + * to dispatch to the remote peer. * + * @param protonSender The {@link ProtonServerReceiverContext} that will be attached to the resulting consumer + * @param queue The target queue that the consumer reads from. + * @param filter The filter assigned to the consumer of the target queue. + * @param browserOnly Should the consumer act as a browser on the target queue. + * @param priority The priority to assign the new consumer (server defaults are used if not set). + * @return a new {@link ServerConsumer} attached to the given queue * @throws Exception if an error occurs while creating the consumer instance. */ public ServerConsumer createSender(ProtonServerSenderContext protonSender, @@ -684,7 +671,9 @@ private void sendError(int errorCode, String errorMessage, Receiver receiver) { }); } - /** Will execute a Runnable on an Address when there's space in memory*/ + /** + * Will execute a Runnable on an Address when there's space in memory + */ public void flow(final SimpleString address, Runnable runnable) { try { @@ -720,7 +709,8 @@ public void resetContext(OperationContext oldContext) { storageManager.setContext(oldContext); } - /** Set the proper operation context in the Thread Local. + /** + * Set the proper operation context in the Thread Local. * Return the old context*/ public OperationContext recoverContext() { OperationContext oldContext = storageManager.getContext(); @@ -811,16 +801,12 @@ public Transaction getCurrentTransaction() { } /** - * Adds key / value based metadata into the underlying server session implementation - * for use by the connection resources. - * - * @param key - * The key to add into the linked server session. - * @param value - * The value to add into the linked server session attached to the given key. - * - * @return this {@link AMQPSessionCallback} instance. + * Adds key / value based metadata into the underlying server session implementation for use by the connection + * resources. * + * @param key The key to add into the linked server session. + * @param value The value to add into the linked server session attached to the given key. + * @return this {@link AMQPSessionCallback} instance * @throws Exception if an error occurs while adding the metadata. */ public AMQPSessionCallback addMetaData(String key, String value) throws Exception { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPStandardMessage.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPStandardMessage.java index 5e99ae398ab..c5f2e14fe5a 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPStandardMessage.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPStandardMessage.java @@ -152,8 +152,8 @@ public AMQPStandardMessage(long messageFormat, /** * Internal constructor used for persistence reload of the message. *

            - * The message will not be usable until the persistence mechanism populates the message - * data and triggers a parse of the message contents to fill in the message state. + * The message will not be usable until the persistence mechanism populates the message data and triggers a parse of + * the message contents to fill in the message state. * * @param messageFormat The Message format tag given the in Transfer that carried this message */ diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java index 7daf51a95d0..42ce9804312 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ActiveMQProtonRemotingConnection.java @@ -67,7 +67,7 @@ public void scheduledFlush() { amqpConnection.scheduledFlush(); } - /* + /** * This can be called concurrently by more than one thread so needs to be locked */ @Override @@ -195,9 +195,7 @@ public boolean isSupportsFlowControl() { } /** - * Returns the name of the protocol for this Remoting Connection - * - * @return + * {@return the name of the protocol for this Remoting Connection} */ @Override public String getProtocolName() { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/KMPNeedle.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/KMPNeedle.java index f6b8744c11a..31b268b08ed 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/KMPNeedle.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/KMPNeedle.java @@ -21,8 +21,9 @@ import org.apache.qpid.proton.codec.ReadableBuffer; /** - * Abstraction of {@code byte[] }Knuth-Morris-Pratt's needle to be used - * to perform pattern matching over {@link ReadableBuffer}. + * Abstraction of {@code byte[] }Knuth-Morris-Pratt's needle to + * be used to perform pattern matching over {@link ReadableBuffer}. */ final class KMPNeedle { @@ -58,9 +59,9 @@ private static int[] createJumpTable(byte[] needle) { /** * https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm search algorithm: - * - * This version differ from the original algorithm, because allows to fail fast (and faster) if - * the remaining haystack to be processed is < of the remaining needle to be matched. + *

            + * This version differ from the original algorithm, because allows to fail fast (and faster) if the remaining + * haystack to be processed is < of the remaining needle to be matched. */ public int searchInto(ReadableBuffer haystack, int start, int end) { if (end < 0 || start < 0 || end < start) { 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 de91c640418..52d767c2dfa 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 @@ -82,8 +82,9 @@ public static String getMirrorAddress(String connectionName) { private final Map prefixes = new HashMap<>(); - /** minLargeMessageSize determines when a message should be considered as large. - * minLargeMessageSize = -1 basically disables large message control over AMQP. + /** + * minLargeMessageSize determines when a message should be considered as large. minLargeMessageSize = -1 basically + * disables large message control over AMQP. */ private int amqpMinLargeMessageSize = 100 * 1024; @@ -114,9 +115,9 @@ public static String getMirrorAddress(String connectionName) { private final AMQPRoutingHandler routingHandler; /* - * used when you want to treat senders as a subscription on an address rather than consuming from the actual queue for - * the address. This can be changed on the acceptor. - * */ + * Used when you want to treat senders as a subscription on an address rather than consuming from the actual queue + * for the address. This can be changed on the acceptor. + */ private String pubSubPrefix = DestinationUtil.TOPIC_QUALIFIED_PREFIX; private int maxFrameSize = AmqpSupport.MAX_FRAME_SIZE_DEFAULT; @@ -146,8 +147,10 @@ public void onNotification(Notification notification) { } - /** Before the ackManager retries acks, it must flush the OperationContext on the MirrorTargets. - * This is the timeout is in milliseconds*/ + /** + * Before the ackManager retries acks, it must flush the OperationContext on the MirrorTargets. This is the timeout + * is in milliseconds + */ public long getAckManagerFlushTimeout() { return ackManagerFlushTimeout; } @@ -213,7 +216,9 @@ public ProtonProtocolManager setDirectDeliver(boolean directDeliver) { return this; } - /** for outgoing */ + /** + * for outgoing + */ public ProtonClientProtocolManager createClientManager() { ProtonClientProtocolManager clientOutgoing = new ProtonClientProtocolManager(factory, server); return clientOutgoing; @@ -224,8 +229,10 @@ public ConnectionEntry createConnectionEntry(Acceptor acceptorUsed, Connection r return internalConnectionEntry(remotingConnection, false, null, null); } - /** This method is not part of the ProtocolManager interface because it only makes sense on AMQP. - * More specifically on AMQP Bridges */ + /** + * This method is not part of the ProtocolManager interface because it only makes sense on AMQP. More specifically on + * AMQP Bridges + */ public ConnectionEntry createOutgoingConnectionEntry(Connection remotingConnection) { return internalConnectionEntry(remotingConnection, true, null, null); } @@ -409,16 +416,15 @@ public void setInitialRemoteMaxFrameSize(int initialRemoteMaxFrameSize) { } /** - * Returns true if transient delivery errors should be handled with a Modified disposition - * (if permitted by link) + * {@return true if transient delivery errors should be handled with a Modified disposition + * (if permitted by link)} */ public boolean isUseModifiedForTransientDeliveryErrors() { return this.amqpUseModifiedForTransientDeliveryErrors; } /** - * Sets if transient delivery errors should be handled with a Modified disposition - * (if permitted by link) + * Sets if transient delivery errors should be handled with a Modified disposition (if permitted by link) */ public ProtonProtocolManager setAmqpUseModifiedForTransientDeliveryErrors(boolean amqpUseModifiedForTransientDeliveryErrors) { this.amqpUseModifiedForTransientDeliveryErrors = amqpUseModifiedForTransientDeliveryErrors; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ProtonProtocolManagerFactory.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ProtonProtocolManagerFactory.java index db69840459a..faa9039338f 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ProtonProtocolManagerFactory.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/ProtonProtocolManagerFactory.java @@ -81,8 +81,8 @@ public String getModuleName() { } /** - * AMQP integration with the broker on this case needs to be soft as the - * broker may choose to not load the AMQP Protocol module. + * AMQP integration with the broker on this case needs to be soft as the broker may choose to not load the AMQP + * Protocol module. */ @Override public void loadProtocolServices(ActiveMQServer server, List services) { @@ -101,10 +101,9 @@ public void loadProtocolServices(ActiveMQServer server, List } } - /* - * Check if broker configuration of AMQP broker connections or other broker - * configuration related to protocol services has been updated and update the - * protocol services accordingly. + /** + * Check if broker configuration of AMQP broker connections or other broker configuration related to protocol + * services has been updated and update the protocol services accordingly. */ @Override public void updateProtocolServices(ActiveMQServer server, List services) throws Exception { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/ProtonClientProtocolManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/ProtonClientProtocolManager.java index 485210972ec..82744e4c5a8 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/ProtonClientProtocolManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/ProtonClientProtocolManager.java @@ -35,9 +35,10 @@ import java.util.concurrent.locks.Lock; /** - * Handles proton protocol management for clients, mapping the {@link ProtonProtocolManager} to the {@link org.apache.activemq.artemis.spi.core.remoting.ClientProtocolManager} API. - * This is currently very basic and only supports Connecting to a broker, - * which will be useful in scenarios where the broker needs to connect to another broker through AMQP into another broker (like Interconnect) that will perform extra functionality. + * Handles proton protocol management for clients, mapping the {@link ProtonProtocolManager} to the + * {@link org.apache.activemq.artemis.spi.core.remoting.ClientProtocolManager} API. This is currently very basic and + * only supports Connecting to a broker, which will be useful in scenarios where the broker needs to connect to another + * broker through AMQP into another broker (like Interconnect) that will perform extra functionality. */ public class ProtonClientProtocolManager extends ProtonProtocolManager implements ClientProtocolManager { 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 b5948a80633..62639a52468 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 @@ -127,9 +127,9 @@ public class AMQPBrokerConnection implements ClientConnectionLifeCycleListener, private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** - * Default value for the core message tunneling feature that indicates if core protocol messages - * should be streamed as binary blobs as the payload of an custom AMQP message which avoids any - * conversions of the messages to / from AMQP. + * Default value for the core message tunneling feature that indicates if core protocol messages should be streamed + * as binary blobs as the payload of an custom AMQP message which avoids any conversions of the messages to / from + * AMQP. */ public static final boolean DEFAULT_CORE_MESSAGE_TUNNELING_ENABLED = true; @@ -160,12 +160,14 @@ public class AMQPBrokerConnection implements ClientConnectionLifeCycleListener, final Executor connectExecutor; final ScheduledExecutorService scheduledExecutorService; - /** This is just for logging. - * the actual connection will come from the amqpConnection configuration*/ + /** + * This is just for logging. the actual connection will come from the amqpConnection configuration + */ String host; - /** This is just for logging. - * the actual connection will come from the amqpConnection configuration*/ + /** + * This is just for logging. the actual connection will come from the amqpConnection configuration + */ int port; public AMQPBrokerConnection(AMQPBrokerConnectionManager bridgeManager, @@ -376,16 +378,13 @@ SimpleString getMirrorSNF(AMQPMirrorBrokerConnectionElement mirrorElement) { } /** - * Adds a remote link closed event interceptor that can intercept the closed event and if it - * returns true indicate that the close has been handled and that normal broker connection - * remote link closed handling should be ignored. - * - * @param id - * A unique Id value that identifies the intercepter for later removal. - * @param interceptor - * The predicate that will be called for any link close. + * Adds a remote link closed event interceptor that can intercept the closed event and if it returns {@code true} + * indicate that the close has been handled and that normal broker connection remote link closed handling should be + * ignored. * - * @return this broker connection instance. + * @param id A unique Id value that identifies the intercepter for later removal. + * @param interceptor The predicate that will be called for any link close. + * @return this broker connection instance */ public AMQPBrokerConnection addLinkClosedInterceptor(String id, Predicate interceptor) { linkClosedInterceptors.put(id, interceptor); @@ -395,10 +394,8 @@ public AMQPBrokerConnection addLinkClosedInterceptor(String id, Predicate /** * Remove a previously registered link close interceptor from the broker connection. * - * @param id - * The id of the interceptor to remove - * - * @return this broker connection instance. + * @param id The id of the interceptor to remove + * @return this broker connection instance */ public AMQPBrokerConnection removeLinkClosedInterceptor(String id) { linkClosedInterceptors.remove(id); @@ -941,30 +938,24 @@ public void error(Throwable e) { } /** - * Provides an error API for resources of the broker connection that - * encounter errors during the normal operation of the resource that - * represent a terminal outcome for the connection. The connection - * retry counter will be reset to zero for these types of errors as - * these indicate a connection interruption that should initiate the - * start of a reconnect cycle if reconnection is configured. + * Provides an error API for resources of the broker connection that encounter errors during the normal operation of + * the resource that represent a terminal outcome for the connection. The connection retry counter will be reset to + * zero for these types of errors as these indicate a connection interruption that should initiate the start of a + * reconnect cycle if reconnection is configured. * - * @param error - * The exception that describes the terminal connection error. + * @param error The exception that describes the terminal connection error. */ public void runtimeError(Throwable error) { error(error, 0); } /** - * Provides an error API for resources of the broker connection that - * encounter errors during the connection / resource initialization - * phase that should constitute a terminal outcome for the connection. - * The connection retry counter will be incremented for these types of - * errors which can result in eventual termination of reconnect attempts - * when the limit is exceeded. + * Provides an error API for resources of the broker connection that encounter errors during the connection / + * resource initialization phase that should constitute a terminal outcome for the connection. The connection retry + * counter will be incremented for these types of errors which can result in eventual termination of reconnect + * attempts when the limit is exceeded. * - * @param error - * The exception that describes the terminal connection error. + * @param error The exception that describes the terminal connection error. */ public void connectError(Throwable error) { error(error, lastRetryCounter); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnectionConstants.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnectionConstants.java index b83c895361d..967786c510f 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnectionConstants.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnectionConstants.java @@ -24,20 +24,20 @@ public abstract class AMQPBrokerConnectionConstants { /** - * Property name used to embed a nested map of properties meant to be conveyed to the remote - * peer describing attributes assigned to the AMQP broker connection + * Property name used to embed a nested map of properties meant to be conveyed to the remote peer describing + * attributes assigned to the AMQP broker connection */ public static final Symbol BROKER_CONNECTION_INFO = Symbol.getSymbol("broker-connection-info"); /** - * Map entry key used to carry the AMQP broker connection name to the remote peer in the - * information map sent in the AMQP connection properties. + * Map entry key used to carry the AMQP broker connection name to the remote peer in the information map sent in the + * AMQP connection properties. */ public static final String CONNECTION_NAME = "connectionName"; /** - * Map entry key used to carry the Node ID of the server where the AMQP broker connection - * originates from to the remote peer in the information map sent in the AMQP connection properties. + * Map entry key used to carry the Node ID of the server where the AMQP broker connection originates from to the + * remote peer in the information map sent in the AMQP connection properties. */ public static final String NODE_ID = "nodeId"; 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 e0da3bd7938..d79eef9d891 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 @@ -79,7 +79,7 @@ public void start() throws Exception { } /** - * @return the number of configured broker connection configurations. + * {@return the number of configured broker connection configurations} */ public int getConfiguredConnectionsCount() { return amqpConnectionsConfig.size(); @@ -97,13 +97,10 @@ private void createBrokerConnection(AMQPBrokerConnectConfiguration configuration } /** - * Updates the configuration of any / all broker connections in the broker connection manager - * based on updated broker configuration. + * Updates the configuration of any / all broker connections in the broker connection manager based on updated broker + * configuration. * - * @param configurations - * A list of broker connection configurations after a broker configuration update. - * - * @throws Exception + * @param configurations A list of broker connection configurations after a broker configuration update. */ @SuppressWarnings("unchecked") public void updateConfiguration(List configurations) throws Exception { @@ -254,9 +251,10 @@ public void connectionReadyForWrites(Object connectionID, boolean ready) { } } - /** The Client Protocol Manager is used for Core Clients. - * As we are reusing the NettyConnector the API requires a ClientProtocolManager. - * This is to give us the reference for the AMQPConnection used. */ + /** + * The Client Protocol Manager is used for Core Clients. As we are reusing the NettyConnector the API requires a + * ClientProtocolManager. This is to give us the reference for the AMQPConnection used. + */ public static class ClientProtocolManagerWithAMQP implements ClientProtocolManager { public final ProtonProtocolManager protonPM; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPRemoteBrokerConnection.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPRemoteBrokerConnection.java index 52d08cfa564..c4d93799027 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPRemoteBrokerConnection.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPRemoteBrokerConnection.java @@ -39,9 +39,8 @@ import org.slf4j.LoggerFactory; /** - * A Utility class that represents the remote end of an incoming AMQP broker - * connection used to provide a common root for services that are active on - * a given incoming broker connection. + * A Utility class that represents the remote end of an incoming AMQP broker connection used to provide a common root + * for services that are active on a given incoming broker connection. */ public class AMQPRemoteBrokerConnection implements RemoteBrokerConnection { @@ -71,21 +70,21 @@ public AMQPRemoteBrokerConnection(ActiveMQServer server, AMQPConnectionContext c } /** - * @return the server instance that owns this remote broker connection + * {@return the server instance that owns this remote broker connection} */ public ActiveMQServer getServer() { return server; } /** - * @return the connection context for this incoming broker connection. + * {@return the connection context for this incoming broker connection} */ public AMQPConnectionContext getConnection() { return connection; } /** - * @return the remote node ID if it was provided or null if not supplied on connect. + * @return the remote node ID if it was provided or null if not supplied on connect */ @Override public String getNodeId() { @@ -93,7 +92,7 @@ public String getNodeId() { } /** - * @return the remote broker connection name if it was provided or null if not supplied on connect. + * @return the remote broker connection name if it was provided or null if not supplied on connect */ @Override public String getName() { @@ -106,10 +105,8 @@ public String getProtocol() { } /** - * Returns true if the remote broker connection was established with enough information to uniquely - * identify the connection source for purposes of adding the remote connection into the server management services. - * - * @return true if the remote broker connection was created with sufficient information to add to management. + * {@return {@code true} if the remote broker connection was established with enough information to uniquely identify + * the connection source for purposes of adding the remote connection into the server management services} */ public boolean isManagable() { return remoteConnectionName != null && @@ -119,29 +116,29 @@ public boolean isManagable() { } /** - * @return has this remote broker connection been initialized. + * {@return has this remote broker connection been initialized} */ public boolean isInitialized() { return state.ordinal() > State.UNINITIALIZED.ordinal(); } /** - * @return has this remote broker connection been started. + * {@return has this remote broker connection been started} */ public boolean isStarted() { return state == State.STARTED; } /** - * @return has this remote broker connection been shutdown. + * {@return has this remote broker connection been shutdown} */ public boolean isShutdown() { return state == State.SHUTDOWN; } /** - * Initialize the remote broker connection object which moves it to the started state where - * it will remain until shutdown. + * Initialize the remote broker connection object which moves it to the started state where it will remain until + * shutdown. * * @throws ActiveMQException if an error occurs on initialization. */ @@ -163,8 +160,8 @@ public synchronized void initialize() throws ActiveMQException { } /** - * Shutdown the remote broker connection object which removes any management objects and - * informs any registered services of the shutdown. + * Shutdown the remote broker connection object which removes any management objects and informs any registered + * services of the shutdown. */ @Override public synchronized void shutdown() { @@ -190,13 +187,10 @@ public synchronized void shutdown() { } /** - * Add a new federation target to this remote broker connection instance which will - * be started if this federation instance has already been started. - * - * @param federation - * - * @return this remote broker connection instance. + * Add a new federation target to this remote broker connection instance which will be started if this federation + * instance has already been started. * + * @return this remote broker connection instance * @throws ActiveMQException if an error occurs while adding the federation to this connection. */ public synchronized AMQPRemoteBrokerConnection addFederationTarget(AMQPFederationTarget federation) throws ActiveMQException { @@ -212,18 +206,13 @@ public synchronized AMQPRemoteBrokerConnection addFederationTarget(AMQPFederatio } /** - * Utility methods for checking the current connection for an existing remote broker connection instance - * and returning it, or creating a new instance if none yet exists and initializing it. - * - * @param server - * The server instance that has accepted the remote broker connection. - * @param connection - * The connection context object that is assigned to the active connection. - * @param protonConnection - * The proton connection instance where the connection attachments are stored. - * - * @return a remote broker connection instance that has been initialized that is scoped to the active connection. + * Utility methods for checking the current connection for an existing remote broker connection instance and + * returning it, or creating a new instance if none yet exists and initializing it. * + * @param server The server instance that has accepted the remote broker connection. + * @param connection The connection context object that is assigned to the active connection. + * @param protonConnection The proton connection instance where the connection attachments are stored. + * @return a remote broker connection instance that has been initialized that is scoped to the active connection * @throws ActiveMQException if an error occurs while attempting to get a remote broker connection instance. */ @SuppressWarnings("unchecked") diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederation.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederation.java index 46eeca656e8..c3023e134ce 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederation.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederation.java @@ -44,9 +44,8 @@ import org.slf4j.LoggerFactory; /** - * A single AMQP Federation instance that can be tied to an AMQP broker connection or - * used on a remote peer to control the reverse case of when the remote configures the - * target side of the connection. + * A single AMQP Federation instance that can be tied to an AMQP broker connection or used on a remote peer to control + * the reverse case of when the remote configures the target side of the connection. */ public abstract class AMQPFederation implements Federation { @@ -60,10 +59,9 @@ private enum State { } /** - * Value used to store the federation instance used by an AMQP connection that - * is performing remote command and control operations or is the target of said - * operations. Only one federation instance is allowed per connection and will - * be checked. + * Value used to store the federation instance used by an AMQP connection that is performing remote command and + * control operations or is the target of said operations. Only one federation instance is allowed per connection and + * will be checked. */ public static final String FEDERATION_INSTANCE_RECORD = "FEDERATION_INSTANCE_RECORD"; @@ -112,7 +110,7 @@ public AMQPFederation(String name, ActiveMQServer server) { } /** - * @return the {@link WildcardConfiguration} that is in use by this server federation. + * {@return the {@link WildcardConfiguration} that is in use by this server federation} */ public WildcardConfiguration getWildcardConfiguration() { return wildcardConfiguration; @@ -128,7 +126,7 @@ public ActiveMQServer getServer() { } /** - * @return the metrics instance tied to this federation instance. + * {@return the metrics instance tied to this federation instance} */ public AMQPFederationMetrics getMetrics() { return metrics; @@ -145,24 +143,24 @@ public boolean isStarted() { } /** - * @return true if the federation has been marked as connected. + * {@return {@code true} if the federation has been marked as connected} */ public boolean isConnected() { return connected; } /** - * @return the session context assigned to this federation instance + * {@return the session context assigned to this federation instance} */ public abstract AMQPConnectionContext getConnectionContext(); /** - * @return the session context assigned to this federation instance + * {@return the session context assigned to this federation instance} */ public abstract AMQPSessionContext getSessionContext(); /** - * @return the federation configuration that is in effect. + * {@return the federation configuration that is in effect} */ public abstract AMQPFederationConfiguration getConfiguration(); @@ -207,8 +205,8 @@ public final synchronized void start() throws ActiveMQException { } /** - * Stops this federation instance and shuts down all remote resources that - * the federation currently has open and active. + * Stops this federation instance and shuts down all remote resources that the federation currently has open and + * active. * * @throws ActiveMQException if an error occurs during the stop process. */ @@ -262,13 +260,11 @@ public final synchronized void shutdown() throws ActiveMQException { } /** - * Performs the prefixing for federation events queues that places the events queues into - * the name-space of federation related internal queues. + * Performs the prefixing for federation events queues that places the events queues into the name-space of + * federation related internal queues. * - * @param suffix - * A suffix to append to the federation events link (normally the AMQP link name). - * - * @return the full internal queue name to use for the given suffix. + * @param suffix A suffix to append to the federation events link (normally the AMQP link name). + * @return the full internal queue name to use for the given suffix */ String prefixEventsLinkQueueName(String suffix) { final StringBuilder builder = new StringBuilder(); @@ -284,13 +280,11 @@ String prefixEventsLinkQueueName(String suffix) { } /** - * Performs the prefixing for federation control queue name that places the queues - * into the name-space of federation related internal queues. - * - * @param suffix - * A suffix to append to the federation control link (normally the AMQP link name). + * Performs the prefixing for federation control queue name that places the queues into the name-space of federation + * related internal queues. * - * @return the full internal queue name to use for the given suffix. + * @param suffix A suffix to append to the federation control link (normally the AMQP link name). + * @return the full internal queue name to use for the given suffix */ String prefixControlLinkQueueName(String suffix) { final StringBuilder builder = new StringBuilder(); @@ -306,16 +300,12 @@ String prefixControlLinkQueueName(String suffix) { } /** - * Adds a remote linked closed event interceptor that can intercept the closed event and - * if it returns true indicate that the close has been handled and that no further action - * need to be taken for this event. - * - * @param id - * A unique Id value that identifies the interceptor for later removal. - * @param interceptor - * The predicate that will be called for any link close. + * Adds a remote linked closed event interceptor that can intercept the closed event and if it returns true indicate + * that the close has been handled and that no further action need to be taken for this event. * - * @return this {@link AMQPFederation} instance. + * @param id A unique Id value that identifies the interceptor for later removal. + * @param interceptor The predicate that will be called for any link close. + * @return this {@link AMQPFederation} instance */ public AMQPFederation addLinkClosedInterceptor(String id, Predicate interceptor) { linkClosedinterceptors.put(id, interceptor); @@ -325,10 +315,8 @@ public AMQPFederation addLinkClosedInterceptor(String id, Predicate interc /** * Remove a previously registered link close interceptor from the list of close interceptor bindings. * - * @param id - * The id of the interceptor to remove - * - * @return this {@link AMQPFederation} instance. + * @param id The id of the interceptor to remove + * @return this {@link AMQPFederation} instance */ public AMQPFederation removeLinkClosedInterceptor(String id) { linkClosedinterceptors.remove(id); @@ -336,14 +324,11 @@ public AMQPFederation removeLinkClosedInterceptor(String id) { } /** - * Adds a new {@link FederationReceiveFromQueuePolicy} entry to the set of policies that this - * federation will use to create demand on the remote when local demand is present. - * - * @param queuePolicy - * The policy to add to the set of configured {@link FederationReceiveFromQueuePolicy} instance. - * - * @return this {@link AMQPFederation} instance. + * Adds a new {@link FederationReceiveFromQueuePolicy} entry to the set of policies that this federation will use to + * create demand on the remote when local demand is present. * + * @param queuePolicy The policy to add to the set of configured {@link FederationReceiveFromQueuePolicy} instance. + * @return this {@link AMQPFederation} instance * @throws ActiveMQException if an error occurs processing the added policy */ public synchronized AMQPFederation addQueueMatchPolicy(FederationReceiveFromQueuePolicy queuePolicy) throws ActiveMQException { @@ -368,14 +353,12 @@ public synchronized AMQPFederation addQueueMatchPolicy(FederationReceiveFromQueu } /** - * Adds a new {@link FederationReceiveFromAddressPolicy} entry to the set of policies that this - * federation will use to create demand on the remote when local demand is present. - * - * @param addressPolicy - * The policy to add to the set of configured {@link FederationReceiveFromAddressPolicy} instance. - * - * @return this {@link AMQPFederation} instance. + * Adds a new {@link FederationReceiveFromAddressPolicy} entry to the set of policies that this federation will use + * to create demand on the remote when local demand is present. * + * @param addressPolicy The policy to add to the set of configured {@link FederationReceiveFromAddressPolicy} + * instance. + * @return this {@link AMQPFederation} instance * @throws ActiveMQException if an error occurs processing the added policy */ public synchronized AMQPFederation addAddressMatchPolicy(FederationReceiveFromAddressPolicy addressPolicy) throws ActiveMQException { @@ -400,14 +383,12 @@ public synchronized AMQPFederation addAddressMatchPolicy(FederationReceiveFromAd } /** - * Gets the remote federation address policy manager assigned to the given name, if none is yet - * managed by this federation instance a new manager is created and added to this managers tracking - * state for remote policy managers. + * Gets the remote federation address policy manager assigned to the given name, if none is yet managed by this + * federation instance a new manager is created and added to this managers tracking state for remote policy + * managers. * - * @param policyName - * The name of the policy whose manager is being queried for. - * - * @return an {@link AMQPFederationRemoteAddressPolicyManager} that matches the given name and type. + * @param policyName The name of the policy whose manager is being queried for. + * @return an {@link AMQPFederationRemoteAddressPolicyManager} that matches the given name and type */ public synchronized AMQPFederationRemoteAddressPolicyManager getRemoteAddressPolicyManager(String policyName) { if (!remoteAddressPolicyManagers.containsKey(policyName)) { @@ -431,14 +412,12 @@ public synchronized AMQPFederationRemoteAddressPolicyManager getRemoteAddressPol } /** - * Gets the remote federation queue policy manager assigned to the given name, if none is yet - * managed by this federation instance a new manager is created and added to this managers tracking - * state for remote policy managers. - * - * @param policyName - * The name of the policy whose manager is being queried for. + * Gets the remote federation queue policy manager assigned to the given name, if none is yet managed by this + * federation instance a new manager is created and added to this managers tracking state for remote policy + * managers. * - * @return an {@link AMQPFederationRemoteQueuePolicyManager} that matches the given name and type. + * @param policyName The name of the policy whose manager is being queried for. + * @return an {@link AMQPFederationRemoteQueuePolicyManager} that matches the given name and type */ public synchronized AMQPFederationRemoteQueuePolicyManager getRemoteQueuePolicyManager(String policyName) { if (!remoteQueuePolicyManagers.containsKey(policyName)) { @@ -462,11 +441,10 @@ public synchronized AMQPFederationRemoteQueuePolicyManager getRemoteQueuePolicyM } /** - * Register an event sender instance with this federation for use in sending federation level - * events from this federation instance to the remote peer. + * Register an event sender instance with this federation for use in sending federation level events from this + * federation instance to the remote peer. * - * @param dispatcher - * The event sender instance to be registered. + * @param dispatcher The event sender instance to be registered. */ synchronized void registerEventSender(AMQPFederationEventDispatcher dispatcher) { if (eventDispatcher != null) { @@ -477,11 +455,10 @@ synchronized void registerEventSender(AMQPFederationEventDispatcher dispatcher) } /** - * Register an event receiver instance with this federation for use in receiving federation level - * events sent to this federation instance from the remote peer. + * Register an event receiver instance with this federation for use in receiving federation level events sent to this + * federation instance from the remote peer. * - * @param dispatcher - * The event receiver instance to be registered. + * @param dispatcher The event receiver instance to be registered. */ synchronized void registerEventReceiver(AMQPFederationEventProcessor processor) { if (eventProcessor != null) { @@ -492,14 +469,12 @@ synchronized void registerEventReceiver(AMQPFederationEventProcessor processor) } /** - * Register an address by name that was either not present when an address federation consumer - * was initiated or was removed and the active address federation consumer was force closed. - * Upon (re)creation of the registered address a one time event will be sent to the remote - * federation instance which allows it to check if demand still exists and make another attempt - * at creating a consumer to federate messages from that address. + * Register an address by name that was either not present when an address federation consumer was initiated or was + * removed and the active address federation consumer was force closed. Upon (re)creation of the registered address a + * one time event will be sent to the remote federation instance which allows it to check if demand still exists and + * make another attempt at creating a consumer to federate messages from that address. * - * @param address - * The address that is currently missing which should be watched for creation. + * @param address The address that is currently missing which should be watched for creation. */ synchronized void registerMissingAddress(String address) { if (eventDispatcher != null) { @@ -508,14 +483,12 @@ synchronized void registerMissingAddress(String address) { } /** - * Register a queue by name that was either not present when an queue federation consumer was - * initiated or was removed and the active queue federation consumer was force closed. Upon - * (re)creation of the registered address and queue a one time event will be sent to the remote - * federation instance which allows it to check if demand still exists and make another attempt - * at creating a consumer to federate messages from that queue. + * Register a queue by name that was either not present when an queue federation consumer was initiated or was + * removed and the active queue federation consumer was force closed. Upon (re)creation of the registered address and + * queue a one time event will be sent to the remote federation instance which allows it to check if demand still + * exists and make another attempt at creating a consumer to federate messages from that queue. * - * @param queue - * The queue that is currently missing which should be watched for creation. + * @param queue The queue that is currently missing which should be watched for creation. */ synchronized void registerMissingQueue(String queue) { if (eventDispatcher != null) { @@ -524,13 +497,11 @@ synchronized void registerMissingQueue(String queue) { } /** - * Triggers scan of federation address policies for local address demand on the given address - * that was added on the remote peer which was previously absent and could not be auto created - * or was removed while a federation receiver was attached and caused an existing federation - * receiver to be closed. + * Triggers scan of federation address policies for local address demand on the given address that was added on the + * remote peer which was previously absent and could not be auto created or was removed while a federation receiver + * was attached and caused an existing federation receiver to be closed. * - * @param addressName - * The address that has been added on the remote peer. + * @param addressName The address that has been added on the remote peer. */ synchronized void processRemoteAddressAdded(String addressName) { localAddressPolicyManagers.values().forEach(policy -> { @@ -544,14 +515,12 @@ synchronized void processRemoteAddressAdded(String addressName) { } /** - * Triggers scan of federation queue policies for local queue demand on the given queue - * that was added on the remote peer which was previously absent at the time of a federation - * receiver attach or was removed and caused an existing federation receiver to be closed. + * Triggers scan of federation queue policies for local queue demand on the given queue that was added on the remote + * peer which was previously absent at the time of a federation receiver attach or was removed and caused an existing + * federation receiver to be closed. * - * @param addressName - * The address that has been added on the remote peer. - * @param queueName - * The queue that has been added on the remote peer. + * @param addressName The address that has been added on the remote peer. + * @param queueName The queue that has been added on the remote peer. */ synchronized void processRemoteQueueAdded(String addressName, String queueName) { localQueuePolicyManagers.values().forEach(policy -> { @@ -565,26 +534,23 @@ synchronized void processRemoteQueueAdded(String addressName, String queueName) } /** - * Error signaling API that must be implemented by the specific federation implementation - * to handle error when creating a federation resource such as an outgoing receiver link. + * Error signaling API that must be implemented by the specific federation implementation to handle error when + * creating a federation resource such as an outgoing receiver link. * - * @param cause - * The error that caused the resource creation to fail. + * @param cause The error that caused the resource creation to fail. */ protected abstract void signalResourceCreateError(Exception cause); /** - * Error signaling API that must be implemented by the specific federation implementation - * to handle errors encountered during normal operations. + * Error signaling API that must be implemented by the specific federation implementation to handle errors + * encountered during normal operations. * - * @param cause - * The error that caused the operation to fail. + * @param cause The error that caused the operation to fail. */ protected abstract void signalError(Exception cause); /** - * Provides an entry point for the concrete federation implementation to respond - * to being initialized. + * Provides an entry point for the concrete federation implementation to respond to being initialized. * * @throws ActiveMQException if an error is thrown during initialization handling. */ @@ -593,8 +559,7 @@ protected void handleFederationInitialized() throws ActiveMQException { } /** - * Provides an entry point for the concrete federation implementation to respond - * to being started. + * Provides an entry point for the concrete federation implementation to respond to being started. * * @throws ActiveMQException if an error is thrown during start handling. */ @@ -603,8 +568,7 @@ protected void handleFederationStarted() throws ActiveMQException { } /** - * Provides an entry point for the concrete federation implementation to respond - * to being stopped. + * Provides an entry point for the concrete federation implementation to respond to being stopped. * * @throws ActiveMQException if an error is thrown during stop handling. */ @@ -613,8 +577,7 @@ protected void handleFederationStopped() throws ActiveMQException { } /** - * Provides an entry point for the concrete federation implementation to respond - * to being shutdown. + * Provides an entry point for the concrete federation implementation to respond to being shutdown. * * @throws ActiveMQException if an error is thrown during initialization handling. */ @@ -692,11 +655,10 @@ private void failIfShutdown() throws ActiveMQIllegalStateException { } /* - * This section contains internal management support APIs for resources managed by this - * Federation instance. The resources that are managed by a federation source or target - * call into this batch of API to add and remove themselves into management which allows - * the given federation source or target the control over how the resources are represented - * in the management hierarchy. + * This section contains internal management support APIs for resources managed by this Federation instance. The + * resources that are managed by a federation source or target call into this batch of API to add and remove + * themselves into management which allows the given federation source or target the control over how the resources + * are represented in the management hierarchy. */ abstract void registerFederationManagement() throws Exception; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressConsumer.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressConsumer.java index d9dc94d49c5..a39df03890c 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressConsumer.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressConsumer.java @@ -72,9 +72,8 @@ import org.slf4j.LoggerFactory; /** - * Consumer implementation for Federated Addresses that receives from a remote - * AMQP peer and forwards those messages onto the internal broker Address for - * consumption by an attached consumers. + * Consumer implementation for Federated Addresses that receives from a remote AMQP peer and forwards those messages + * onto the internal broker Address for consumption by an attached consumers. */ public final class AMQPFederationAddressConsumer extends AMQPFederationConsumer { @@ -261,8 +260,8 @@ private static ICoreMessage incrementCoreMessageHops(ICoreMessage message) { } /** - * Wrapper around the standard receiver context that provides federation specific entry - * points and customizes inbound delivery handling for this Address receiver. + * Wrapper around the standard receiver context that provides federation specific entry points and customizes inbound + * delivery handling for this Address receiver. */ private class AMQPFederatedAddressDeliveryReceiver extends ProtonServerReceiverContext { @@ -275,10 +274,8 @@ private class AMQPFederatedAddressDeliveryReceiver extends ProtonServerReceiverC /** * Creates the federation receiver instance. * - * @param session - * The server session context bound to the receiver instance. - * @param receiver - * The proton receiver that will be wrapped in this server context instance. + * @param session The server session context bound to the receiver instance. + * @param receiver The proton receiver that will be wrapped in this server context instance. */ AMQPFederatedAddressDeliveryReceiver(AMQPSessionContext session, FederationConsumerInfo consumerInfo, Receiver receiver) { super(session.getSessionSPI(), session.getAMQPConnectionContext(), session, receiver); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressPolicyManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressPolicyManager.java index dc59d1714f1..04540e7d842 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressPolicyManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressPolicyManager.java @@ -65,7 +65,7 @@ public AMQPFederationAddressPolicyManager(AMQPFederation federation, AMQPFederat } /** - * @return the receive from address policy that backs the address policy manager. + * @return the receive from address policy that backs the address policy manager */ @Override public FederationReceiveFromAddressPolicy getPolicy() { @@ -202,13 +202,11 @@ public synchronized void afterAddBinding(Binding binding) { } /** - * Called under lock this method should check if the given {@link Binding} matches the - * configured address federation policy and federate the address if so. The incoming - * {@link Binding} can be either a {@link QueueBinding} or a {@link DivertBinding} so - * the code should check both. + * Called under lock this method should check if the given {@link Binding} matches the configured address federation + * policy and federate the address if so. The incoming {@link Binding} can be either a {@link QueueBinding} or a + * {@link DivertBinding} so the code should check both. * - * @param binding - * The binding that should be checked against the federated address policy, + * @param binding The binding that should be checked against the federated address policy, */ private void checkBindingForMatch(Binding binding) { if (binding instanceof QueueBinding queueBinding) { @@ -345,13 +343,10 @@ private void createOrUpdateFederatedAddressConsumerForBinding(AddressInfo addres } /** - * Checks if the remote address added falls within the set of addresses that match the - * configured address policy and if so scans for local demand on that address to see - * if a new attempt to federate the address is needed. - * - * @param addressName - * The address that was added on the remote. + * Checks if the remote address added falls within the set of addresses that match the configured address policy and + * if so scans for local demand on that address to see if a new attempt to federate the address is needed. * + * @param addressName The address that was added on the remote. * @throws Exception if an error occurs while processing the address added event. */ synchronized void afterRemoteAddressAdded(String addressName) throws Exception { @@ -371,14 +366,12 @@ synchronized void afterRemoteAddressAdded(String addressName) throws Exception { } /** - * Performs the test against the configured address policy to check if the target - * address is a match or not. A subclass can override this method and provide its - * own match tests in combination with the configured matching policy. - * - * @param addressInfo - * The address that is being tested for a policy match. + * Performs the test against the configured address policy to check if the target address is a match or not. A + * subclass can override this method and provide its own match tests in combination with the configured matching + * policy. * - * @return true if the address given is a match against the policy. + * @param addressInfo The address that is being tested for a policy match. + * @return {@code true} if the address given is a match against the policy */ private boolean testIfAddressMatchesPolicy(AddressInfo addressInfo) { if (!policy.test(addressInfo)) { @@ -396,30 +389,25 @@ private boolean testIfAddressMatchesPolicy(AddressInfo addressInfo) { } /** - * Performs the test against the configured address policy to check if the target - * address is a match or not. A subclass can override this method and provide its - * own match tests in combination with the configured matching policy. + * Performs the test against the configured address policy to check if the target address is a match or not. A + * subclass can override this method and provide its own match tests in combination with the configured matching + * policy. * - * @param address - * The address that is being tested for a policy match. - * @param type - * The routing type of the address to test against the policy. - * - * @return true if the address given is a match against the policy. + * @param address The address that is being tested for a policy match. + * @param type The routing type of the address to test against the policy. + * @return {@code true} if the address given is a match against the policy */ private boolean testIfAddressMatchesPolicy(String address, RoutingType type) { return policy.test(address, type); } /** - * Create a new {@link FederationConsumerInfo} based on the given {@link AddressInfo} - * and the configured {@link FederationReceiveFromAddressPolicy}. A subclass must override this - * method to return a consumer information object with the data used be that implementation. - * - * @param address - * The {@link AddressInfo} to use as a basis for the consumer information object. + * Create a new {@link FederationConsumerInfo} based on the given {@link AddressInfo} and the configured + * {@link FederationReceiveFromAddressPolicy}. A subclass must override this method to return a consumer information + * object with the data used be that implementation. * - * @return a new {@link FederationConsumerInfo} instance based on the given address. + * @param address The {@link AddressInfo} to use as a basis for the consumer information object. + * @return a new {@link FederationConsumerInfo} instance based on the given address */ private AMQPFederationGenericConsumerInfo createConsumerInfo(AddressInfo address) { final String addressName = address.getName().toString(); @@ -476,14 +464,14 @@ private static class AMQPFederationAddressConsumerManager extends AMQPFederation } /** - * @return the address information that this entry is acting to federate. + * {@return the address information that this entry is acting to federate} */ public AddressInfo getAddressInfo() { return addressInfo; } /** - * @return the address that this entry is acting to federate. + * {@return the address that this entry is acting to federate} */ public String getAddress() { return getAddressInfo().getName().toString(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressSenderController.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressSenderController.java index 8482858b7b2..11c59c550ab 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressSenderController.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAddressSenderController.java @@ -59,11 +59,10 @@ import org.slf4j.LoggerFactory; /** - * {@link SenderController} used when an AMQP federation Address receiver is created - * and this side of the connection needs to create a matching sender. The address sender - * controller must check on initialization if the address exists and if not it should - * create it using the configuration values supplied in the link source properties that - * control the lifetime of the address once the link is closed. + * {@link SenderController} used when an AMQP federation Address receiver is created and this side of the connection + * needs to create a matching sender. The address sender controller must check on initialization if the address exists + * and if not it should create it using the configuration values supplied in the link source properties that control the + * lifetime of the address once the link is closed. */ public final class AMQPFederationAddressSenderController extends AMQPFederationSenderController { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAsyncCompletion.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAsyncCompletion.java index 5feec874c33..5dc3a44b8d5 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAsyncCompletion.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationAsyncCompletion.java @@ -17,29 +17,24 @@ package org.apache.activemq.artemis.protocol.amqp.connect.federation; /** - * AMQPFederationAsyncCompletion type used to implement the handlers for asynchronous calls in AMQP - * federation types. + * AMQPFederationAsyncCompletion type used to implement the handlers for asynchronous calls in AMQP federation types. * - * @param - * The type that defines the context provided to the completion events + * @param The type that defines the context provided to the completion events */ public interface AMQPFederationAsyncCompletion { /** * Called when the asynchronous operation has succeeded. * - * @param context - * The context object provided for this asynchronous event. + * @param context The context object provided for this asynchronous event. */ void onComplete(E context); /** * Called when the asynchronous operation has failed due to an error. * - * @param context - * The context object provided for this asynchronous event. - * @param error - * The error that describes the failure that occurred. + * @param context The context object provided for this asynchronous event. + * @param error The error that describes the failure that occurred. */ void onException(E context, Exception error); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationCommandDispatcher.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationCommandDispatcher.java index 01e1723c330..76eca6ee367 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationCommandDispatcher.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationCommandDispatcher.java @@ -16,8 +16,6 @@ */ package org.apache.activemq.artemis.protocol.amqp.connect.federation; -import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederation.FEDERATION_INSTANCE_RECORD; - import java.util.Objects; import org.apache.activemq.artemis.api.core.RoutingType; @@ -35,10 +33,11 @@ import org.apache.qpid.proton.engine.Connection; import org.apache.qpid.proton.engine.Sender; +import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederation.FEDERATION_INSTANCE_RECORD; + /** - * A {@link SenderController} implementation used by the AMQP federation control link - * to encode and send federation policies or other commands to the remote side of the - * AMQP federation instance. + * A {@link SenderController} implementation used by the AMQP federation control link to encode and send federation + * policies or other commands to the remote side of the AMQP federation instance. */ public class AMQPFederationCommandDispatcher implements SenderController { @@ -55,13 +54,10 @@ public class AMQPFederationCommandDispatcher implements SenderController { } /** - * Sends the given {@link FederationReceiveFromQueuePolicy} instance using the control - * link which should instruct the remote to begin federation operations back to this - * peer for matching remote queues with demand. - * - * @param policy - * The policy to encode and send over the federation control link. + * Sends the given {@link FederationReceiveFromQueuePolicy} instance using the control link which should instruct the + * remote to begin federation operations back to this peer for matching remote queues with demand. * + * @param policy The policy to encode and send over the federation control link. * @throws Exception if an error occurs during the control and send operation. */ public void sendPolicy(FederationReceiveFromQueuePolicy policy) throws Exception { @@ -74,13 +70,10 @@ public void sendPolicy(FederationReceiveFromQueuePolicy policy) throws Exception } /** - * Sends the given {@link FederationReceiveFromAddressPolicy} instance using the control - * link which should instruct the remote to begin federation operations back to this - * peer for matching remote address. - * - * @param policy - * The policy to encode and send over the federation control link. + * Sends the given {@link FederationReceiveFromAddressPolicy} instance using the control link which should instruct + * the remote to begin federation operations back to this peer for matching remote address. * + * @param policy The policy to encode and send over the federation control link. * @throws Exception if an error occurs during the control and send operation. */ public void sendPolicy(FederationReceiveFromAddressPolicy policy) throws Exception { @@ -93,12 +86,10 @@ public void sendPolicy(FederationReceiveFromAddressPolicy policy) throws Excepti } /** - * Raw send command that accepts and {@link AMQPMessage} instance and routes it using the - * server post office instance. - * - * @param command - * The command message to send to the previously created control address. + * Raw send command that accepts and {@link AMQPMessage} instance and routes it using the server post office + * instance. * + * @param command The command message to send to the previously created control address. * @throws Exception if an error occurs during the message send. */ public void sendCommand(AMQPMessage command) throws Exception { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationCommandProcessor.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationCommandProcessor.java index 9de65facf3a..9f4d38f44b0 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationCommandProcessor.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationCommandProcessor.java @@ -47,8 +47,8 @@ import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.ADD_ADDRESS_POLICY; /** - * A specialized AMQP Receiver that handles commands from a remote Federation connection such - * as handling incoming policies that should be applied to local addresses and queues. + * A specialized AMQP Receiver that handles commands from a remote Federation connection such as handling incoming + * policies that should be applied to local addresses and queues. */ public class AMQPFederationCommandProcessor extends ProtonAbstractReceiver { @@ -67,12 +67,9 @@ public class AMQPFederationCommandProcessor extends ProtonAbstractReceiver { /** * Create the new federation command receiver * - * @param federation - * The AMQP Federation instance that this command consumer resides in. - * @param session - * The associated session for this federation command consumer. - * @param receiver - * The proton {@link Receiver} that this command consumer reads from. + * @param federation The AMQP Federation instance that this command consumer resides in. + * @param session The associated session for this federation command consumer. + * @param receiver The proton {@link Receiver} that this command consumer reads from. */ public AMQPFederationCommandProcessor(AMQPFederationTarget federation, AMQPSessionContext session, Receiver receiver) { super(session.getSessionSPI(), session.getAMQPConnectionContext(), session, receiver); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConfiguration.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConfiguration.java index 9b08ba0b7b2..4a8042b1855 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConfiguration.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConfiguration.java @@ -17,17 +17,6 @@ package org.apache.activemq.artemis.protocol.amqp.connect.federation; -import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.LARGE_MESSAGE_THRESHOLD; -import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.LINK_ATTACH_TIMEOUT; -import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.PULL_RECEIVER_BATCH_SIZE; -import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.QUEUE_RECEIVER_IDLE_TIMEOUT; -import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.RECEIVER_CREDITS; -import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.RECEIVER_CREDITS_LOW; -import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.RECEIVER_QUIESCE_TIMEOUT; -import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.ADDRESS_RECEIVER_IDLE_TIMEOUT; -import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.IGNORE_QUEUE_CONSUMER_FILTERS; -import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.IGNORE_QUEUE_CONSUMER_PRIORITIES; - import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -35,19 +24,28 @@ import org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext; import org.apache.activemq.artemis.protocol.amqp.proton.AmqpSupport; -import org.apache.qpid.proton.engine.Receiver; + +import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.ADDRESS_RECEIVER_IDLE_TIMEOUT; +import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.IGNORE_QUEUE_CONSUMER_FILTERS; +import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.IGNORE_QUEUE_CONSUMER_PRIORITIES; +import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.LARGE_MESSAGE_THRESHOLD; +import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.LINK_ATTACH_TIMEOUT; +import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.PULL_RECEIVER_BATCH_SIZE; +import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.QUEUE_RECEIVER_IDLE_TIMEOUT; +import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.RECEIVER_CREDITS; +import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.RECEIVER_CREDITS_LOW; +import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.RECEIVER_QUIESCE_TIMEOUT; /** - * A configuration class that contains API for getting federation specific - * configuration either from a {@link Map} of configuration elements or from - * the connection associated with the federation instance, or possibly from a - * set default value. + * A configuration class that contains API for getting federation specific configuration either from a {@link Map} of + * configuration elements or from the connection associated with the federation instance, or possibly from a set default + * value. */ public final class AMQPFederationConfiguration { /** - * Default timeout value (in seconds) used to control when a link attach is considered to have - * failed due to not responding to an attach request. + * Default timeout value (in seconds) used to control when a link attach is considered to have failed due to not + * responding to an attach request. */ public static final int DEFAULT_LINK_ATTACH_TIMEOUT = 30; @@ -57,46 +55,46 @@ public final class AMQPFederationConfiguration { public static final int DEFAULT_PULL_CREDIT_BATCH_SIZE = 100; /** - * Default value for the core message tunneling feature that indicates if core protocol messages - * should be streamed as binary blobs as the payload of an custom AMQP message which avoids any - * conversions of the messages to / from AMQP. + * Default value for the core message tunneling feature that indicates if core protocol messages should be streamed + * as binary blobs as the payload of an custom AMQP message which avoids any conversions of the messages to / from + * AMQP. */ public static final boolean DEFAULT_CORE_MESSAGE_TUNNELING_ENABLED = true; /** - * Default value for the filtering applied to federation queue consumers that controls if - * the filter specified by a consumer subscription is used or if the higher level queue - * filter only is applied when creating a federation queue consumer. + * Default value for the filtering applied to federation queue consumers that controls if the filter specified by a + * consumer subscription is used or if the higher level queue filter only is applied when creating a federation queue + * consumer. */ public static final boolean DEFAULT_IGNNORE_QUEUE_CONSUMER_FILTERS = false; /** - * Default value for the priority applied to federation queue consumers that controls if - * the priority specified by a consumer subscription is used or if the policy priority - * offset value is simply applied to the default consumer priority value. + * Default value for the priority applied to federation queue consumers that controls if the priority specified by a + * consumer subscription is used or if the policy priority offset value is simply applied to the default consumer + * priority value. */ public static final boolean DEFAULT_IGNNORE_QUEUE_CONSUMER_PRIORITIES = false; /** - * Default timeout (milliseconds) applied to federation receivers that are being stopped due to removal - * of local demand and need to drain link credit and process any in-flight deliveries before closure. - * If the timeout elapses before the link has quiesced the link is forcibly closed. + * Default timeout (milliseconds) applied to federation receivers that are being stopped due to removal of local + * demand and need to drain link credit and process any in-flight deliveries before closure. If the timeout elapses + * before the link has quiesced the link is forcibly closed. */ public static final int DEFAULT_RECEIVER_QUIESCE_TIMEOUT = 60_000; /** - * Default timeout (milliseconds) applied to federation address receivers that have been stopped due to - * lack of local demand. The close delay prevent a link from detaching in cases where demand drops and - * returns in quick succession allowing for faster recovery. The idle timeout kicks in once the link has - * completed its drain of outstanding credit. + * Default timeout (milliseconds) applied to federation address receivers that have been stopped due to lack of local + * demand. The close delay prevent a link from detaching in cases where demand drops and returns in quick succession + * allowing for faster recovery. The idle timeout kicks in once the link has completed its drain of outstanding + * credit. */ public static final int DEFAULT_ADDRESS_RECEIVER_IDLE_TIMEOUT = 5_000; /** - * Default timeout (milliseconds) applied to federation queue receivers that have been stopped due to - * lack of local demand. The close delay prevent a link from detaching in cases where demand drops and - * returns in quick succession allowing for faster recovery. The idle timeout kicks in once the link has - * completed its drain of outstanding credit. + * Default timeout (milliseconds) applied to federation queue receivers that have been stopped due to lack of local + * demand. The close delay prevent a link from detaching in cases where demand drops and returns in quick succession + * allowing for faster recovery. The idle timeout kicks in once the link has completed its drain of outstanding + * credit. */ public static final int DEFAULT_QUEUE_RECEIVER_IDLE_TIMEOUT = 60_000; @@ -116,7 +114,7 @@ public AMQPFederationConfiguration(AMQPConnectionContext connection, Maptrue if federation is configured to ignore filters on individual queue consumers + * {@return {@code true} if federation is configured to ignore filters on individual queue consumers} */ public boolean isIgnoreSubscriptionFilters() { final Object property = properties.get(IGNORE_QUEUE_CONSUMER_FILTERS); @@ -214,7 +215,7 @@ public boolean isIgnoreSubscriptionFilters() { } /** - * @return true if federation is configured to ignore priorities on individual queue consumers + * {@return {@code true} if federation is configured to ignore priorities on individual queue consumers} */ public boolean isIgnoreSubscriptionPriorities() { final Object property = properties.get(IGNORE_QUEUE_CONSUMER_PRIORITIES); @@ -228,7 +229,8 @@ public boolean isIgnoreSubscriptionPriorities() { } /** - * @return the receive quiesce timeout when shutting down a {@link Receiver} when local demand is removed. + * {@return the receive quiesce timeout when shutting down a {@link org.apache.qpid.proton.engine.Receiver} when + * local demand is removed} */ public int getReceiverQuiesceTimeout() { final Object property = properties.get(RECEIVER_QUIESCE_TIMEOUT); @@ -242,7 +244,8 @@ public int getReceiverQuiesceTimeout() { } /** - * @return the receive idle timeout when shutting down a address {@link Receiver} when local demand is removed. + * {@return the receive idle timeout when shutting down a address {@link org.apache.qpid.proton.engine.Receiver} when + * local demand is removed} */ public int getAddressReceiverIdleTimeout() { final Object property = properties.get(ADDRESS_RECEIVER_IDLE_TIMEOUT); @@ -256,7 +259,8 @@ public int getAddressReceiverIdleTimeout() { } /** - * @return the receive idle timeout when shutting down a queue {@link Receiver} when local demand is removed. + * {@return the receive idle timeout when shutting down a queue {@link org.apache.qpid.proton.engine.Receiver} when + * local demand is removed} */ public int getQueueReceiverIdleTimeout() { final Object property = properties.get(QUEUE_RECEIVER_IDLE_TIMEOUT); @@ -270,10 +274,10 @@ public int getQueueReceiverIdleTimeout() { } /** - * Enumerate the configuration options in this configuration object and return a {@link Map} that - * contains the values which can be sent to a remote peer + * Enumerate the configuration options in this configuration object and return a {@link Map} that contains the values + * which can be sent to a remote peer * - * @return a Map that contains the values of each configuration option. + * @return a Map that contains the values of each configuration option */ public Map toConfigurationMap() { final Map configMap = new HashMap<>(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConstants.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConstants.java index 28a27841902..b40788b0485 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConstants.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConstants.java @@ -29,14 +29,12 @@ public final class AMQPFederationConstants { /** - * Address used by a remote broker instance to validate that an incoming federation connection - * has access rights to perform federation operations. The user that connects to the AMQP federation - * endpoint and attempts to create the control link must have write access to this address and any - * address prefixed by this value. - * - * When securing a federation user account the user must have read and write permissions to addresses - * under this prefix using the broker defined delimiter, this include the ability to create non-durable - * resources. + * Address used by a remote broker instance to validate that an incoming federation connection has access rights to + * perform federation operations. The user that connects to the AMQP federation endpoint and attempts to create the + * control link must have write access to this address and any address prefixed by this value. + *

            + * When securing a federation user account the user must have read and write permissions to addresses under this + * prefix using the broker defined delimiter, this include the ability to create non-durable resources. * *

                 *    $ACTIVEMQ_ARTEMIS_FEDERATION.#;
            @@ -45,8 +43,8 @@ public final class AMQPFederationConstants {
                public static final String FEDERATION_BASE_VALIDATION_ADDRESS = "$ACTIVEMQ_ARTEMIS_FEDERATION";
             
                /**
            -    * The prefix value added when creating a federation control link beyond the initial portion of the
            -    * validation address prefix. Links for command and control of federation operations follow the form:
            +    * The prefix value added when creating a federation control link beyond the initial portion of the validation
            +    * address prefix. Links for command and control of federation operations follow the form:
                 *
                 * 
                 *    $ACTIVEMQ_ARTEMIS_FEDERATION.control.<unique-id>
            @@ -55,8 +53,8 @@ public final class AMQPFederationConstants {
                public static final String FEDERATION_CONTROL_LINK_PREFIX = "control";
             
                /**
            -    * The prefix value added when creating a federation events links beyond the initial portion of the
            -    * validation address prefix. Links for federation events follow the form:
            +    * The prefix value added when creating a federation events links beyond the initial portion of the validation
            +    * address prefix. Links for federation events follow the form:
                 *
                 * 
                 *    $ACTIVEMQ_ARTEMIS_FEDERATION.events.<unique-id>
            @@ -65,121 +63,116 @@ public final class AMQPFederationConstants {
                public static final String FEDERATION_EVENTS_LINK_PREFIX = "events";
             
                /**
            -    * A desired capability added to the federation control link that must be offered
            -    * in return for a federation connection to be successfully established.
            +    * A desired capability added to the federation control link that must be offered in return for a federation
            +    * connection to be successfully established.
                 */
                public static final Symbol FEDERATION_CONTROL_LINK = Symbol.getSymbol("AMQ_FEDERATION_CONTROL_LINK");
             
                /**
            -    * A desired capability added to the federation events links that must be offered
            -    * in return for a federation event link to be successfully established.
            +    * A desired capability added to the federation events links that must be offered in return for a federation event
            +    * link to be successfully established.
                 */
                public static final Symbol FEDERATION_EVENT_LINK = Symbol.getSymbol("AMQ_FEDERATION_EVENT_LINK");
             
                /**
            -    * Property name used to embed a nested map of properties meant to be applied if the federation
            -    * resources created on the remote end of the control link if configured to do so. These properties
            -    * essentially carry local configuration to the remote side that would otherwise use broker defaults
            -    * and not match behaviors of resources created on the local side of the connection.
            +    * Property name used to embed a nested map of properties meant to be applied if the federation resources created on
            +    * the remote end of the control link if configured to do so. These properties essentially carry local configuration
            +    * to the remote side that would otherwise use broker defaults and not match behaviors of resources created on the
            +    * local side of the connection.
                 */
                public static final Symbol FEDERATION_CONFIGURATION = Symbol.getSymbol("federation-configuration");
             
                /**
            -    * Property value that can be applied to federation configuration that controls the timeout value
            -    * for a link attach to complete before the attach attempt is considered to have failed. The value
            -    * is configured in seconds (default is 30 seconds).
            +    * Property value that can be applied to federation configuration that controls the timeout value for a link attach
            +    * to complete before the attach attempt is considered to have failed. The value is configured in seconds (default is
            +    * 30 seconds).
                 */
                public static final String LINK_ATTACH_TIMEOUT = "attach-timeout";
             
                /**
            -    * Configuration property that defines the amount of credits to batch to an AMQP receiver link
            -    * and the top up limit when sending more credit once the credits are determined to be running
            -    * low. this can be sent to the peer so that dual federation configurations share the same
            -    * configuration on both sides of the connection.
            +    * Configuration property that defines the amount of credits to batch to an AMQP receiver link and the top up limit
            +    * when sending more credit once the credits are determined to be running low. this can be sent to the peer so that
            +    * dual federation configurations share the same configuration on both sides of the connection.
                 */
                public static final String RECEIVER_CREDITS = "amqpCredits";
             
                /**
            -    * A low water mark for receiver credits that indicates more should be sent to top it up to the
            -    * original credit batch size. this can be sent to the peer so that dual federation configurations
            -    * share the same configuration on both sides of the connection.
            +    * A low water mark for receiver credits that indicates more should be sent to top it up to the original credit batch
            +    * size. this can be sent to the peer so that dual federation configurations share the same configuration on both
            +    * sides of the connection.
                 */
                public static final String RECEIVER_CREDITS_LOW = "amqpLowCredits";
             
                /**
            -    * Configuration property that defines the amount of credits to batch to an AMQP receiver link
            -    * and the top up value when sending more credit once the broker has capacity available for
            -    * them. this can be sent to the peer so that dual federation configurations share the same
            -    * configuration on both sides of the connection.
            +    * Configuration property that defines the amount of credits to batch to an AMQP receiver link and the top up value
            +    * when sending more credit once the broker has capacity available for them. this can be sent to the peer so that
            +    * dual federation configurations share the same configuration on both sides of the connection.
                 */
                public static final String PULL_RECEIVER_BATCH_SIZE = "amqpPullConsumerCredits";
             
                /**
            -    * Configuration property used to convey the local side value to use when considering if a message
            -    * is a large message, this can be sent to the peer so that dual federation configurations share
            -    * the same configuration on both sides of the connection.
            +    * Configuration property used to convey the local side value to use when considering if a message is a large
            +    * message, this can be sent to the peer so that dual federation configurations share the same configuration on both
            +    * sides of the connection.
                 */
                public static final String LARGE_MESSAGE_THRESHOLD = "minLargeMessageSize";
             
                /**
            -    * Configuration property used to convey the local side value to use when considering if federation queue
            -    * consumers should filter using the filters defined on individual queue subscriptions, this can be sent
            -    * to the peer so that dual federation configurations share the same configuration on both sides of the
            -    * connection. This can be used to prevent multiple subscriptions on the same queue based on local demand
            -    * with differing subscription filters but does imply that message that don't match those filters would
            -    * be federated to the local broker.
            +    * Configuration property used to convey the local side value to use when considering if federation queue consumers
            +    * should filter using the filters defined on individual queue subscriptions, this can be sent to the peer so that
            +    * dual federation configurations share the same configuration on both sides of the connection. This can be used to
            +    * prevent multiple subscriptions on the same queue based on local demand with differing subscription filters but
            +    * does imply that message that don't match those filters would be federated to the local broker.
                 */
                public static final String IGNORE_QUEUE_CONSUMER_FILTERS = "ignoreQueueConsumerFilters";
             
                /**
            -    * Configuration property used to convey the local side value to use when considering if federation queue
            -    * consumers should apply a consumer priority offset based on the subscription priority or should use a
            -    * singular priority offset based on policy configuration. This can be sent to the peer so that dual
            -    * federation configurations share the same configuration on both sides of the connection. This can be
            -    * used to prevent multiple subscriptions on the same queue based on local demand with differing consumer
            -    * priorities but does imply that care needs to be taken to ensure remote consumers would normally have
            -    * a higher priority value than the configured default priority offset.
            +    * Configuration property used to convey the local side value to use when considering if federation queue consumers
            +    * should apply a consumer priority offset based on the subscription priority or should use a singular priority
            +    * offset based on policy configuration. This can be sent to the peer so that dual federation configurations share
            +    * the same configuration on both sides of the connection. This can be used to prevent multiple subscriptions on the
            +    * same queue based on local demand with differing consumer priorities but does imply that care needs to be taken to
            +    * ensure remote consumers would normally have a higher priority value than the configured default priority offset.
                 */
                public static final String IGNORE_QUEUE_CONSUMER_PRIORITIES = "ignoreQueueConsumerPriorities";
             
                /**
            -    * A desired capability added to the federation queue receiver link that must be offered
            -    * in return for a federation queue receiver to be successfully opened.  On the remote the
            -    * presence of this capability indicates that the matching queue should be present on the
            -    * remote and its absence constitutes a failure that should result in the attach request
            -    * being failed.
            +    * A desired capability added to the federation queue receiver link that must be offered in return for a federation
            +    * queue receiver to be successfully opened.  On the remote the presence of this capability indicates that the
            +    * matching queue should be present on the remote and its absence constitutes a failure that should result in the
            +    * attach request being failed.
                 */
                public static final Symbol FEDERATION_QUEUE_RECEIVER = Symbol.getSymbol("AMQ_FEDERATION_QUEUE_RECEIVER");
             
                /**
            -    * A desired capability added to the federation address receiver link that must be offered
            -    * in return for a federation address receiver to be successfully opened.
            +    * A desired capability added to the federation address receiver link that must be offered in return for a federation
            +    * address receiver to be successfully opened.
                 */
                public static final Symbol FEDERATION_ADDRESS_RECEIVER = Symbol.getSymbol("AMQ_FEDERATION_ADDRESS_RECEIVER");
             
                /**
            -    * Property added to the receiver properties when opening an AMQP federation address or queue consumer
            -    * that indicates the consumer priority that should be used when creating the remote consumer. The
            -    * value assign to the properties {@link Map} is a signed integer value.
            +    * Property added to the receiver properties when opening an AMQP federation address or queue consumer that indicates
            +    * the consumer priority that should be used when creating the remote consumer. The value assign to the properties
            +    * {@link Map} is a signed integer value.
                 */
                public static final Symbol FEDERATION_RECEIVER_PRIORITY = Symbol.getSymbol("priority");
             
                /**
            -    * Commands sent across the control link will each carry an operation type to indicate
            -    * the desired action the remote should take upon receipt of the command. The type of
            -    * command infers the payload of the structure of the message payload.
            +    * Commands sent across the control link will each carry an operation type to indicate the desired action the remote
            +    * should take upon receipt of the command. The type of command infers the payload of the structure of the message
            +    * payload.
                 */
                public static final Symbol OPERATION_TYPE = Symbol.getSymbol("x-opt-amq-federation-op-type");
             
                /**
            -    * Indicates that the message carries a federation queue match policy that should be
            -    * added to the remote for reverse federation of matching queue from the remote peer.
            +    * Indicates that the message carries a federation queue match policy that should be added to the remote for reverse
            +    * federation of matching queue from the remote peer.
                 */
                public static final String ADD_QUEUE_POLICY = "ADD_QUEUE_POLICY";
             
                /**
            -    * Indicates that the message carries a federation address match policy that should be
            -    * added to the remote for reverse federation of matching queue from the remote peer.
            +    * Indicates that the message carries a federation address match policy that should be added to the remote for
            +    * reverse federation of matching queue from the remote peer.
                 */
                public static final String ADD_ADDRESS_POLICY = "ADD_ADDRESS_POLICY";
             
            @@ -244,9 +237,9 @@ public final class AMQPFederationConstants {
                public static final String ADDRESS_ENABLE_DIVERT_BINDINGS = "enable-divert-bindings";
             
                /**
            -    * Encodes a {@link Map} of String keys and values that are carried along in the federation
            -    * policy (address or queue). These values can be used to add extended configuration to the
            -    * policy object such as overriding settings from the connection URI.
            +    * Encodes a {@link Map} of String keys and values that are carried along in the federation policy (address or
            +    * queue). These values can be used to add extended configuration to the policy object such as overriding settings
            +    * from the connection URI.
                 */
                public static final String POLICY_PROPERTIES_MAP = "policy-properties-map";
             
            @@ -256,79 +249,72 @@ public final class AMQPFederationConstants {
                public static final String TRANSFORMER_CLASS_NAME = "transformer-class-name";
             
                /**
            -    * Encodes a {@link Map} of String keys and values that are applied to the transformer
            -    * configuration for the policy.
            +    * Encodes a {@link Map} of String keys and values that are applied to the transformer configuration for the policy.
                 */
                public static final String TRANSFORMER_PROPERTIES_MAP = "transformer-properties-map";
             
                /**
            -    * Events sent across the events link will each carry an event type to indicate
            -    * the event type which controls how the remote reacts to the given event. The type of
            -    * event infers the payload of the structure of the message payload.
            +    * Events sent across the events link will each carry an event type to indicate the event type which controls how the
            +    * remote reacts to the given event. The type of event infers the payload of the structure of the message payload.
                 */
                public static final Symbol EVENT_TYPE = Symbol.getSymbol("x-opt-amq-federation-ev-type");
             
                /**
            -    * Indicates that the message carries an address and queue name that was previously
            -    * requested but did not exist, or that was federated but the remote consumer was closed
            -    * due to removal of the queue on the target peer.
            +    * Indicates that the message carries an address and queue name that was previously requested but did not exist, or
            +    * that was federated but the remote consumer was closed due to removal of the queue on the target peer.
                 */
                public static final String REQUESTED_QUEUE_ADDED = "REQUESTED_QUEUE_ADDED_EVENT";
             
                /**
            -    * Indicates that the message carries an address name that was previously requested
            -    * but did not exist, or that was federated but the remote consumer was closed due to
            -    * removal of the address on the target peer.
            +    * Indicates that the message carries an address name that was previously requested but did not exist, or that was
            +    * federated but the remote consumer was closed due to removal of the address on the target peer.
                 */
                public static final String REQUESTED_ADDRESS_ADDED = "REQUESTED_ADDRESS_ADDED_EVENT";
             
                /**
            -    * Carries the name of a Queue that was either not present when a federation consumer was
            -    * initiated and subsequently rejected, or was removed and has been recreated.
            +    * Carries the name of a Queue that was either not present when a federation consumer was initiated and subsequently
            +    * rejected, or was removed and has been recreated.
                 */
                public static final String REQUESTED_QUEUE_NAME = "REQUESTED_QUEUE_NAME";
             
                /**
            -    * Carries the name of an Address that was either not present when a federation consumer was
            -    * initiated and subsequently rejected, or was removed and has been recreated.
            +    * Carries the name of an Address that was either not present when a federation consumer was initiated and
            +    * subsequently rejected, or was removed and has been recreated.
                 */
                public static final String REQUESTED_ADDRESS_NAME = "REQUESTED_ADDRESS_NAME";
             
                /**
            -    * When a federation receiver link is being drained due to removal of local demand this timeout
            -    * value enforces a maximum wait for drain and processing of in-flight messages before the link
            -    * is forcibly terminated with the assumption that the remote is no longer responding.
            +    * When a federation receiver link is being drained due to removal of local demand this timeout value enforces a
            +    * maximum wait for drain and processing of in-flight messages before the link is forcibly terminated with the
            +    * assumption that the remote is no longer responding.
                 */
                public static final String RECEIVER_QUIESCE_TIMEOUT = "receiverQuiesceTimeout";
             
                /**
            -    * When a federation address receiver link has been successfully drained after demand was removed
            -    * from the federated resource, this value controls how long the link can remain in an attached but
            -    * idle state before it is closed.
            +    * When a federation address receiver link has been successfully drained after demand was removed from the federated
            +    * resource, this value controls how long the link can remain in an attached but idle state before it is closed.
                 */
                public static final String ADDRESS_RECEIVER_IDLE_TIMEOUT = "addressReceiverIdleTimeout";
             
                /**
            -    * When a federation queue receiver link has been successfully drained after demand was removed
            -    * from the federated resource, this value controls how long the link can remain in an attached but
            -    * idle state before it is closed.
            +    * When a federation queue receiver link has been successfully drained after demand was removed from the federated
            +    * resource, this value controls how long the link can remain in an attached but idle state before it is closed.
                 */
                public static final String QUEUE_RECEIVER_IDLE_TIMEOUT = "queueReceiverIdleTimeout";
             
                /**
            -    * Property name used to carry the name of the federation that triggered creation of the remote
            -    * connection. This value is intended to be added to AMQP control link properties to provide the
            -    * remote peer with the name of the federation that triggered the creation of the control link
            -    * and allow for lookup of metrics or other data associated with a remote federation targets.
            +    * Property name used to carry the name of the federation that triggered creation of the remote connection. This
            +    * value is intended to be added to AMQP control link properties to provide the remote peer with the name of the
            +    * federation that triggered the creation of the control link and allow for lookup of metrics or other data
            +    * associated with a remote federation targets.
                 */
                public static final Symbol FEDERATION_NAME = Symbol.valueOf("federationName");
             
                /**
            -    * Property name used to carry the name of the federation policy that triggered creation of the
            -    * remote resource. This value is intended to be added to AMQP link properties to provide the
            -    * remote peer with the name of the federation policy that triggered the creation of the link
            -    * and allow for lookup of metrics or other data associated with a remote policy as links or
            -    * connections are torn down and re-estabilished.
            +    * Property name used to carry the name of the federation policy that triggered creation of the remote resource. This
            +    * value is intended to be added to AMQP link properties to provide the remote peer with the name of the federation
            +    * policy that triggered the creation of the link and allow for lookup of metrics or other data associated with a
            +    * remote policy as links or connections are torn down and re-estabilished.
                 */
                public static final Symbol FEDERATION_POLICY_NAME = Symbol.valueOf("federationPolicyName");
             
            diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumer.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumer.java
            index 3428fc6d497..e83bd14d635 100644
            --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumer.java
            +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumer.java
            @@ -112,35 +112,35 @@ public AMQPFederationConsumer(AMQPFederationLocalPolicyManager manager, AMQPFede
                }
             
                /**
            -    * @return the type of federation consumer being represented.
            +    * {@return the type of federation consumer being represented}
                 */
                public final Role getRole() {
                   return consumerInfo.getRole();
                }
             
                /**
            -    * @return the number of messages this consumer has received from the remote during its lifetime.
            +    * {@return the number of messages this consumer has received from the remote during its lifetime}
                 */
                public final long getMessagesReceived() {
                   return metrics.getMessagesReceived();
                }
             
                /**
            -    * @return the federation policy manager that created this consumer instance.
            +    * {@return the federation policy manager that created this consumer instance}
                 */
                public AMQPFederationLocalPolicyManager getPolicyManager() {
                   return manager;
                }
             
                /**
            -    * @return the consumer configuration that was assigned to this federation consumer.
            +    * {@return the consumer configuration that was assigned to this federation consumer}
                 */
                public AMQPFederationConsumerConfiguration getConfiguration() {
                   return configuration;
                }
             
                /**
            -    * @return the idle timeout value that is used applied to quiesced receivers.
            +    * {@return the idle timeout value that is used applied to quiesced receivers}
                 */
                public abstract int getReceiverIdleTimeout();
             
            @@ -155,17 +155,16 @@ public final FederationConsumerInfo getConsumerInfo() {
                }
             
                /**
            -    * @return true if the consumer has previously been initialized.
            +    * {@return {@code true} if the consumer has previously been initialized}
                 */
                public final boolean isInitialized() {
                   return initialized;
                }
             
                /**
            -    * Called to initialize the AMQP federation consumer which will trigger an asynchronous
            -    * task to attach the link and handle all setup receiver and eventually start the flow
            -    * of credit to the remote. This method should be called once after the basic configuration
            -    * of the consumer is complete and should not be called again after that.
            +    * Called to initialize the AMQP federation consumer which will trigger an asynchronous task to attach the link and
            +    * handle all setup receiver and eventually start the flow of credit to the remote. This method should be called once
            +    * after the basic configuration of the consumer is complete and should not be called again after that.
                 */
                public void initialize() {
                   if (initialized) {
            @@ -177,34 +176,32 @@ public void initialize() {
                }
             
                /**
            -    * Called during the initialization of the consumer to trigger an asynchronous link
            -    * attach of the underlying AMQP receiver that backs this federation consumer. The new
            -    * receiver should be initialized in a started state. This method executes on the
            -    * connection thread and should not block. This method will be called from the thread
            -    * of the connection this consumer operates on.
            +    * Called during the initialization of the consumer to trigger an asynchronous link attach of the underlying AMQP
            +    * receiver that backs this federation consumer. The new receiver should be initialized in a started state. This
            +    * method executes on the connection thread and should not block. This method will be called from the thread of the
            +    * connection this consumer operates on.
                 */
                protected abstract void doCreateReceiver();
             
                /**
            -    * Asynchronously starts a previously stopped federation consumer which should trigger a grant
            -    * of credit to the remote thereby allowing new incoming messages to be federated. In general
            -    * the start should only happen when the receiver is know to be stopped but given the asynchronous
            -    * nature of the receiver handling this won't always be the case, below the outcomes of various
            -    * cases that could result from calls to this method. The completion methods are always called
            -    * from a different thread than this method is called in which means the caller should ensure
            -    * that the handling accounts for thread safety of those methods.
            +    * Asynchronously starts a previously stopped federation consumer which should trigger a grant of credit to the
            +    * remote thereby allowing new incoming messages to be federated. In general the start should only happen when the
            +    * receiver is know to be stopped but given the asynchronous nature of the receiver handling this won't always be the
            +    * case, below the outcomes of various cases that could result from calls to this method. The completion methods are
            +    * always called from a different thread than this method is called in which means the caller should ensure that the
            +    * handling accounts for thread safety of those methods.
                 * 

            * Calling start on an already closed consumer should immediately throw an {@link IllegalStateException} immediately. - * Calling start on an non-initialized consumer should immediately throw an {@link IllegalStateException} immediately. + * Calling start on an non-initialized consumer should immediately throw an {@link IllegalStateException} + * immediately. *

            - * Calling start on a stopped consumer should start the consumer and signal success to the completion. - * Calling start on an already started consumer should simply signal success to the completion. - * Calling start on a stopping consumer should fail the completion with an {@link IllegalStateException}. - * Calling start on a consumer that closes while the start is in-flight should fail the completion - * with an {@link IllegalStateException} + * Calling start on a stopped consumer should start the consumer and signal success to the completion. Calling start + * on an already started consumer should simply signal success to the completion. Calling start on a stopping + * consumer should fail the completion with an {@link IllegalStateException}. Calling start on a consumer that closes + * while the start is in-flight should fail the completion with an {@link IllegalStateException} * - * @param completion - * A {@link AMQPFederationAsyncCompletion} that will be notified when the stop request succeeds or fails. + * @param completion A {@link AMQPFederationAsyncCompletion} that will be notified when the stop request succeeds or + * fails. */ public final void startAsync(AMQPFederationAsyncCompletion completion) { Objects.requireNonNull(completion, "The asynchronous completion object cannot be null"); @@ -234,25 +231,22 @@ public final void startAsync(AMQPFederationAsyncCompletion - * Since the request to stop can take time to complete and this method cannot block - * a completion must be provided by the caller that will respond when the consumer - * has fully come to rest and all pending work is complete. Before the stopped - * completion is signaled the state of the underlying consumer will be stopping and - * attempt to restart it should fail until the stopped state has been reached. + * Since the request to stop can take time to complete and this method cannot block a completion must be provided by + * the caller that will respond when the consumer has fully come to rest and all pending work is complete. Before the + * stopped completion is signaled the state of the underlying consumer will be stopping and attempt to restart it + * should fail until the stopped state has been reached. *

            - * The supplied {@link AMQPFederationAsyncCompletion} will be completed successfully - * once the underling AMQP receiver has drained and pending work is completed. If the - * stop does not complete by the supplied timeout the completion will be signaled that - * a failure has occurred with a {@link TimeoutException}. The completion methods are - * always called from a different thread than this method is called in which means the - * caller should ensure that the handling accounts for thread safety of those methods. + * The supplied {@link AMQPFederationAsyncCompletion} will be completed successfully once the underling AMQP receiver + * has drained and pending work is completed. If the stop does not complete by the supplied timeout the completion + * will be signaled that a failure has occurred with a {@link TimeoutException}. The completion methods are always + * called from a different thread than this method is called in which means the caller should ensure that the + * handling accounts for thread safety of those methods. * - * @param completion - * A {@link AMQPFederationAsyncCompletion} that will be notified when the stop request succeeds or fails. + * @param completion A {@link AMQPFederationAsyncCompletion} that will be notified when the stop request succeeds or + * fails. */ public final void stopAsync(AMQPFederationAsyncCompletion completion) { Objects.requireNonNull(completion, "The asynchronous completion object cannot be null"); @@ -287,10 +281,9 @@ public final void stopAsync(AMQPFederationAsyncCompletiontrue if the receiver has already been closed. + * {@return {@code true} if the receiver has already been closed} */ public boolean isClosed() { return closed.get(); } /** - * Provides and event point for notification of the receiver having been opened successfully - * by the remote. This handler will not be called if the remote rejects the link attach and - * a {@link Detach} is expected to follow. + * Provides and event point for notification of the receiver having been opened successfully by the remote. This + * handler will not be called if the remote rejects the link attach and a {@link Detach} is expected to follow. * - * @param handler - * The handler that will be invoked when the remote opens this receiver. - * - * @return this receiver instance. + * @param handler The handler that will be invoked when the remote opens this receiver. + * @return this receiver instance */ public final AMQPFederationConsumer setRemoteOpenHandler(Consumer handler) { if (protonReceiver != null) { @@ -349,13 +339,10 @@ public final AMQPFederationConsumer setRemoteOpenHandler(Consumer handler) { if (protonReceiver != null) { @@ -392,8 +379,7 @@ protected final boolean remoteLinkClosedInterceptor(Link link) { /** * Called from a subclass upon handling an incoming federated message from the remote. * - * @param message - * The original message that arrived from the remote. + * @param message The original message that arrived from the remote. */ protected final void recordFederatedMessageReceived(Message message) { metrics.incrementMessagesReceived(); @@ -402,9 +388,7 @@ protected final void recordFederatedMessageReceived(Message message) { /** * Called before the message is dispatched to the broker for processing. * - * @param message - * The message after any processing which is about to be dispatched. - * + * @param message The message after any processing which is about to be dispatched. * @throws ActiveMQException if any broker plugin throws an exception during its processing. */ protected final void signalPluginBeforeFederationConsumerMessageHandled(Message message) throws ActiveMQException { @@ -422,9 +406,7 @@ protected final void signalPluginBeforeFederationConsumerMessageHandled(Message /** * Called after the message is dispatched to the broker for processing. * - * @param message - * The message after any processing which has been dispatched to the broker. - * + * @param message The message after any processing which has been dispatched to the broker. * @throws ActiveMQException if any broker plugin throws an exception during its processing. */ protected final void signalPluginAfterFederationConsumerMessageHandled(Message message) throws ActiveMQException { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerConfiguration.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerConfiguration.java index 4b4c4c172c5..d8d51e28356 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerConfiguration.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerConfiguration.java @@ -17,6 +17,13 @@ package org.apache.activemq.artemis.protocol.amqp.connect.federation; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import org.apache.activemq.artemis.protocol.amqp.proton.AmqpSupport; + import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.ADDRESS_RECEIVER_IDLE_TIMEOUT; import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.IGNORE_QUEUE_CONSUMER_FILTERS; import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.IGNORE_QUEUE_CONSUMER_PRIORITIES; @@ -28,18 +35,9 @@ import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.RECEIVER_CREDITS_LOW; import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.RECEIVER_QUIESCE_TIMEOUT; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import org.apache.activemq.artemis.protocol.amqp.proton.AmqpSupport; -import org.apache.qpid.proton.engine.Receiver; - /** - * Configuration options applied to a consumer created from federation policies - * for address or queue federation. The options first check the policy properties - * for matching configuration settings before looking at the federation's own + * Configuration options applied to a consumer created from federation policies for address or queue federation. The + * options first check the policy properties for matching configuration settings before looking at the federation's own * configuration for the options managed here. */ public final class AMQPFederationConsumerConfiguration { @@ -61,7 +59,7 @@ public AMQPFederationConsumerConfiguration(AMQPFederationConfiguration configura } /** - * @return the credit batch size offered to a {@link Receiver} link. + * {@return the credit batch size offered to a {@link org.apache.qpid.proton.engine.Receiver} link} */ public int getReceiverCredits() { final Object property = properties.get(RECEIVER_CREDITS); @@ -75,7 +73,8 @@ public int getReceiverCredits() { } /** - * @return the number of remaining credits on a {@link Receiver} before the batch is replenished. + * {@return the number of remaining credits on a {@link org.apache.qpid.proton.engine.Receiver} before the batch is + * replenished} */ public int getReceiverCreditsLow() { final Object property = properties.get(RECEIVER_CREDITS_LOW); @@ -89,7 +88,7 @@ public int getReceiverCreditsLow() { } /** - * @return the receiver drain timeout for a stopping federation consumer before it is closed. + * {@return the receiver drain timeout for a stopping federation consumer before it is closed} */ public int getReceiverQuiesceTimeout() { final Object property = properties.get(RECEIVER_QUIESCE_TIMEOUT); @@ -103,7 +102,7 @@ public int getReceiverQuiesceTimeout() { } /** - * @return the idle timeout for a drained federation address consumer before it is closed. + * {@return the idle timeout for a drained federation address consumer before it is closed} */ public int getAddressReceiverIdleTimeout() { final Object property = properties.get(ADDRESS_RECEIVER_IDLE_TIMEOUT); @@ -117,7 +116,7 @@ public int getAddressReceiverIdleTimeout() { } /** - * @return the idle timeout for a drained federation queue consumer before it is closed. + * {@return the idle timeout for a drained federation queue consumer before it is closed} */ public int getQueueReceiverIdleTimeout() { final Object property = properties.get(QUEUE_RECEIVER_IDLE_TIMEOUT); @@ -131,7 +130,8 @@ public int getQueueReceiverIdleTimeout() { } /** - * @return the credit batch size offered to a {@link Receiver} link that is in pull mode. + * {@return the credit batch size offered to a {@link org.apache.qpid.proton.engine.Receiver} link that is in pull + * mode} */ public int getPullReceiverBatchSize() { final Object property = properties.get(PULL_RECEIVER_BATCH_SIZE); @@ -145,7 +145,8 @@ public int getPullReceiverBatchSize() { } /** - * @return the size in bytes of an incoming message after which the {@link Receiver} treats it as large. + * {@return the size in bytes of an incoming message after which the {@link org.apache.qpid.proton.engine.Receiver} + * treats it as large} */ public int getLargeMessageThreshold() { final Object property = properties.get(LARGE_MESSAGE_THRESHOLD); @@ -159,7 +160,7 @@ public int getLargeMessageThreshold() { } /** - * @return the timeout value to use when waiting for a corresponding link attach from the remote. + * {@return the timeout value to use when waiting for a corresponding link attach from the remote} */ public int getLinkAttachTimeout() { final Object property = properties.get(LINK_ATTACH_TIMEOUT); @@ -173,7 +174,7 @@ public int getLinkAttachTimeout() { } /** - * @return true if the federation is configured to tunnel core messages as AMQP custom messages. + * {@return {@code true} if the federation is configured to tunnel core messages as AMQP custom messages} */ public boolean isCoreMessageTunnelingEnabled() { final Object property = properties.get(AmqpSupport.TUNNEL_CORE_MESSAGES); @@ -187,7 +188,7 @@ public boolean isCoreMessageTunnelingEnabled() { } /** - * @return true if federation is configured to ignore filters on individual queue consumers + * {@return {@code true} if federation is configured to ignore filters on individual queue consumers} */ public boolean isIgnoreSubscriptionFilters() { final Object property = properties.get(IGNORE_QUEUE_CONSUMER_FILTERS); @@ -201,7 +202,7 @@ public boolean isIgnoreSubscriptionFilters() { } /** - * @return true if federation is configured to ignore priorities on individual queue consumers + * {@return {@code true} if federation is configured to ignore priorities on individual queue consumers} */ public boolean isIgnoreSubscriptionPriorities() { final Object property = properties.get(IGNORE_QUEUE_CONSUMER_PRIORITIES); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerControl.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerControl.java index 37a16fd519f..6ab45b329af 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerControl.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerControl.java @@ -19,30 +19,29 @@ import org.apache.activemq.artemis.api.core.management.Attribute; /** - * Management interface that is backed by an active federation consumer - * that was created when demand was applied to a matching address or queue. + * Management interface that is backed by an active federation consumer that was created when demand was applied to a + * matching address or queue. */ public interface AMQPFederationConsumerControl { /** - * Returns the number of messages this federation consumer has received from the remote + * {@return the number of messages this federation consumer has received from the remote} */ @Attribute(desc = "returns the number of messages this federation consumer has received from the remote") long getMessagesReceived(); /** - * @return the type of federation consumer being represented. + * {@return the type of federation consumer being represented} */ @Attribute(desc = "AMQP federation consumer type (address or queue) that backs this instance.") String getRole(); /** * Gets the queue name that will be used for this federation consumer instance. - * - * For Queue federation this will be the name of the queue whose messages are - * being federated to this server instance. For an Address federation this will - * be an automatically generated name that should be unique to a given federation - * instance + *

            + * For Queue federation this will be the name of the queue whose messages are being federated to this server + * instance. For an Address federation this will be an automatically generated name that should be unique to a given + * federation instance * * @return the queue name associated with the federation consumer */ @@ -51,52 +50,47 @@ public interface AMQPFederationConsumerControl { /** * Gets the address that will be used for this federation consumer instance. + *

            + * For Queue federation this is the address under which the matching queue must reside. For Address federation this + * is the actual address whose messages are being federated. * - * For Queue federation this is the address under which the matching queue must - * reside. For Address federation this is the actual address whose messages are - * being federated. - * - * @return the address associated with this federation consumer. + * @return the address associated with this federation consumer */ @Attribute(desc = "the address name associated with the federation consumer.") String getAddress(); /** - * Gets the FQQN that comprises the address and queue where the remote consumer - * will be attached. + * Gets the FQQN that comprises the address and queue where the remote consumer will be attached. * - * @return provides the FQQN that can be used to address the consumer queue directly. + * @return provides the FQQN that can be used to address the consumer queue directly */ @Attribute(desc = "the FQQN associated with the federation consumer.") String getFqqn(); /** - * Gets the routing type that will be requested when creating a consumer on the - * remote server. + * Gets the routing type that will be requested when creating a consumer on the remote server. * - * @return the routing type of the remote consumer. + * @return the routing type of the remote consumer */ @Attribute(desc = "the Routing Type associated with the federation consumer.") String getRoutingType(); /** * Gets the filter string that will be used when creating the remote consumer. + *

            + * For Queue federation this will be the filter that exists on the local queue that is requesting federation of + * messages from the remote. For address federation this filter will be used to restrict some movement of messages + * amongst federated server addresses. * - * For Queue federation this will be the filter that exists on the local queue that - * is requesting federation of messages from the remote. For address federation this - * filter will be used to restrict some movement of messages amongst federated server - * addresses. - * - * @return the filter string in use for the federation consumer. + * @return the filter string in use for the federation consumer */ @Attribute(desc = "the filter string associated with the federation consumer.") String getFilterString(); /** - * Gets the priority value that will be requested for the remote consumer that is - * created. + * Gets the priority value that will be requested for the remote consumer that is created. * - * @return the assigned consumer priority for the federation consumer. + * @return the assigned consumer priority for the federation consumer */ @Attribute(desc = "the assigned priority of the the federation consumer.") int getPriority(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerManager.java index 2fe4375740b..6c0577ed849 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationConsumerManager.java @@ -26,14 +26,12 @@ import org.slf4j.LoggerFactory; /** - * An abstract base for managing federation consumer instances that holds the demand - * currently present for a federated resource and the consumer that exists to service - * that demand. This object manages the state of the consumer and the various stages - * it can pass through during its lifetime. - * - * All interactions with the consumer tracking entry should occur under the lock of - * the parent manager instance and this manager will perform any asynchronous work - * with a lock held on the parent manager instance. + * An abstract base for managing federation consumer instances that holds the demand currently present for a federated + * resource and the consumer that exists to service that demand. This object manages the state of the consumer and the + * various stages it can pass through during its lifetime. + *

            + * All interactions with the consumer tracking entry should occur under the lock of the parent manager instance and this + * manager will perform any asynchronous work with a lock held on the parent manager instance. */ public abstract class AMQPFederationConsumerManager { @@ -62,10 +60,9 @@ public AMQPFederationConsumerManager(AMQPFederationLocalPolicyManager manager) { } /** - * An orderly shutdown of the federation consumer which will perform a drain - * of link credit before closing the consumer to ensure that all in-flight - * messages and dispositions are processed before the link is detached. - * + * An orderly shutdown of the federation consumer which will perform a drain of link credit before closing the + * consumer to ensure that all in-flight messages and dispositions are processed before the link is detached. + *

            * The federation manager should be calling this method with its lock held. */ public void shutdown() { @@ -73,9 +70,9 @@ public void shutdown() { } /** - * An immediate close of the federation consumer which does not drain link credit - * or wait for any pending operations to complete. - * + * An immediate close of the federation consumer which does not drain link credit or wait for any pending operations + * to complete. + *

            * The federation manager should be calling this method with its lock held. */ public void shutdownNow() { @@ -108,12 +105,11 @@ private void handleShutdown(boolean stopFirst) { } /** - * Attempt to recover a stopped consumer if this manager is not in the closed - * state and there is active demand registered. When in the stopped state the - * existing consumer will be restarted and if no active consumer exists then a - * new consumer is created. If this is called while a consumer is in the started - * state then this operation is a no-op and the consumer is left as is. - * + * Attempt to recover a stopped consumer if this manager is not in the closed state and there is active demand + * registered. When in the stopped state the existing consumer will be restarted and if no active consumer exists + * then a new consumer is created. If this is called while a consumer is in the started state then this operation is + * a no-op and the consumer is left as is. + *

            * The federation manager should be calling this method with its lock held. */ public void recover() { @@ -131,23 +127,22 @@ public void recover() { } /** - * Add new demand to the consumer manager which creates or sustains the consumer lifetime - * that this manager maintains. When the first element of demand is added a new consumer - * is attached and when the last unit of demand is removed the consumer will be closed. - * + * Add new demand to the consumer manager which creates or sustains the consumer lifetime that this manager + * maintains. When the first element of demand is added a new consumer is attached and when the last unit of demand + * is removed the consumer will be closed. + *

            * The federation manager should be calling this method with its lock held. * - * @param demand - * A new unit of demand to add to this consumer manager. + * @param demand A new unit of demand to add to this consumer manager. */ public void addDemand(Object demand) { checkClosed(); demandTracking.add(demand); - // This will create a new consumer only if there isn't one currently assigned to this - // entry and any configured federation plugins don't block it from doing so. An already - // stopping consumer will check on stop if it should restart. + // This will create a new consumer only if there isn't one currently assigned to this entry and any configured + // federation plugins don't block it from doing so. An already stopping consumer will check on stop if it should + // restart. if (state == State.STOPPED) { tryRestartFederationConsumer(); } else if (state == State.READY) { @@ -156,15 +151,13 @@ public void addDemand(Object demand) { } /** - * Remove the given element from the tracked consumer demand. If the tracked demand reaches - * zero then the managed consumer should be closed and the manager awaits future demand to - * be added. The manager can opt to hold a stopped consumer open for some period of time to - * avoid spurious open and closes as demand is added and removed. - * + * Remove the given element from the tracked consumer demand. If the tracked demand reaches zero then the managed + * consumer should be closed and the manager awaits future demand to be added. The manager can opt to hold a stopped + * consumer open for some period of time to avoid spurious open and closes as demand is added and removed. + *

            * The federation manager should be calling this method with its lock held. * - * @param demand - * The element of demand that should be removed from tracking. + * @param demand The element of demand that should be removed from tracking. */ public void removeDemand(Object demand) { checkClosed(); @@ -178,10 +171,7 @@ public void removeDemand(Object demand) { } } - /* - * Must be called with locks in place from the parent manager to prevent concurrent - * access to state changing APIs. - */ + // Must be called with locks in place from the parent manager to prevent concurrent access to state changing APIs. private void tryCreateFederationConsumer() { if (!isPluginBlockingFederationConsumerCreate()) { state = State.STARTING; @@ -201,13 +191,12 @@ private void tryCreateFederationConsumer() { } }); - // Handle remote close with remove of consumer which means that future demand will - // attempt to create a new consumer for that demand. Ensure that thread safety is - // accounted for here as the notification can be asynchronous. We do not automatically - // recreate a consumer here as we anticipate the remote will send an event when there - // is an update for resources we are interested in or we will close the connection due - // to a close happening for an unexplained or unanticipated reason. This event only - // files if the consumer wasn't locally closed first. + // Handle remote close with remove of consumer which means that future demand will attempt to create a new + // consumer for that demand. Ensure that thread safety is accounted for here as the notification can be + // asynchronous. We do not automatically recreate a consumer here as we anticipate the remote will send an + // event when there is an update for resources we are interested in or we will close the connection due to a + // close happening for an unexplained or unanticipated reason. This event only files if the consumer wasn't + // locally closed first. consumer.setRemoteClosedHandler((closedConsumer) -> { synchronized (manager) { safeCloseCurrentFederationConsumer(); @@ -222,10 +211,7 @@ private void tryCreateFederationConsumer() { } } - /* - * Must be called with locks in place from the parent manager to prevent concurrent - * access to state changing APIs. - */ + // Must be called with locks in place from the parent manager to prevent concurrent access to state changing APIs. private void tryRestartFederationConsumer() { state = State.STARTING; @@ -277,10 +263,7 @@ public void onException(AMQPFederationConsumer consumer, Exception error) { } } - /* - * Must be called with locks in place from the parent manager to prevent concurrent - * access to state changing APIs. - */ + // Must be called with locks in place from the parent manager to prevent concurrent access to state changing APIs. private void tryStopFederationConsumer() { if (consumer != null && state != State.STOPPING) { // Retain closed state if close is attempting a safe shutdown. @@ -307,10 +290,7 @@ public void onException(AMQPFederationConsumer consumer, Exception error) { } } - /* - * Must be called with locks in place from the parent manager to prevent concurrent - * access to state changing APIs. - */ + // Must be called with locks in place from the parent manager to prevent concurrent access to state changing APIs. private void handleFederationConsumerStopped(AMQPFederationConsumer stoppedConsumer, boolean didStop) { // Remote close or local resource remove could have beaten us here and already cleaned up the consumer. if (state == State.STOPPING) { @@ -393,20 +373,18 @@ private void checkClosed() { } /** - * Creates a new federation consumer that this manager will monitor and maintain. The returned - * consumer should be in an initial state ready for this manager to initialize once it is fully - * configured. + * Creates a new federation consumer that this manager will monitor and maintain. The returned consumer should be in + * an initial state ready for this manager to initialize once it is fully configured. * - * @return a newly create {@link AMQPFederationConsumer} for use by this manager. + * @return a newly create {@link AMQPFederationConsumer} for use by this manager */ protected abstract AMQPFederationConsumer createFederationConsumer(); /** - * Query all registered plugins for this federation instance to determine if any wish to - * prevent a federation consumer from being created for the given resource managed by - * the implementation class. + * Query all registered plugins for this federation instance to determine if any wish to prevent a federation + * consumer from being created for the given resource managed by the implementation class. * - * @return true if any registered plugin signaled that creation should be suppressed. + * @return {@code true} if any registered plugin signaled that creation should be suppressed */ protected abstract boolean isPluginBlockingFederationConsumerCreate(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationControl.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationControl.java index c0aae160362..c3a9c6cccd3 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationControl.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationControl.java @@ -24,19 +24,19 @@ public interface AMQPFederationControl { /** - * Returns the configured name the AMQP federation being controlled + * {@return the configured name the AMQP federation being controlled} */ @Attribute(desc = "The configured AMQP federation name that backs this control instance.") String getName(); /** - * Returns the number of messages this federation has received from the remote. + * {@return the number of messages this federation has received from the remote} */ @Attribute(desc = "returns the number of messages this federation has received from the remote") long getMessagesReceived(); /** - * Returns the number of messages this federation has sent to the remote. + * {@return the number of messages this federation has sent to the remote} */ @Attribute(desc = "returns the number of messages this federation has sent to the remote") long getMessagesSent(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventDispatcher.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventDispatcher.java index 2ea0dbaccbc..308eb2a51b8 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventDispatcher.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventDispatcher.java @@ -53,8 +53,7 @@ import org.slf4j.LoggerFactory; /** - * Sender controller used to fire events from one side of an AMQP Federation connection - * to the other side. + * Sender controller used to fire events from one side of an AMQP Federation connection to the other side. */ public class AMQPFederationEventDispatcher implements SenderController, ActiveMQServerBindingPlugin, ActiveMQServerAddressPlugin { @@ -82,12 +81,10 @@ private String getEventsLinkAddress() { } /** - * Raw event send API that accepts an {@link AMQPMessage} instance and routes it using the - * server post office instance. - * - * @param event - * The event message to send to the previously created control address. + * Raw event send API that accepts an {@link AMQPMessage} instance and routes it using the server post office + * instance. * + * @param event The event message to send to the previously created control address. * @throws Exception if an error occurs during the message send. */ public void sendEvent(AMQPMessage event) throws Exception { @@ -114,18 +111,17 @@ public Consumer init(ProtonServerSenderContext senderContext) throws Exception { // We don't currently support SECOND so enforce that the answer is always FIRST sender.setReceiverSettleMode(ReceiverSettleMode.FIRST); - // Create a temporary queue using the unique link name which is where events will - // be sent to so that they can be held until credit is granted by the remote. + // Create a temporary queue using the unique link name which is where events will be sent to so that they can be + // held until credit is granted by the remote. eventsAddress = federation.prefixEventsLinkQueueName(sender.getName()); if (sender.getLocalState() != EndpointState.ACTIVE) { // Indicate that event link capabilities is supported. sender.setOfferedCapabilities(new Symbol[]{FEDERATION_EVENT_LINK}); - // When the federation source creates a events receiver link to receive events - // from the federation target side we land here on the target as this end should - // not be active yet, the federation source should request a dynamic source node - // to be created and we should return the address when opening this end. + // When the federation source creates a events receiver link to receive events from the federation target side + // we land here on the target as this end should not be active yet, the federation source should request a + // dynamic source node to be created and we should return the address when opening this end. final Terminus remoteTerminus = (Terminus) sender.getRemoteSource(); if (remoteTerminus == null || !remoteTerminus.getDynamic()) { @@ -168,28 +164,26 @@ public void close(ErrorCondition error) { } /** - * Add the given address name to the set of addresses that should be watched for and - * if added to the broker send an event to the remote indicating that it now exists - * and the remote should attempt to create a new address federation consumer. - * + * Add the given address name to the set of addresses that should be watched for and if added to the broker send an + * event to the remote indicating that it now exists and the remote should attempt to create a new address federation + * consumer. + *

            * This method must be called from the connection thread. * - * @param addressName - * The address name to watch for addition. + * @param addressName The address name to watch for addition. */ public void addAddressWatch(String addressName) { addressWatches.add(addressName); } /** - * Add the given queue name to the set of queues that should be watched for and - * if added to the broker send an event to the remote indicating that it now exists - * and the remote should attempt to create a new queue federation consumer. - * + * Add the given queue name to the set of queues that should be watched for and if added to the broker send an event + * to the remote indicating that it now exists and the remote should attempt to create a new queue federation + * consumer. + *

            * This method must be called from the connection thread. * - * @param queueName - * The queue name to watch for addition. + * @param queueName The queue name to watch for addition. */ public void addQueueWatch(String queueName) { queueWatches.add(queueName); @@ -199,9 +193,9 @@ public void addQueueWatch(String queueName) { public void afterAddAddress(AddressInfo addressInfo, boolean reload) throws ActiveMQException { final String addressName = addressInfo.getName().toString(); - // Run this on the connection thread so that rejection of a federation consumer - // and addition of the address can't race such that the consumer adds its intent - // concurrently with the address having been added and we miss the registration. + // Run this on the connection thread so that rejection of a federation consumer and addition of the address can't + // race such that the consumer adds its intent concurrently with the address having been added and we miss the + // registration. federation.getConnectionContext().runLater(() -> { if (addressWatches.remove(addressName)) { try { @@ -221,9 +215,9 @@ public void afterAddBinding(Binding binding) throws ActiveMQException { final String addressName = queueBinding.getAddress().toString(); final String queueName = queueBinding.getQueue().getName().toString(); - // Run this on the connection thread so that rejection of a federation consumer - // and addition of the binding can't race such that the consumer adds its intent - // concurrently with the binding having been added and we miss the registration. + // Run this on the connection thread so that rejection of a federation consumer and addition of the binding + // can't race such that the consumer adds its intent concurrently with the binding having been added and we + // miss the registration. federation.getConnectionContext().runLater(() -> { if (queueWatches.remove(queueName)) { try { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventProcessor.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventProcessor.java index 9bae954f061..ea826759f95 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventProcessor.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventProcessor.java @@ -49,9 +49,8 @@ import org.slf4j.LoggerFactory; /** - * A specialized AMQP Receiver that handles events from a remote Federation connection such - * as addition of addresses or queues where federation was requested but they did not exist - * at the time and the federation consumer was rejected. + * A specialized AMQP Receiver that handles events from a remote Federation connection such as addition of addresses or + * queues where federation was requested but they did not exist at the time and the federation consumer was rejected. */ public class AMQPFederationEventProcessor extends ProtonAbstractReceiver { @@ -66,12 +65,9 @@ public class AMQPFederationEventProcessor extends ProtonAbstractReceiver { /** * Create the new federation event receiver * - * @param federation - * The AMQP Federation instance that this event consumer resides in. - * @param session - * The associated session for this federation event consumer. - * @param receiver - * The proton {@link Receiver} that this event consumer reads from. + * @param federation The AMQP Federation instance that this event consumer resides in. + * @param session The associated session for this federation event consumer. + * @param receiver The proton {@link Receiver} that this event consumer reads from. */ public AMQPFederationEventProcessor(AMQPFederation federation, AMQPSessionContext session, Receiver receiver) { super(session.getSessionSPI(), session.getAMQPConnectionContext(), session, receiver); @@ -94,10 +90,9 @@ public void initialize() throws Exception { // Indicate that event link capabilities is supported. receiver.setOfferedCapabilities(new Symbol[]{FEDERATION_EVENT_LINK}); - // When the federation source creates a events sender link to send events to the - // federation target side we land here on the target as this end should not be - // active yet, the federation source should request a dynamic target node to be - // created and we should return the address when opening this end. + // When the federation source creates a events sender link to send events to the federation target side we land + // here on the target as this end should not be active yet, the federation source should request a dynamic + // target node to be created and we should return the address when opening this end. final Terminus remoteTerminus = (Terminus) receiver.getRemoteTarget(); if (remoteTerminus == null || !remoteTerminus.getDynamic()) { @@ -161,9 +156,9 @@ protected void actualDelivery(Message message, Delivery delivery, DeliveryAnnota @Override protected Runnable createCreditRunnable(AMQPConnectionContext connection) { - // The events processor is not bound to the configurable credit on the connection as it could be set - // to zero if trying to create pull federation consumers so we avoid any chance of that happening as - // otherwise there would be no credit granted for the remote to send us events. + // The events processor is not bound to the configurable credit on the connection as it could be set to zero if + // trying to create pull federation consumers so we avoid any chance of that happening as otherwise there would be + // no credit granted for the remote to send us events. return createCreditRunnable(PROCESSOR_RECEIVER_CREDITS, PROCESSOR_RECEIVER_CREDITS_LOW, receiver, connection, this); } diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventSupport.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventSupport.java index 9c272c79f77..6a85e6829f6 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventSupport.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationEventSupport.java @@ -46,17 +46,13 @@ public final class AMQPFederationEventSupport { /** - * Encode an event that indicates that a Queue that belongs to a federation - * request which was not present at the time of the request or was later removed - * is now present and the remote should check for demand and attempt to federate + * Encode an event that indicates that a Queue that belongs to a federation request which was not present at the time + * of the request or was later removed is now present and the remote should check for demand and attempt to federate * the resource once again. * - * @param address - * The address that the queue is currently bound to. - * @param queue - * The queue that was part of a previous federation request. - * - * @return the AMQP message with the encoded event data. + * @param address The address that the queue is currently bound to. + * @param queue The queue that was part of a previous federation request. + * @return the AMQP message with the encoded event data */ public static AMQPMessage encodeQueueAddedEvent(String address, String queue) { final Map annotations = new LinkedHashMap<>(); @@ -87,15 +83,12 @@ public static AMQPMessage encodeQueueAddedEvent(String address, String queue) { } /** - * Encode an event that indicates that an Address that belongs to a federation - * request which was not present at the time of the request or was later removed - * is now present and the remote should check for demand and attempt to federate - * the resource once again. + * Encode an event that indicates that an Address that belongs to a federation request which was not present at the + * time of the request or was later removed is now present and the remote should check for demand and attempt to + * federate the resource once again. * - * @param address - * The address portion of the previously failed federation request - * - * @return the AMQP message with the encoded event data. + * @param address The address portion of the previously failed federation request + * @return the AMQP message with the encoded event data */ public static AMQPMessage encodeAddressAddedEvent(String address) { final Map annotations = new LinkedHashMap<>(); @@ -125,15 +118,11 @@ public static AMQPMessage encodeAddressAddedEvent(String address) { } /** - * Decode and return the Map containing the event data for a Queue that was - * the target of a previous federation request which was not present on the - * remote server or was later removed has now been (re)added. - * - * @param message - * The event message that carries the event data in its body. - * - * @return a {@link Map} containing the payload of the incoming event. + * Decode and return the Map containing the event data for a Queue that was the target of a previous federation + * request which was not present on the remote server or was later removed has now been (re)added. * + * @param message The event message that carries the event data in its body. + * @return a {@link Map} containing the payload of the incoming event * @throws ActiveMQException if an error occurs while decoding the event data. */ @SuppressWarnings("unchecked") @@ -173,15 +162,11 @@ public static Map decodeQueueAddedEvent(AMQPMessage message) thr } /** - * Decode and return the Map containing the event data for an Address that was - * the target of a previous federation request which was not present on the - * remote server or was later removed has now been (re)added. - * - * @param message - * The event message that carries the event data in its body. - * - * @return a {@link Map} containing the payload of the incoming event. + * Decode and return the Map containing the event data for an Address that was the target of a previous federation + * request which was not present on the remote server or was later removed has now been (re)added. * + * @param message The event message that carries the event data in its body. + * @return a {@link Map} containing the payload of the incoming event * @throws ActiveMQException if an error occurs while decoding the event data. */ @SuppressWarnings("unchecked") diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationGenericConsumerInfo.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationGenericConsumerInfo.java index 799506766a5..e4dd65e68a4 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationGenericConsumerInfo.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationGenericConsumerInfo.java @@ -28,9 +28,8 @@ import org.apache.activemq.artemis.utils.CompositeAddress; /** - * Information and identification class for Federation consumers created to federate - * queues and addresses. Instances of this class should be usable in Collections - * classes where equality and hashing support is needed. + * Information and identification class for Federation consumers created to federate queues and addresses. Instances of + * this class should be usable in Collections classes where equality and hashing support is needed. */ public class AMQPFederationGenericConsumerInfo implements FederationConsumerInfo { @@ -61,20 +60,14 @@ public AMQPFederationGenericConsumerInfo(Role role, String address, String queue /** * Factory for creating federation address consumer information objects from server resources. * - * @param address - * The address being federated, the remote consumer will be created under this address. - * @param queueName - * The name of the remote queue that will be created in order to route messages here. - * @param routingType - * The routing type to assign the remote consumer. - * @param filterString - * A filter string used by the federation instance to limit what enters the remote queue. - * @param federation - * The parent {@link Federation} that this federation consumer is created for - * @param policy - * The {@link FederationReceiveFromAddressPolicy} that triggered this information object to be created. - * - * @return a newly created and configured {@link FederationConsumerInfo} instance. + * @param address The address being federated, the remote consumer will be created under this address. + * @param queueName The name of the remote queue that will be created in order to route messages here. + * @param routingType The routing type to assign the remote consumer. + * @param filterString A filter string used by the federation instance to limit what enters the remote queue. + * @param federation The parent {@link Federation} that this federation consumer is created for + * @param policy The {@link FederationReceiveFromAddressPolicy} that triggered this information object to be + * created. + * @return a newly created and configured {@link FederationConsumerInfo} instance */ public static AMQPFederationGenericConsumerInfo build(String address, String queueName, RoutingType routingType, String filterString, Federation federation, FederationReceiveFromAddressPolicy policy) { return new AMQPFederationGenericConsumerInfo(Role.ADDRESS_CONSUMER, diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationLocalPolicyControl.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationLocalPolicyControl.java index fb95750b0fa..0bddf0a733b 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationLocalPolicyControl.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationLocalPolicyControl.java @@ -24,19 +24,19 @@ public interface AMQPFederationLocalPolicyControl { /** - * Returns the type of the AMQP federation policy manager being controlled + * {@return the type of the AMQP federation policy manager being controlled} */ @Attribute(desc = "AMQP federation policy manager type that backs this control instance.") String getType(); /** - * Returns the configured name the AMQP federation policy manager being controlled + * {@return the configured name the AMQP federation policy manager being controlled} */ @Attribute(desc = "The configured AMQP federation policy name that backs this control instance.") String getName(); /** - * Returns the number of messages this federation policy has received from the remote. + * {@return the number of messages this federation policy has received from the remote} */ @Attribute(desc = "returns the number of messages this federation policy has received from the remote") long getMessagesReceived(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationLocalPolicyManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationLocalPolicyManager.java index ab98aeb1f8f..15a3670c529 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationLocalPolicyManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationLocalPolicyManager.java @@ -31,9 +31,8 @@ import org.slf4j.LoggerFactory; /** - * A federation policy manager for policies that operate on the local side of this broker - * connection. These policies will create consumers on the remote which federate message - * back to this broker instance. + * A federation policy manager for policies that operate on the local side of this broker connection. These policies + * will create consumers on the remote which federate message back to this broker instance. */ public abstract class AMQPFederationLocalPolicyManager extends AMQPFederationPolicyManager implements ActiveMQServerBindingPlugin { @@ -46,7 +45,7 @@ public AMQPFederationLocalPolicyManager(AMQPFederation federation, AMQPFederatio } /** - * @return the immutable federation policy configuration that backs this manager. + * {@return the immutable federation policy configuration that backs this manager} */ public abstract FederationReceiveFromResourcePolicy getPolicy(); @@ -94,8 +93,8 @@ protected final void handleConnectionInterrupted() { @Override protected final void handleConnectionRestored() { - // Capture state for the current connection on each connection as different URIs could have - // different options we need to capture in the current configuration state. + // Capture state for the current connection on each connection as different URIs could have different options we + // need to capture in the current configuration state. configuration = new AMQPFederationConsumerConfiguration(federation.getConfiguration(), getPolicy().getProperties()); if (isActive()) { @@ -104,44 +103,37 @@ protected final void handleConnectionRestored() { } /** - * Create a new {@link AMQPFederationConsumer} instance using the consumer information - * given. This is called when local demand for a matched resource requires a new consumer to - * be created. A subclass must override this to perform the create operation. + * Create a new {@link AMQPFederationConsumer} instance using the consumer information given. This is called when + * local demand for a matched resource requires a new consumer to be created. A subclass must override this to + * perform the create operation. * - * @param consumerInfo - * The {@link FederationConsumerInfo} that defines the consumer to be created. - * - * @return a new {@link AMQPFederationConsumer} instance that will reside in this manager. + * @param consumerInfo The {@link FederationConsumerInfo} that defines the consumer to be created. + * @return a new {@link AMQPFederationConsumer} instance that will reside in this manager */ protected abstract AMQPFederationConsumer createFederationConsumer(FederationConsumerInfo consumerInfo); /** - * Scans all bindings and push them through the normal bindings checks that - * would be done on an add. This allows for checks on demand after a start or - * after a connection is restored. + * Scans all bindings and push them through the normal bindings checks that would be done on an add. This allows for + * checks on demand after a start or after a connection is restored. */ protected abstract void scanAllBindings(); /** - * The subclass implements this method and should remove all tracked federation - * consumer data and also close all consumers either by first safely stopping the - * consumer or if offline simply closing the consumer. If the force flag is set to - * true the implementation should close the consumer without attempting to stop it - * by draining link credit before the close. + * The subclass implements this method and should remove all tracked federation consumer data and also close all + * consumers either by first safely stopping the consumer or if offline simply closing the consumer. If the force + * flag is set to true the implementation should close the consumer without attempting to stop it by draining link + * credit before the close. * - * @param force - * Should the implementation simply close the consumers without attempting a stop. + * @param force Should the implementation simply close the consumers without attempting a stop. */ protected abstract void safeCleanupManagerResources(boolean force); /** - * Attempts to close a federation consumer and signals the installed federation plugin - * of the impending and post closed state. The method will not double close a consumer - * as it checks the closed state. The method is synchronized to allow for use in asynchronous - * call backs from federation consumers. + * Attempts to close a federation consumer and signals the installed federation plugin of the impending and post + * closed state. The method will not double close a consumer as it checks the closed state. The method is + * synchronized to allow for use in asynchronous call backs from federation consumers. * - * @param federationConsuner - * A federation consumer to close, or null in which case no action is taken. + * @param federationConsuner A federation consumer to close, or null in which case no action is taken. */ protected synchronized void tryCloseFederationConsumer(AMQPFederationConsumer federationConsuner) { if (federationConsuner != null) { @@ -158,11 +150,9 @@ protected synchronized void tryCloseFederationConsumer(AMQPFederationConsumer fe } /** - * Signal any registered plugins for this federation instance that a remote consumer - * is being created. + * Signal any registered plugins for this federation instance that a remote consumer is being created. * - * @param info - * The {@link FederationConsumerInfo} that describes the remote federation consumer + * @param info The {@link FederationConsumerInfo} that describes the remote federation consumer */ protected final void signalPluginBeforeCreateFederationConsumer(FederationConsumerInfo info) { try { @@ -177,11 +167,9 @@ protected final void signalPluginBeforeCreateFederationConsumer(FederationConsum } /** - * Signal any registered plugins for this federation instance that a remote consumer - * has been created. + * Signal any registered plugins for this federation instance that a remote consumer has been created. * - * @param consumer - * The {@link FederationConsumerInfo} that describes the remote consumer + * @param consumer The {@link FederationConsumerInfo} that describes the remote consumer */ protected final void signalPluginAfterCreateFederationConsumer(FederationConsumer consumer) { try { @@ -196,11 +184,9 @@ protected final void signalPluginAfterCreateFederationConsumer(FederationConsume } /** - * Signal any registered plugins for this federation instance that a remote consumer - * is about to be closed. + * Signal any registered plugins for this federation instance that a remote consumer is about to be closed. * - * @param consumer - * The {@link FederationConsumer} that that is about to be closed. + * @param consumer The {@link FederationConsumer} that that is about to be closed. */ protected final void signalPluginBeforeCloseFederationConsumer(FederationConsumer consumer) { try { @@ -215,11 +201,9 @@ protected final void signalPluginBeforeCloseFederationConsumer(FederationConsume } /** - * Signal any registered plugins for this federation instance that a remote consumer - * has now been closed. + * Signal any registered plugins for this federation instance that a remote consumer has now been closed. * - * @param consumer - * The {@link FederationConsumer} that that has been closed. + * @param consumer The {@link FederationConsumer} that that has been closed. */ protected final void signalPluginAfterCloseFederationConsumer(FederationConsumer consumer) { try { @@ -234,13 +218,11 @@ protected final void signalPluginAfterCloseFederationConsumer(FederationConsumer } /** - * Query all registered plugins for this federation instance to determine if any wish to - * prevent a federation consumer from being created for the given resource. - * - * @param address - * The address on which the manager is intending to create a remote consumer for. + * Query all registered plugins for this federation instance to determine if any wish to prevent a federation + * consumer from being created for the given resource. * - * @return true if any registered plugin signaled that creation should be suppressed. + * @param address The address on which the manager is intending to create a remote consumer for. + * @return true if any registered plugin signaled that creation should be suppressed */ protected final boolean isPluginBlockingFederationConsumerCreate(AddressInfo address) { final AtomicBoolean canCreate = new AtomicBoolean(true); @@ -261,15 +243,12 @@ protected final boolean isPluginBlockingFederationConsumerCreate(AddressInfo add } /** - * Query all registered plugins for this federation instance to determine if any wish to - * prevent a federation consumer from being created for the given Queue. + * Query all registered plugins for this federation instance to determine if any wish to prevent a federation + * consumer from being created for the given Queue. * - * @param divert - * The {@link Divert} that triggered the manager to attempt to create a remote consumer. - * @param queue - * The {@link Queue} that triggered the manager to attempt to create a remote consumer. - * - * @return true if any registered plugin signaled that creation should be suppressed. + * @param divert The {@link Divert} that triggered the manager to attempt to create a remote consumer. + * @param queue The {@link Queue} that triggered the manager to attempt to create a remote consumer. + * @return true if any registered plugin signaled that creation should be suppressed */ protected final boolean isPluginBlockingFederationConsumerCreate(Divert divert, Queue queue) { final AtomicBoolean canCreate = new AtomicBoolean(true); @@ -290,13 +269,11 @@ protected final boolean isPluginBlockingFederationConsumerCreate(Divert divert, } /** - * Query all registered plugins for this federation instance to determine if any wish to - * prevent a federation consumer from being created for the given Queue. - * - * @param queue - * The {@link Queue} that triggered the manager to attempt to create a remote consumer. + * Query all registered plugins for this federation instance to determine if any wish to prevent a federation + * consumer from being created for the given Queue. * - * @return true if any registered plugin signaled that creation should be suppressed. + * @param queue The {@link Queue} that triggered the manager to attempt to create a remote consumer. + * @return true if any registered plugin signaled that creation should be suppressed */ protected final boolean isPluginBlockingFederationConsumerCreate(Queue queue) { final AtomicBoolean canCreate = new AtomicBoolean(true); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationManagementSupport.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationManagementSupport.java index 19558198aa6..6413182f3c8 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationManagementSupport.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationManagementSupport.java @@ -42,16 +42,16 @@ public abstract class AMQPFederationManagementSupport { public static final String FEDERATION_SOURCE_POLICY_RESOURCE_TEMPLATE = FEDERATION_SOURCE_RESOURCE_TEMPLATE + ".policy.%s"; /** - * Template used to denote federation consumers on the source in the server management registry. Since policy - * names are unique on the local broker AMQP federation configuration these names should not collide as each - * policy will create only one consumer for a given address or queue. + * Template used to denote federation consumers on the source in the server management registry. Since policy names + * are unique on the local broker AMQP federation configuration these names should not collide as each policy will + * create only one consumer for a given address or queue. */ public static final String FEDERATION_SOURCE_CONSUMER_RESOURCE_TEMPLATE = FEDERATION_SOURCE_POLICY_RESOURCE_TEMPLATE + ".consumer.%s"; /** - * Template used to denote federation producers on the source in the server management registry. Since policy - * names are unique on the local broker AMQP federation configuration these names should not collide as each - * policy will create only one producer for a given address or queue. + * Template used to denote federation producers on the source in the server management registry. Since policy names + * are unique on the local broker AMQP federation configuration these names should not collide as each policy will + * create only one producer for a given address or queue. */ public static final String FEDERATION_SOURCE_PRODUCER_RESOURCE_TEMPLATE = FEDERATION_SOURCE_POLICY_RESOURCE_TEMPLATE + ".producer.%s"; @@ -68,16 +68,16 @@ public abstract class AMQPFederationManagementSupport { public static final String FEDERATION_TARGET_POLICY_RESOURCE_TEMPLATE = FEDERATION_TARGET_RESOURCE_TEMPLATE + ".policy.%s"; /** - * Template used to denote federation consumers on the source in the server management registry. Since policy - * names are unique on the local broker AMQP federation configuration these names should not collide as each - * policy will create only one consumer for a given address or queue. + * Template used to denote federation consumers on the source in the server management registry. Since policy names + * are unique on the local broker AMQP federation configuration these names should not collide as each policy will + * create only one consumer for a given address or queue. */ public static final String FEDERATION_TARGET_CONSUMER_RESOURCE_TEMPLATE = FEDERATION_TARGET_POLICY_RESOURCE_TEMPLATE + ".consumer.%s"; /** - * Template used to denote federation producers on the source in the server management registry. Since policy - * names are unique on the local broker AMQP federation configuration these names should not collide as each - * policy will create only one producer for a given address or queue. + * Template used to denote federation producers on the source in the server management registry. Since policy names + * are unique on the local broker AMQP federation configuration these names should not collide as each policy will + * create only one producer for a given address or queue. */ public static final String FEDERATION_TARGET_PRODUCER_RESOURCE_TEMPLATE = FEDERATION_TARGET_POLICY_RESOURCE_TEMPLATE + ".producer.%s"; @@ -85,38 +85,38 @@ public abstract class AMQPFederationManagementSupport { // either source or target end of the broker connection. /** - * The template used to create the object name suffix that is appending to the broker connection - * object name when adding and removing AMQP federation policy control elements. + * The template used to create the object name suffix that is appending to the broker connection object name when + * adding and removing AMQP federation policy control elements. */ public static final String FEDERATION_NAME_TEMPLATE = "serviceCatagory=federations,federationName=%s"; /** - * The template used to create the object name suffix that is appending to the broker connection - * object name when adding and removing AMQP federation policy control elements. + * The template used to create the object name suffix that is appending to the broker connection object name when + * adding and removing AMQP federation policy control elements. */ public static final String FEDERATION_POLICY_NAME_TEMPLATE = FEDERATION_NAME_TEMPLATE + ",policyType=%s,policyName=%s"; /** - * The template used to create the object name suffix that is appending to the broker connection - * object name when adding and removing AMQP federation queue consumer control elements. + * The template used to create the object name suffix that is appending to the broker connection object name when + * adding and removing AMQP federation queue consumer control elements. */ public static final String FEDERATION_QUEUE_CONSUMER_NAME_TEMPLATE = FEDERATION_POLICY_NAME_TEMPLATE + ",linkType=consumers,fqqn=%s"; /** - * The template used to create the object name suffix that is appending to the broker connection - * object name when adding and removing AMQP federation address consumer control elements. + * The template used to create the object name suffix that is appending to the broker connection object name when + * adding and removing AMQP federation address consumer control elements. */ public static final String FEDERATION_ADDRESS_CONSUMER_NAME_TEMPLATE = FEDERATION_POLICY_NAME_TEMPLATE + ",linkType=consumers,address=%s"; /** - * The template used to create the object name suffix that is appending to the broker connection - * object name when adding and removing AMQP federation queue producer control elements. + * The template used to create the object name suffix that is appending to the broker connection object name when + * adding and removing AMQP federation queue producer control elements. */ public static final String FEDERATION_QUEUE_PRODUCER_NAME_TEMPLATE = FEDERATION_POLICY_NAME_TEMPLATE + ",linkType=producers,fqqn=%s"; /** - * The template used to create the object name suffix that is appending to the broker connection - * object name when adding and removing AMQP federation address producer control elements. + * The template used to create the object name suffix that is appending to the broker connection object name when + * adding and removing AMQP federation address producer control elements. */ public static final String FEDERATION_ADDRESS_PRODUCER_NAME_TEMPLATE = FEDERATION_POLICY_NAME_TEMPLATE + ",linkType=producers,address=%s"; @@ -125,9 +125,7 @@ public abstract class AMQPFederationManagementSupport { /** * Register the given {@link AMQPFederationSource} instance with the broker management services. * - * @param federation - * The federation source instance being registered with management. - * + * @param federation The federation source instance being registered with management. * @throws Exception if an error occurs while registering the federation with the management services. */ public static void registerFederationSource(AMQPFederationSource federation) throws Exception { @@ -144,9 +142,7 @@ public static void registerFederationSource(AMQPFederationSource federation) thr /** * Unregister the given {@link AMQPFederationSource} instance with the broker management services. * - * @param federation - * The federation source instance being unregistered from management. - * + * @param federation The federation source instance being unregistered from management. * @throws Exception if an error occurs while unregistering the federation with the management services. */ public static void unregisterFederationSource(AMQPFederationSource federation) throws Exception { @@ -173,9 +169,7 @@ public static ObjectName getFederationSourceObjectName(ManagementService managem /** * Register the given {@link AMQPFederationTarget} instance with the broker management services. * - * @param federation - * The federation target instance being registered with management. - * + * @param federation The federation target instance being registered with management. * @throws Exception if an error occurs while registering the federation with the management services. */ public static void registerFederationTarget(String remoteNodeId, String brokerConnectionName, AMQPFederationTarget federation) throws Exception { @@ -191,9 +185,7 @@ public static void registerFederationTarget(String remoteNodeId, String brokerCo /** * Unregister the given {@link AMQPFederationTarget} instance with the broker management services. * - * @param federation - * The federation target instance being unregistered from management. - * + * @param federation The federation target instance being unregistered from management. * @throws Exception if an error occurs while unregistering the federation with the management services. */ public static void unregisterFederationTarget(String remoteNodeId, String brokerConnectionName, AMQPFederationTarget federation) throws Exception { @@ -221,11 +213,8 @@ public static ObjectName getFederationTargetObjectName(ManagementService managem /** * Register a local federation policy manager with the server management services for a federation source. * - * @param brokerConnectionName - * The name of the broker connection that owns the manager being registered. - * @param manager - * The AMQP federation policy manager instance that is being managed. - * + * @param brokerConnectionName The name of the broker connection that owns the manager being registered. + * @param manager The AMQP federation policy manager instance that is being managed. * @throws Exception if an error occurs while registering the manager with the management services. */ public static void registerLocalPolicyOnSource(String brokerConnectionName, AMQPFederationLocalPolicyManager manager) throws Exception { @@ -243,11 +232,8 @@ public static void registerLocalPolicyOnSource(String brokerConnectionName, AMQP /** * Unregister a local federation policy manager with the server management services for a federation source. * - * @param brokerConnectionName - * The name of the broker connection that owns the manager being unregistered. - * @param manager - * The AMQP federation policy manager instance that is being managed. - * + * @param brokerConnectionName The name of the broker connection that owns the manager being unregistered. + * @param manager The AMQP federation policy manager instance that is being managed. * @throws Exception if an error occurs while unregistering the manager with the management services. */ public static void unregisterLocalPolicyOnSource(String brokerConnectionName, AMQPFederationLocalPolicyManager manager) throws Exception { @@ -264,11 +250,8 @@ public static void unregisterLocalPolicyOnSource(String brokerConnectionName, AM /** * Register a remote federation policy manager with the server management services for a federation source. * - * @param brokerConnectionName - * The name of the broker connection that owns the manager being registered. - * @param manager - * The AMQP federation policy manager instance that is being managed. - * + * @param brokerConnectionName The name of the broker connection that owns the manager being registered. + * @param manager The AMQP federation policy manager instance that is being managed. * @throws Exception if an error occurs while registering the manager with the management services. */ public static void registerRemotePolicyOnSource(String brokerConnectionName, AMQPFederationRemotePolicyManager manager) throws Exception { @@ -286,11 +269,8 @@ public static void registerRemotePolicyOnSource(String brokerConnectionName, AMQ /** * Unregister a remote federation policy manager with the server management services for a federation source. * - * @param brokerConnectionName - * The name of the broker connection that owns the manager being unregistered. - * @param manager - * The AMQP federation policy manager instance that is being managed. - * + * @param brokerConnectionName The name of the broker connection that owns the manager being unregistered. + * @param manager The AMQP federation policy manager instance that is being managed. * @throws Exception if an error occurs while unregistering the manager with the management services. */ public static void unregisterRemotePolicyOnSource(String brokerConnectionName, AMQPFederationRemotePolicyManager manager) throws Exception { @@ -320,13 +300,9 @@ public static ObjectName getFederationSourcePolicyObjectName(ManagementService m /** * Register a local federation policy manager with the server management services for a federation target. * - * @param remoteNodeId - * The remote broker node ID that is the source of the federation operations. - * @param brokerConnectionName - * The name of the remote broker connection that owns the manager being registered. - * @param manager - * The AMQP federation policy manager instance that is being managed. - * + * @param remoteNodeId The remote broker node ID that is the source of the federation operations. + * @param brokerConnectionName The name of the remote broker connection that owns the manager being registered. + * @param manager The AMQP federation policy manager instance that is being managed. * @throws Exception if an error occurs while registering the manager with the management services. */ public static void registerLocalPolicyOnTarget(String remoteNodeId, String brokerConnectionName, AMQPFederationLocalPolicyManager manager) throws Exception { @@ -344,13 +320,9 @@ public static void registerLocalPolicyOnTarget(String remoteNodeId, String broke /** * Unregister a local federation policy manager with the server management services for a federation target. * - * @param remoteNodeId - * The remote broker node ID that is the source of the federation operations. - * @param brokerConnectionName - * The name of the remote broker connection that owns the manager being unregistered. - * @param manager - * The AMQP federation policy manager instance that is being managed. - * + * @param remoteNodeId The remote broker node ID that is the source of the federation operations. + * @param brokerConnectionName The name of the remote broker connection that owns the manager being unregistered. + * @param manager The AMQP federation policy manager instance that is being managed. * @throws Exception if an error occurs while unregistering the manager with the management services. */ public static void unregisterLocalPolicyOnTarget(String remoteNodeId, String brokerConnectionName, AMQPFederationLocalPolicyManager manager) throws Exception { @@ -367,13 +339,9 @@ public static void unregisterLocalPolicyOnTarget(String remoteNodeId, String bro /** * Register a remote federation policy manager with the server management services for a federation target. * - * @param remoteNodeId - * The remote broker node ID that is the source of the federation operations. - * @param brokerConnectionName - * The name of the remote broker connection that owns the manager being registered. - * @param manager - * The AMQP federation policy manager instance that is being managed. - * + * @param remoteNodeId The remote broker node ID that is the source of the federation operations. + * @param brokerConnectionName The name of the remote broker connection that owns the manager being registered. + * @param manager The AMQP federation policy manager instance that is being managed. * @throws Exception if an error occurs while registering the manager with the management services. */ public static void registerRemotePolicyOnTarget(String remoteNodeId, String brokerConnectionName, AMQPFederationRemotePolicyManager manager) throws Exception { @@ -391,13 +359,9 @@ public static void registerRemotePolicyOnTarget(String remoteNodeId, String brok /** * Unregister a remote federation policy manager with the server management services for a federation target. * - * @param remoteNodeId - * The remote broker node ID that is the source of the federation operations. - * @param brokerConnectionName - * The name of the remote broker connection that owns the manager being unregistered. - * @param manager - * The AMQP federation policy manager instance that is being managed. - * + * @param remoteNodeId The remote broker node ID that is the source of the federation operations. + * @param brokerConnectionName The name of the remote broker connection that owns the manager being unregistered. + * @param manager The AMQP federation policy manager instance that is being managed. * @throws Exception if an error occurs while unregistering the manager with the management services. */ public static void unregisterRemotePolicyOnTarget(String remoteNodeId, String brokerConnectionName, AMQPFederationRemotePolicyManager manager) throws Exception { @@ -429,11 +393,8 @@ public static ObjectName getFederationTargetPolicyObjectName(ManagementService m /** * Registers the federation consumer with the server management services on the source. * - * @param brokerConnectionName - * The name of the broker connection that owns the consumer being registered. - * @param consumer - * The AMQP federation consumer instance that is being managed. - * + * @param brokerConnectionName The name of the broker connection that owns the consumer being registered. + * @param consumer The AMQP federation consumer instance that is being managed. * @throws Exception if an error occurs while registering the consumer with the management services. */ public static void registerFederationSourceConsumer(String brokerConnectionName, AMQPFederationConsumer consumer) throws Exception { @@ -457,11 +418,8 @@ public static void registerFederationSourceConsumer(String brokerConnectionName, /** * Unregisters the federation consumer with the server management services on the source. * - * @param brokerConnectionName - * The name of the broker connection that owns the consumer being registered. - * @param consumer - * The AMQP federation consumer instance that is being managed. - * + * @param brokerConnectionName The name of the broker connection that owns the consumer being registered. + * @param consumer The AMQP federation consumer instance that is being managed. * @throws Exception if an error occurs while registering the consumer with the management services. */ public static void unregisterFederationSourceConsumer(String brokerConnectionName, AMQPFederationConsumer consumer) throws Exception { @@ -484,11 +442,8 @@ public static void unregisterFederationSourceConsumer(String brokerConnectionNam /** * Registers the federation producer with the server management services on the source. * - * @param brokerConnectionName - * The name of the broker connection that owns the producer being registered. - * @param sender - * The AMQP federation sender controller that manages the federation producer. - * + * @param brokerConnectionName The name of the broker connection that owns the producer being registered. + * @param sender The AMQP federation sender controller that manages the federation producer. * @throws Exception if an error occurs while registering the producer with the management services. */ public static void registerFederationSourceProducer(String brokerConnectionName, AMQPFederationSenderController sender) throws Exception { @@ -516,11 +471,8 @@ public static void registerFederationSourceProducer(String brokerConnectionName, /** * Unregisters the federation producer with the server management services on the source. * - * @param brokerConnectionName - * The name of the broker connection that owns the producer being registered. - * @param sender - * The AMQP federation sender controller that manages the federation producer. - * + * @param brokerConnectionName The name of the broker connection that owns the producer being registered. + * @param sender The AMQP federation sender controller that manages the federation producer. * @throws Exception if an error occurs while registering the producer with the management services. */ public static void unregisterFederationSourceProducer(String brokerConnectionName, AMQPFederationSenderController sender) throws Exception { @@ -603,11 +555,8 @@ public static ObjectName getFederationSourceQueueProducerObjectName(ManagementSe /** * Registers the federation consumer with the server management services on the target. * - * @param brokerConnectionName - * The name of the remote broker connection that owns the consumer being registered. - * @param consumer - * The AMQP federation consumer instance that is being managed. - * + * @param brokerConnectionName The name of the remote broker connection that owns the consumer being registered. + * @param consumer The AMQP federation consumer instance that is being managed. * @throws Exception if an error occurs while registering the consumer with the management services. */ public static void registerFederationTargetConsumer(String remoteNodeId, String brokerConnectionName, AMQPFederationConsumer consumer) throws Exception { @@ -631,11 +580,8 @@ public static void registerFederationTargetConsumer(String remoteNodeId, String /** * Unregisters the federation consumer with the server management services on the target. * - * @param brokerConnectionName - * The name of the remote broker connection that owns the consumer being registered. - * @param consumer - * The AMQP federation consumer instance that is being managed. - * + * @param brokerConnectionName The name of the remote broker connection that owns the consumer being registered. + * @param consumer The AMQP federation consumer instance that is being managed. * @throws Exception if an error occurs while registering the consumer with the management services. */ public static void unregisterFederationTargetConsumer(String remoteNodeId, String brokerConnectionName, AMQPFederationConsumer consumer) throws Exception { @@ -658,11 +604,8 @@ public static void unregisterFederationTargetConsumer(String remoteNodeId, Strin /** * Registers the federation producer with the server management services on the target. * - * @param brokerConnectionName - * The name of the remote broker connection that owns the producer being registered. - * @param sender - * The AMQP federation sender controller that manages the federation producer. - * + * @param brokerConnectionName The name of the remote broker connection that owns the producer being registered. + * @param sender The AMQP federation sender controller that manages the federation producer. * @throws Exception if an error occurs while registering the producer with the management services. */ public static void registerFederationTargetProducer(String remoteNodeId, String brokerConnectionName, AMQPFederationSenderController sender) throws Exception { @@ -690,11 +633,8 @@ public static void registerFederationTargetProducer(String remoteNodeId, String /** * Unregisters the federation producer with the server management services on the target. * - * @param brokerConnectionName - * The name of the remote broker connection that owns the producer being registered. - * @param sender - * The AMQP federation sender controller that manages the federation producer. - * + * @param brokerConnectionName The name of the remote broker connection that owns the producer being registered. + * @param sender The AMQP federation sender controller that manages the federation producer. * @throws Exception if an error occurs while registering the producer with the management services. */ public static void unregisterFederationTargetProducer(String remoteNodeId, String brokerConnectionName, AMQPFederationSenderController sender) throws Exception { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationMetrics.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationMetrics.java index 9cbea160f60..622d565608d 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationMetrics.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationMetrics.java @@ -19,8 +19,8 @@ import java.util.concurrent.atomic.AtomicLongFieldUpdater; /** - * A Metrics class that supports nesting to provide various elements in the federation - * space a view of its own Metrics for federation operations. + * A Metrics class that supports nesting to provide various elements in the federation space a view of its own Metrics + * for federation operations. */ public final class AMQPFederationMetrics { @@ -63,8 +63,8 @@ ProducerMetrics newProducerMetrics() { } /** - * Metrics for a single consumer instance that will also updates to the parents - * when the Metrics are updated by the consumer. + * Metrics for a single consumer instance that will also updates to the parents when the Metrics are updated by the + * consumer. */ public static class ConsumerMetrics { @@ -90,8 +90,8 @@ public void incrementMessagesReceived() { } /** - * Metrics for a single producer instance that will also updates to the parents - * when the Metrics are updated by the producer. + * Metrics for a single producer instance that will also updates to the parents when the Metrics are updated by the + * producer. */ public static class ProducerMetrics { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicyManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicyManager.java index 02fb70ef0fb..8a01ab95647 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicyManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicyManager.java @@ -24,8 +24,8 @@ import org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext; /** - * Base Federation policy manager that declares some common APIs that address or queue policy - * managers must provide implementations for. + * Base Federation policy manager that declares some common APIs that address or queue policy managers must provide + * implementations for. */ public abstract class AMQPFederationPolicyManager { @@ -66,10 +66,9 @@ public final synchronized void initialize() { } /** - * Start the federation policy manager which will initiate a scan of all broker - * bindings and create and matching remote receivers. Start on a policy manager - * should only be called after its parent {@link Federation} is started and the - * federation connection has been established. + * Start the federation policy manager which will initiate a scan of all broker bindings and create and matching + * remote receivers. Start on a policy manager should only be called after its parent {@link Federation} is started + * and the federation connection has been established. */ public final synchronized void start() { if (!federation.isStarted()) { @@ -89,9 +88,8 @@ public final synchronized void start() { } /** - * Stops the queue policy manager which will close any open remote receivers that are - * active for local queue demand. Stop should generally be called whenever the parent - * {@link Federation} loses its connection to the remote. + * Stops the queue policy manager which will close any open remote receivers that are active for local queue demand. + * Stop should generally be called whenever the parent {@link Federation} loses its connection to the remote. */ public final synchronized void stop() { if (state == State.UNINITIALIZED) { @@ -115,43 +113,43 @@ public final synchronized void shutdown() { } /** - * @return true if the policy is started at the time this method was called. + * {@return {@code true} if the policy is started at the time this method was called} */ public final boolean isStarted() { return state == State.STARTED; } /** - * @return the metrics instance tied to this federation policy manager instance. + * {@return the metrics instance tied to this federation policy manager instance} */ public AMQPFederationMetrics getMetrics() { return metrics; } /** - * @return the federation type this policy manager implements. + * {@return the federation type this policy manager implements} */ public final FederationType getPolicyType() { return policyType; } /** - * @return the assigned name of the policy that is being managed. + * {@return the assigned name of the policy that is being managed} */ public final String getPolicyName() { return policyName; } /** - * @return the {@link AMQPFederation} instance that owns this policy manager. + * {@return the {@link AMQPFederation} instance that owns this policy manager} */ public AMQPFederation getFederation() { return federation; } /** - * Called by the parent federation instance when the connection has failed and this federation - * should tear down any active resources and await a reconnect if one is allowed. + * Called by the parent federation instance when the connection has failed and this federation should tear down any + * active resources and await a reconnect if one is allowed. */ public final synchronized void connectionInterrupted() { connected = false; @@ -159,8 +157,8 @@ public final synchronized void connectionInterrupted() { } /** - * Called by the parent federation instance when the connection has been established and this - * policy manager should build up its active state based on the configuration. + * Called by the parent federation instance when the connection has been established and this policy manager should + * build up its active state based on the configuration. */ public final synchronized void connectionRestored() { connected = true; @@ -178,19 +176,16 @@ protected final void failIfShutdown() throws IllegalStateException { } /** - * Returns true if the policy manager is both started and marked as connected to - * the remote peer. This method must always be called under lock to ensure the state returned - * is accurate. + * This method must always be called under lock to ensure the state returned is accurate. * - * @return true if the manager is both started and the connected state is true + * @return {@code true} if the policy manager is both started and the connected state is {@code true} */ protected final boolean isActive() { return connected && state == State.STARTED; } /** - * Returns if the policy manager has been marked as connected to the remote peer. This method - * must be called under lock to ensure the returned state is accurate. + * This method must be called under lock to ensure the returned state is accurate. * * @return the state of the connected flag based on the last update from the connection APIs */ @@ -199,38 +194,38 @@ protected final boolean isConnected() { } /** - * On initialize a federation policy manager needs to perform any specific initialization actions - * it requires to begin tracking broker resources. + * On initialize a federation policy manager needs to perform any specific initialization actions it requires to + * begin tracking broker resources. */ protected abstract void handleManagerInitialized(); /** - * On start a federation policy manager needs to perform any specific startup actions - * it requires to begin tracking broker resources. + * On start a federation policy manager needs to perform any specific startup actions it requires to begin tracking + * broker resources. */ protected abstract void handleManagerStarted(); /** - * On stop a federation policy manager needs to perform any specific stopped actions - * it requires to cease tracking broker resources and cleanup. + * On stop a federation policy manager needs to perform any specific stopped actions it requires to cease tracking + * broker resources and cleanup. */ protected abstract void handleManagerStopped(); /** - * On shutdown a federation policy manager needs to perform any specific shutdown actions - * it requires to cease tracking broker resources. + * On shutdown a federation policy manager needs to perform any specific shutdown actions it requires to cease + * tracking broker resources. */ protected abstract void handleManagerShutdown(); /** - * On connection interrupted a federation policy manager needs to perform any specific - * actions to pause of cleanup current resources based on the connection being closed. + * On connection interrupted a federation policy manager needs to perform any specific actions to pause of cleanup + * current resources based on the connection being closed. */ protected abstract void handleConnectionInterrupted(); /** - * On connection restoration a federation policy manager needs to perform any specific - * actions to resume service based on a new connection having been established. + * On connection restoration a federation policy manager needs to perform any specific actions to resume service + * based on a new connection having been established. */ protected abstract void handleConnectionRestored(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicySupport.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicySupport.java index 92838178b6f..41d3465e772 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicySupport.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicySupport.java @@ -68,46 +68,42 @@ import static org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationConstants.ADD_ADDRESS_POLICY; /** - * Tools used when loading AMQP Broker connections configuration that includes Federation - * configuration. + * Tools used when loading AMQP Broker connections configuration that includes Federation configuration. */ public final class AMQPFederationPolicySupport { /** - * Default priority adjustment used for a federation queue match policy if nothing - * was configured in the broker configuration file. + * Default priority adjustment used for a federation queue match policy if nothing was configured in the broker + * configuration file. */ public static final int DEFAULT_QUEUE_RECEIVER_PRIORITY_ADJUSTMENT = -1; /** - * Annotation added to received messages from address consumers that indicates how many - * times the message has traversed a federation link. + * Annotation added to received messages from address consumers that indicates how many times the message has + * traversed a federation link. */ public static final Symbol MESSAGE_HOPS_ANNOTATION = Symbol.valueOf("x-opt-amq-fed-hops"); /** - * Property value placed on Core messages to indicate number of hops that a message has - * made when crossing Federation links. This value is used when Core messages are tunneled - * via an AMQP custom message and then recreated again on the other side. + * Property value placed on Core messages to indicate number of hops that a message has made when crossing Federation + * links. This value is used when Core messages are tunneled via an AMQP custom message and then recreated again on + * the other side. */ public static final String MESSAGE_HOPS_PROPERTY = "_AMQ_Fed_Hops"; /** - * Property name used to embed a nested map of properties meant to be applied if the address - * indicated in an federation address receiver auto creates the federated address. + * Property name used to embed a nested map of properties meant to be applied if the address indicated in an + * federation address receiver auto creates the federated address. */ public static final Symbol FEDERATED_ADDRESS_SOURCE_PROPERTIES = Symbol.valueOf("federated-address-source-properties"); /** - * Constructs an address filter for a federated address receiver link that deals with - * both AMQP messages and unwrapped Core messages which can carry different hops markers. - * If the max is less than or equal to zero no filter is created as these values are used - * to indicate no max hops for federated messages on an address. + * Constructs an address filter for a federated address receiver link that deals with both AMQP messages and + * unwrapped Core messages which can carry different hops markers. If the max is less than or equal to zero no filter + * is created as these values are used to indicate no max hops for federated messages on an address. * - * @param maxHops - * The max allowed number of hops before a message should stop crossing federation links. - * - * @return the address filter string that should be applied (or null). + * @param maxHops The max allowed number of hops before a message should stop crossing federation links. + * @return the address filter string that should be applied (or null) */ public static String generateAddressFilter(int maxHops) { if (maxHops <= 0) { @@ -123,13 +119,11 @@ public static String generateAddressFilter(int maxHops) { } /** - * Create an AMQP Message used to instruct the remote peer that it should perform - * Federation operations on the given {@link FederationReceiveFromQueuePolicy}. - * - * @param policy - * The policy to encode into an AMQP message. + * Create an AMQP Message used to instruct the remote peer that it should perform Federation operations on the given + * {@link FederationReceiveFromQueuePolicy}. * - * @return an AMQP Message with the encoded policy. + * @param policy The policy to encode into an AMQP message. + * @return an AMQP Message with the encoded policy */ public static AMQPMessage encodeQueuePolicyControlMessage(FederationReceiveFromQueuePolicy policy) { final Map annotations = new LinkedHashMap<>(); @@ -194,13 +188,11 @@ public static AMQPMessage encodeQueuePolicyControlMessage(FederationReceiveFromQ } /** - * Create an AMQP Message used to instruct the remote peer that it should perform - * Federation operations on the given {@link FederationReceiveFromAddressPolicy}. - * - * @param policy - * The policy to encode into an AMQP message. + * Create an AMQP Message used to instruct the remote peer that it should perform Federation operations on the given + * {@link FederationReceiveFromAddressPolicy}. * - * @return an AMQP Message with the encoded policy. + * @param policy The policy to encode into an AMQP message. + * @return an AMQP Message with the encoded policy */ public static AMQPMessage encodeAddressPolicyControlMessage(FederationReceiveFromAddressPolicy policy) { final Map annotations = new LinkedHashMap<>(); @@ -254,17 +246,13 @@ public static AMQPMessage encodeAddressPolicyControlMessage(FederationReceiveFro } /** - * Given an AMQP Message decode an {@link FederationReceiveFromQueuePolicy} from it and return - * the decoded value. The message should have already been inspected and determined to be an - * control message of the add to policy type. - * - * @param message - * The {@link AMQPMessage} that should carry an encoded {@link FederationReceiveFromQueuePolicy} - * @param wildcardConfig - * The {@link WildcardConfiguration} to use in the decoded policy. - * - * @return a decoded {@link FederationReceiveFromQueuePolicy} instance. + * Given an AMQP Message decode an {@link FederationReceiveFromQueuePolicy} from it and return the decoded value. The + * message should have already been inspected and determined to be an control message of the add to policy type. * + * @param message The {@link AMQPMessage} that should carry an encoded + * {@link FederationReceiveFromQueuePolicy} + * @param wildcardConfig The {@link WildcardConfiguration} to use in the decoded policy. + * @return a decoded {@link FederationReceiveFromQueuePolicy} instance * @throws ActiveMQException if an error occurs while decoding the policy. */ @SuppressWarnings("unchecked") @@ -367,17 +355,13 @@ private static Set> decodeFlattenedFilterSet(Map includes; @@ -508,17 +489,14 @@ public static FederationReceiveFromAddressPolicy create(AMQPFederationAddressPol } /** - * From the broker AMQP broker connection configuration element and the configured wild-card - * settings create an queue match policy. If not configured otherwise the consumer priority value - * is always defaulted to a value of -1 in order to attempt to prevent federation - * consumers from consuming messages on the remote when a local consumer is present. - * - * @param element - * The broker connections element configuration that creates this policy. - * @param wildcards - * The configured wild-card settings for the broker or defaults. + * From the broker AMQP broker connection configuration element and the configured wild-card settings create an queue + * match policy. If not configured otherwise the consumer priority value is always defaulted to a value of {@code -1} + * in order to attempt to prevent federation consumers from consuming messages on the remote when a local consumer is + * present. * - * @return a new queue match and handling policy for use in the broker connection. + * @param element The broker connections element configuration that creates this policy. + * @param wildcards The configured wild-card settings for the broker or defaults. + * @return a new queue match and handling policy for use in the broker connection */ public static FederationReceiveFromQueuePolicy create(AMQPFederationQueuePolicyElement element, WildcardConfiguration wildcards) { final Set> includes; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationProducerControl.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationProducerControl.java index 0f4790e6dd5..0bc49989b77 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationProducerControl.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationProducerControl.java @@ -19,34 +19,31 @@ import org.apache.activemq.artemis.api.core.management.Attribute; /** - * Management interface that is backed by an active federation producer - * that was created when demand was applied to a matching address or queue - * on the remote broker that is bringing messages to itself via federation. - * - * The federation producer sends messages for the given address or queue to - * a remote federation consumer. + * Management interface that is backed by an active federation producer that was created when demand was applied to a + * matching address or queue on the remote broker that is bringing messages to itself via federation. + *

            + * The federation producer sends messages for the given address or queue to a remote federation consumer. */ public interface AMQPFederationProducerControl { /** - * Returns the number of messages this federation producer has sent to the remote + * {@return the number of messages this federation producer has sent to the remote} */ @Attribute(desc = "returns the number of messages this federation producer has sent to the remote") long getMessagesSent(); /** - * @return the type of federation producer being represented. + * {@return the type of federation producer being represented} */ @Attribute(desc = "AMQP federation producer type (address or queue) that backs this instance.") String getRole(); /** * Gets the queue name that will be used for this federation producer instance. - * - * For Queue federation this will be the name of the queue whose messages are - * being federated from this server instance to the remote. For an Address federation - * this will be an automatically generated name that should be unique to a given - * federation producer instance. + *

            + * For Queue federation this will be the name of the queue whose messages are being federated from this server + * instance to the remote. For an Address federation this will be an automatically generated name that should be + * unique to a given federation producer instance. * * @return the queue name associated with the federation producer */ @@ -55,50 +52,47 @@ public interface AMQPFederationProducerControl { /** * Gets the address that will be used for this federation producer instance. + *

            + * For Queue federation this is the address under which the matching queue must reside. For Address federation this + * is the actual subscription address whose messages are being federated from the local address. * - * For Queue federation this is the address under which the matching queue must - * reside. For Address federation this is the actual subscription address whose - * messages are being federated from the local address. - * - * @return the address associated with this federation producer. + * @return the address associated with this federation producer */ @Attribute(desc = "the address name associated with the federation producer.") String getAddress(); /** - * Gets the local FQQN that comprises the address and queue where the remote producer - * will be attached. + * Gets the local FQQN that comprises the address and queue where the remote producer will be attached. * - * @return provides the FQQN that can be used to address the producer queue directly. + * @return provides the FQQN that can be used to address the producer queue directly */ @Attribute(desc = "the FQQN associated with the federation producer.") String getFqqn(); /** - * Gets the routing type that will be requested when creating a producer on the - * local server. + * Gets the routing type that will be requested when creating a producer on the local server. * - * @return the routing type of the federation producer. + * @return the routing type of the federation producer */ @Attribute(desc = "the Routing Type associated with the federation producer.") String getRoutingType(); /** * Gets the filter string that will be used when creating the federation producer. + *

            + * This is the filter string that is applied to the local subscription used to filter which message are actually sent + * to the remote broker. * - * This is the filter string that is applied to the local subscription used to filter - * which message are actually sent to the remote broker. - * - * @return the filter string in use for the federation producer. + * @return the filter string that will be used when creating the federation producer */ @Attribute(desc = "the filter string associated with the federation producer.") String getFilterString(); /** - * Gets the priority value that will be requested for the local subscription that feeds - * this federation producer with messages to send to the remote. + * Gets the priority value that will be requested for the local subscription that feeds this federation producer with + * messages to send to the remote. * - * @return the assigned producer priority for the federation producer. + * @return the assigned producer priority for the federation producer */ @Attribute(desc = "the assigned priority of the the federation producer.") int getPriority(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueueConsumer.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueueConsumer.java index 2f713b166bd..4332bd50ec0 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueueConsumer.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueueConsumer.java @@ -66,9 +66,8 @@ import org.slf4j.LoggerFactory; /** - * Consumer implementation for Federated Queues that receives from a remote - * AMQP peer and forwards those messages onto the internal broker Queue for - * consumption by an attached resource. + * Consumer implementation for Federated Queues that receives from a remote AMQP peer and forwards those messages onto + * the internal broker Queue for consumption by an attached resource. */ public final class AMQPFederationQueueConsumer extends AMQPFederationConsumer { @@ -229,8 +228,8 @@ private static int caclulateNextDelay(int lastDelay, int backoffMultiplier, int } /** - * Wrapper around the standard receiver context that provides federation specific entry - * points and customizes inbound delivery handling for this Queue receiver. + * Wrapper around the standard receiver context that provides federation specific entry points and customizes inbound + * delivery handling for this Queue receiver. */ private class AMQPFederatedQueueDeliveryReceiver extends ProtonServerReceiverContext { @@ -244,14 +243,10 @@ private class AMQPFederatedQueueDeliveryReceiver extends ProtonServerReceiverCon /** * Creates the federation receiver instance. * - * @param session - * The server session context bound to the receiver instance. - * @param consumerInfo - * The {@link FederationConsumerInfo} that defines the consumer being created. - * @param receiver - * The proton receiver that will be wrapped in this server context instance. - * @param creditRunnable - * The {@link Runnable} to provide to the base class for managing link credit. + * @param session The server session context bound to the receiver instance. + * @param consumerInfo The {@link FederationConsumerInfo} that defines the consumer being created. + * @param receiver The proton receiver that will be wrapped in this server context instance. + * @param creditRunnable The {@link Runnable} to provide to the base class for managing link credit. */ AMQPFederatedQueueDeliveryReceiver(Queue localQueue, Receiver receiver) { super(session.getSessionSPI(), session.getAMQPConnectionContext(), session, receiver); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueuePolicyManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueuePolicyManager.java index 7f57c5f5214..412004fb89d 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueuePolicyManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueuePolicyManager.java @@ -66,7 +66,7 @@ public AMQPFederationQueuePolicyManager(AMQPFederation federation, AMQPFederatio } /** - * @return the receive from address policy that backs the address policy manager. + * {@return the receive from address policy that backs the address policy manager} */ @Override public FederationReceiveFromQueuePolicy getPolicy() { @@ -185,15 +185,11 @@ private void reactIfConsumerMatchesPolicy(ServerConsumer consumer) { } /** - * Checks if the remote queue added falls within the set of queues that match the - * configured queue policy and if so scans for local demand on that queue to see - * if a new attempt to federate the queue is needed. - * - * @param addressName - * The address that was added on the remote. - * @param queueName - * The queue that was added on the remote. + * Checks if the remote queue added falls within the set of queues that match the configured queue policy and if so + * scans for local demand on that queue to see if a new attempt to federate the queue is needed. * + * @param addressName The address that was added on the remote. + * @param queueName The queue that was added on the remote. * @throws Exception if an error occurs while processing the queue added event. */ public synchronized void afterRemoteQueueAdded(String addressName, String queueName) throws Exception { @@ -217,45 +213,36 @@ public synchronized void afterRemoteQueueAdded(String addressName, String queueN } /** - * Performs the test against the configured queue policy to check if the target - * queue and its associated address is a match or not. A subclass can override - * this method and provide its own match tests in combination with the configured - * matching policy. - * - * @param address - * The address that is being tested for a policy match. - * @param queueName - * The name of the queue that is being tested for a policy match. + * Performs the test against the configured queue policy to check if the target queue and its associated address is a + * match or not. A subclass can override this method and provide its own match tests in combination with the + * configured matching policy. * - * @return true if the address given is a match against the policy. + * @param address The address that is being tested for a policy match. + * @param queueName The name of the queue that is being tested for a policy match. + * @return {@code true} if the address given is a match against the policy */ private boolean testIfQueueMatchesPolicy(String address, String queueName) { return policy.test(address, queueName); } /** - * Performs the test against the configured queue policy to check if the target - * queue minus its associated address is a match or not. A subclass can override - * this method and provide its own match tests in combination with the configured - * matching policy. - * - * @param queueName - * The name of the queue that is being tested for a policy match. + * Performs the test against the configured queue policy to check if the target queue minus its associated address is + * a match or not. A subclass can override this method and provide its own match tests in combination with the + * configured matching policy. * - * @return true if the address given is a match against the policy. + * @param queueName The name of the queue that is being tested for a policy match. + * @return {@code true} if the address given is a match against the policy */ private boolean testIfQueueMatchesPolicy(String queueName) { return policy.testQueue(queueName); } /** - * Create a new {@link FederationConsumerInfo} based on the given {@link ServerConsumer} - * and the configured {@link FederationReceiveFromQueuePolicy}. A subclass must override this - * method to return a consumer information object with additional data used be that implementation. - * - * @param consumer - * The {@link ServerConsumer} to use as a basis for the consumer information object. + * Create a new {@link FederationConsumerInfo} based on the given {@link ServerConsumer} and the configured + * {@link FederationReceiveFromQueuePolicy}. A subclass must override this method to return a consumer information + * object with additional data used be that implementation. * + * @param consumer The {@link ServerConsumer} to use as a basis for the consumer information object. * @return a new {@link FederationConsumerInfo} instance based on the server consumer */ private FederationConsumerInfo createConsumerInfo(ServerConsumer consumer) { @@ -293,16 +280,12 @@ protected AMQPFederationConsumer createFederationConsumer(FederationConsumerInfo } /** - * Creates a {@link Predicate} that should return true if the given consumer is a federation - * created consumer which should not be further federated. - * - * @param server - * The server instance for use in creating the filtering {@link Predicate}. - * @param policy - * The configured Queue matching policy that can provide additional match criteria. - * - * @return a {@link Predicate} that will return true if the consumer should be filtered. + * Creates a {@link Predicate} that should return true if the given consumer is a federation created consumer which + * should not be further federated. * + * @param server The server instance for use in creating the filtering {@link Predicate}. + * @param policy The configured Queue matching policy that can provide additional match criteria. + * @return a {@link Predicate} that will return true if the consumer should be filtered * @throws ActiveMQException if an error occurs while creating the new consumer filter. */ private Predicate createFederationConsumerMatcher(ActiveMQServer server, FederationReceiveFromQueuePolicy policy) throws ActiveMQException { @@ -358,7 +341,7 @@ private static class AMQPFederationQueueConsumerManager extends AMQPFederationCo } /** - * @return the name of the Queue this federation consumer manager is attached to. + * {@return the name of the Queue this federation consumer manager is attached to} */ public String getQueueName() { return queue.getName().toString(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueueSenderController.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueueSenderController.java index 58c2a93426c..0afc87f1377 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueueSenderController.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationQueueSenderController.java @@ -44,11 +44,9 @@ import org.apache.qpid.proton.engine.Sender; /** - * {@link SenderController} used when an AMQP federation Queue receiver is created - * and this side of the connection needs to create a matching sender. The attach of - * the sender should only succeed if there is a local matching queue, otherwise the - * link should be closed with an error indicating that the matching resource is not - * present on this peer. + * {@link SenderController} used when an AMQP federation Queue receiver is created and this side of the connection needs + * to create a matching sender. The attach of the sender should only succeed if there is a local matching queue, + * otherwise the link should be closed with an error indicating that the matching resource is not present on this peer. */ public final class AMQPFederationQueueSenderController extends AMQPFederationSenderController { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemoteAddressPolicyManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemoteAddressPolicyManager.java index 268e9d50eee..a00453ea265 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemoteAddressPolicyManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemoteAddressPolicyManager.java @@ -22,17 +22,16 @@ import org.apache.activemq.artemis.protocol.amqp.federation.FederationType; /** - * Policy manager that manages state data for remote AMQP Federation Address policies and their - * associated senders. These managers are a result either of a local federation configuration - * that sender federation policies to the remote side of the connection or at the remote target - * they appear when the remote is consuming messages from the target based on local federation - * configurations. + * Policy manager that manages state data for remote AMQP Federation Address policies and their associated senders. + * These managers are a result either of a local federation configuration that sender federation policies to the remote + * side of the connection or at the remote target they appear when the remote is consuming messages from the target + * based on local federation configurations. */ public final class AMQPFederationRemoteAddressPolicyManager extends AMQPFederationRemotePolicyManager { /** - * Name used when the remote address policy name is not present due to having connected to an - * older broker instance that does not fill in the link property that carries the policy name. + * Name used when the remote address policy name is not present due to having connected to an older broker instance + * that does not fill in the link property that carries the policy name. */ public static final String DEFAULT_REMOTE_ADDRESS_POLICY_NAME = ""; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyControl.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyControl.java index 48ad9c57cc5..2c0bcbca846 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyControl.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyControl.java @@ -19,26 +19,25 @@ import org.apache.activemq.artemis.api.core.management.Attribute; /** - * Management service control interface for an AMQPFederation policy manager instance that - * originates from the remote broker. This control type appears to track the sending side - * of a federation policy and its producer instances. + * Management service control interface for an AMQPFederation policy manager instance that originates from the remote + * broker. This control type appears to track the sending side of a federation policy and its producer instances. */ public interface AMQPFederationRemotePolicyControl { /** - * Returns the type of the AMQP federation policy manager being controlled + * {@return the type of the AMQP federation policy manager being controlled} */ @Attribute(desc = "AMQP federation policy manager type that backs this control instance.") String getType(); /** - * Returns the configured name the AMQP federation policy manager being controlled + * {@return the configured name the AMQP federation policy manager being controlled} */ @Attribute(desc = "The configured AMQP federation policy name that backs this control instance.") String getName(); /** - * Returns the number of messages this federation policy has received from the remote. + * {@return the number of messages this federation policy has received from the remote.} */ @Attribute(desc = "returns the number of messages this federation policy has sent to the remote") long getMessagesSent(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyControlType.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyControlType.java index 5466245f1a8..2dcbc81b6ba 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyControlType.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyControlType.java @@ -26,10 +26,10 @@ import org.apache.activemq.artemis.logs.AuditLogger; /** - * Management service control instance for an AMQPFederation policy manager instance that - * federates messages from this broker to the opposing side of the broker connection. These - * can be created either for a local broker connection that has bi-directional federation - * configured, or as a view of a remote broker connection pulling messages from the target. + * Management service control instance for an AMQPFederation policy manager instance that federates messages from this + * broker to the opposing side of the broker connection. These can be created either for a local broker connection that + * has bi-directional federation configured, or as a view of a remote broker connection pulling messages from the + * target. */ public class AMQPFederationRemotePolicyControlType extends AbstractControl implements AMQPFederationRemotePolicyControl { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyManager.java index d3337bb0faf..9a7ad3f8324 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemotePolicyManager.java @@ -28,10 +28,9 @@ import org.slf4j.LoggerFactory; /** - * Represents the remote policy manager that is interacting with this server. A remote policy - * manager provides a view into the metrics for AMQP senders dispatching message from the local - * broker to the remote where the local federation address and queue policy managers create - * receivers based on local demand. + * Represents the remote policy manager that is interacting with this server. A remote policy manager provides a view + * into the metrics for AMQP senders dispatching message from the local broker to the remote where the local federation + * address and queue policy managers create receivers based on local demand. */ public abstract class AMQPFederationRemotePolicyManager extends AMQPFederationPolicyManager { @@ -42,26 +41,21 @@ public abstract class AMQPFederationRemotePolicyManager extends AMQPFederationPo /** * Create the remote policy manager instance with the given configuration. * - * @param federation - * The federation endpoint this policy manager operates within. - * @param metrics - * A metric object used to track work done under this policy - * @param policyName - * The name assigned to this policy by the configuration on the remote. - * @param policyType - * The type of policy being managed here, address or queue. + * @param federation The federation endpoint this policy manager operates within. + * @param metrics A metric object used to track work done under this policy + * @param policyName The name assigned to this policy by the configuration on the remote. + * @param policyType The type of policy being managed here, address or queue. */ public AMQPFederationRemotePolicyManager(AMQPFederation federation, AMQPFederationMetrics metrics, String policyName, FederationType policyType) { super(federation, metrics, policyName, policyType); } /** - * Create a new {@link AMQPFederationSenderController} instance for use by newly opened AMQP - * federation sender links initiated from the remote broker based on federation policies that - * have been configured or sent to that broker instance. - * - * @return a new {@link AMQPFederationSenderController} to be assigned to a sender context. + * Create a new {@link AMQPFederationSenderController} instance for use by newly opened AMQP federation sender links + * initiated from the remote broker based on federation policies that have been configured or sent to that broker + * instance. * + * @return a new {@link AMQPFederationSenderController} to be assigned to a sender context * @throws ActiveMQAMQPException if an error occurs while creating the controller */ public final synchronized AMQPFederationSenderController newSenderController() throws ActiveMQAMQPException { @@ -75,11 +69,8 @@ public final synchronized AMQPFederationSenderController newSenderController() t /** * Subclass creates the actual type of federation sender controller specific to that manager type. * - * @param closedListener - * The closed listener to provide to the new sender controller. - * - * @return a new {@link AMQPFederationSenderController} to be assigned to a sender context. - * + * @param closedListener The closed listener to provide to the new sender controller. + * @return a new {@link AMQPFederationSenderController} to be assigned to a sender context * @throws ActiveMQAMQPException if an error occurs while creating the controller */ protected abstract AMQPFederationSenderController createSenderController(Consumer closedListener) throws ActiveMQAMQPException; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemoteQueuePolicyManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemoteQueuePolicyManager.java index 305bae6696b..e7e1e37136b 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemoteQueuePolicyManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationRemoteQueuePolicyManager.java @@ -22,17 +22,16 @@ import org.apache.activemq.artemis.protocol.amqp.federation.FederationType; /** - * Policy manager that manages state data for remote AMQP Federation Queue policies and their - * associated senders. These managers are a result either of a local federation configuration - * that sender federation policies to the remote side of the connection or at the remote target - * they appear when the remote is consuming messages from the target based on local federation - * configurations. + * Policy manager that manages state data for remote AMQP Federation Queue policies and their associated senders. These + * managers are a result either of a local federation configuration that sender federation policies to the remote side + * of the connection or at the remote target they appear when the remote is consuming messages from the target based on + * local federation configurations. */ public final class AMQPFederationRemoteQueuePolicyManager extends AMQPFederationRemotePolicyManager { /** - * Name used when the remote queue policy name is not present due to having connected to an - * older broker instance that does not fill in the link property that carries the policy name. + * Name used when the remote queue policy name is not present due to having connected to an older broker instance + * that does not fill in the link property that carries the policy name. */ public static final String DEFAULT_REMOTE_QUEUE_POLICY_NAME = ""; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSenderController.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSenderController.java index ac005270f23..1e99ee3442e 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSenderController.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSenderController.java @@ -56,8 +56,8 @@ import org.slf4j.LoggerFactory; /** - * A base class abstract {@link SenderController} implementation for use by federation address and - * queue senders that provides some common functionality used between both. + * A base class abstract {@link SenderController} implementation for use by federation address and queue senders that + * provides some common functionality used between both. */ public abstract class AMQPFederationSenderController implements SenderController { @@ -104,7 +104,7 @@ public AMQPFederationSenderController(AMQPFederationRemotePolicyManager manager, } /** - * @return an enumeration describing the role of the sender controller implementation. + * {@return an enumeration describing the role of the sender controller implementation} */ public abstract Role getRole(); @@ -168,14 +168,11 @@ public final ServerConsumer init(ProtonServerSenderContext senderContext) throws } /** - * The subclass must implement this and create an appropriately configured server consumer - * based on the properties of the AMQP link and the role of the implemented sender type. - * - * @param senderContext - * The server sender context that this controller was created for. - * - * @return a new {@link ServerConsumer} instance that will send messages to the remote peer. + * The subclass must implement this and create an appropriately configured server consumer based on the properties of + * the AMQP link and the role of the implemented sender type. * + * @param senderContext The server sender context that this controller was created for. + * @return a new {@link ServerConsumer} instance that will send messages to the remote peer * @throws Exception if an error occurs while creating the server consumer. */ protected abstract ServerConsumer createServerConsumer(ProtonServerSenderContext senderContext) throws Exception; @@ -232,8 +229,7 @@ public final void close(ErrorCondition error) { /** * Subclasses should react to link local close by cleaning up resources. * - * @param error - * The error that triggered the local close or null if no error. + * @param error The error that triggered the local close or null if no error. */ protected void handleLinkLocallyClosed(ErrorCondition error) { // default implementation does nothing diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSource.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSource.java index afce5bd0c99..a396b8e80c8 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSource.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSource.java @@ -63,13 +63,11 @@ import org.slf4j.LoggerFactory; /** - * This is the initiating side of a broker federation that occurs over an AMQP - * broker connection. + * This is the initiating side of a broker federation that occurs over an AMQP broker connection. *

            - * This endpoint will create a control link to the remote peer that is a sender - * of federation commands which can be used to instruct the remote to initiate - * federation operations back to this peer over the same connection and without - * the need for local configuration. + * This endpoint will create a control link to the remote peer that is a sender of federation commands which can be used + * to instruct the remote to initiate federation operations back to this peer over the same connection and without the + * need for local configuration. */ public class AMQPFederationSource extends AMQPFederation { @@ -93,15 +91,12 @@ public class AMQPFederationSource extends AMQPFederation { private volatile AMQPFederationConfiguration configuration; /** - * Creates a new AMQP Federation instance that will manage the state of a single AMQP - * broker federation instance using an AMQP broker connection as the IO channel. + * Creates a new AMQP Federation instance that will manage the state of a single AMQP broker federation instance + * using an AMQP broker connection as the IO channel. * - * @param name - * The name of this federation instance. - * @param properties - * A set of optional properties that provide additional configuration. - * @param connection - * The broker connection over which this federation will occur. + * @param name The name of this federation instance. + * @param properties A set of optional properties that provide additional configuration. + * @param connection The broker connection over which this federation will occur. */ public AMQPFederationSource(String name, Map properties, AMQPBrokerConnection connection) { super(name, connection.getServer()); @@ -117,7 +112,7 @@ public AMQPFederationSource(String name, Map properties, AMQPBro } /** - * @return the {@link AMQPBrokerConnection} that this federation is attached to. + * {@return the {@link AMQPBrokerConnection} that this federation is attached to} */ public AMQPBrokerConnection getBrokerConnection() { return brokerConnection; @@ -151,14 +146,11 @@ public synchronized AMQPFederationConfiguration getConfiguration() { } /** - * Adds a new {@link FederationReceiveFromQueuePolicy} entry to the set of policies that the - * remote end of this federation will use to create demand on the this server when local - * demand is present. + * Adds a new {@link FederationReceiveFromQueuePolicy} entry to the set of policies that the remote end of this + * federation will use to create demand on the this server when local demand is present. * - * @param queuePolicy - * The policy to add to the set of configured {@link FederationReceiveFromQueuePolicy} instance. - * - * @return this {@link AMQPFederationSource} instance. + * @param queuePolicy The policy to add to the set of configured {@link FederationReceiveFromQueuePolicy} instance. + * @return this {@link AMQPFederationSource} instance */ public synchronized AMQPFederationSource addRemoteQueueMatchPolicy(FederationReceiveFromQueuePolicy queuePolicy) { remoteQueueMatchPolicies.putIfAbsent(queuePolicy.getPolicyName(), queuePolicy); @@ -167,14 +159,12 @@ public synchronized AMQPFederationSource addRemoteQueueMatchPolicy(FederationRec } /** - * Adds a new {@link FederationReceiveFromAddressPolicy} entry to the set of policies that the - * remote end of this federation will use to create demand on the this server when local - * demand is present. - * - * @param addressPolicy - * The policy to add to the set of configured {@link FederationReceiveFromAddressPolicy} instance. + * Adds a new {@link FederationReceiveFromAddressPolicy} entry to the set of policies that the remote end of this + * federation will use to create demand on the this server when local demand is present. * - * @return this {@link AMQPFederationSource} instance. + * @param addressPolicy The policy to add to the set of configured {@link FederationReceiveFromAddressPolicy} + * instance. + * @return this {@link AMQPFederationSource} instance */ public synchronized AMQPFederationSource addRemoteAddressMatchPolicy(FederationReceiveFromAddressPolicy addressPolicy) { remoteAddressMatchPolicies.putIfAbsent(addressPolicy.getPolicyName(), addressPolicy); @@ -183,8 +173,8 @@ public synchronized AMQPFederationSource addRemoteAddressMatchPolicy(FederationR } /** - * Called by the parent broker connection when the connection has failed and this federation - * should tear down any active resources and await a reconnect if one is allowed. + * Called by the parent broker connection when the connection has failed and this federation should tear down any + * active resources and await a reconnect if one is allowed. * * @throws ActiveMQException if an error occurs processing the connection interrupted event */ @@ -255,14 +245,11 @@ public final synchronized void connectionInterrupted() throws ActiveMQException } /** - * Called by the parent broker connection when the connection has been established and this - * federation should build up its active state based on the configuration. - * - * @param connection - * The new {@link Connection} that represents the currently active connection. - * @param session - * The new {@link Session} that was created for use by broker connection resources. + * Called by the parent broker connection when the connection has been established and this federation should build + * up its active state based on the configuration. * + * @param connection The new {@link Connection} that represents the currently active connection. + * @param session The new {@link Session} that was created for use by broker connection resources. * @throws ActiveMQException if an error occurs processing the connection restored event */ public final synchronized void connectionRestored(AMQPConnectionContext connection, AMQPSessionContext session) throws ActiveMQException { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSourceControlType.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSourceControlType.java index 7ddb2a5b14d..ad0f7a8bbf6 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSourceControlType.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationSourceControlType.java @@ -26,9 +26,9 @@ import org.apache.activemq.artemis.logs.AuditLogger; /** - * Management service control instance for an AMQPFederationSource instance that federates messages - * from the remote broker on the opposing side of this broker connection. The federation source has - * a lifetime that matches that of its parent broker connection. + * Management service control instance for an AMQPFederationSource instance that federates messages from the remote + * broker on the opposing side of this broker connection. The federation source has a lifetime that matches that of its + * parent broker connection. */ public final class AMQPFederationSourceControlType extends AbstractControl implements AMQPFederationControl { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationTarget.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationTarget.java index 373a259628a..9c3bb68201f 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationTarget.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationTarget.java @@ -34,11 +34,9 @@ import org.apache.qpid.proton.engine.Link; /** - * This is the receiving side of an AMQP broker federation that occurs over an - * inbound connection from a remote peer. The federation target only comes into - * existence once a remote peer connects and successfully authenticates against - * a control link validation address. Only one federation target is allowed per - * connection. + * This is the receiving side of an AMQP broker federation that occurs over an inbound connection from a remote peer. + * The federation target only comes into existence once a remote peer connects and successfully authenticates against a + * control link validation address. Only one federation target is allowed per connection. */ public class AMQPFederationTarget extends AMQPFederation { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationTargetControlType.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationTargetControlType.java index e3608f893db..5eeb3bde1c1 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationTargetControlType.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationTargetControlType.java @@ -26,9 +26,9 @@ import org.apache.activemq.artemis.logs.AuditLogger; /** - * Management service control instance for an AMQPFederationTarget instance that is the target of an - * AMQP broker connection with federation configured. The target can behave much the same as a federation - * source but its scoped to the connection and all operations cease as soon as the connection is closed. + * Management service control instance for an AMQPFederationTarget instance that is the target of an AMQP broker + * connection with federation configured. The target can behave much the same as a federation source but its scoped to + * the connection and all operations cease as soon as the connection is closed. */ public final class AMQPFederationTargetControlType extends AbstractControl implements AMQPFederationControl { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/ActiveMQServerAMQPFederationPlugin.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/ActiveMQServerAMQPFederationPlugin.java index 7980526fcde..3a42b94f683 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/ActiveMQServerAMQPFederationPlugin.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/ActiveMQServerAMQPFederationPlugin.java @@ -27,17 +27,15 @@ import org.apache.activemq.artemis.protocol.amqp.federation.FederationConsumerInfo; /** - * Broker plugin which allows users to intercept federation related events when AMQP - * federation is configured on the broker. + * Broker plugin which allows users to intercept federation related events when AMQP federation is configured on the + * broker. */ public interface ActiveMQServerAMQPFederationPlugin extends AMQPFederationBrokerPlugin { /** * After a federation instance has been started * - * @param federation - * The {@link Federation} instance that is being started. - * + * @param federation The {@link Federation} instance that is being started. * @throws ActiveMQException if an error occurs during the call. */ default void federationStarted(final Federation federation) throws ActiveMQException { @@ -47,9 +45,7 @@ default void federationStarted(final Federation federation) throws ActiveMQExcep /** * After a federation instance has been stopped * - * @param federation - * The {@link Federation} instance that is being stopped. - * + * @param federation The {@link Federation} instance that is being stopped. * @throws ActiveMQException if an error occurs during the call. */ default void federationStopped(final Federation federation) throws ActiveMQException { @@ -59,9 +55,7 @@ default void federationStopped(final Federation federation) throws ActiveMQExcep /** * Before a consumer for a federated resource is created * - * @param consumerInfo - * The information that will be used when creating the federation consumer. - * + * @param consumerInfo The information that will be used when creating the federation consumer. * @throws ActiveMQException if an error occurs during the call. */ default void beforeCreateFederationConsumer(final FederationConsumerInfo consumerInfo) throws ActiveMQException { @@ -71,9 +65,7 @@ default void beforeCreateFederationConsumer(final FederationConsumerInfo consume /** * After a consumer for a federated resource is created * - * @param consumer - * The consumer that was created after a matching federated resource is detected. - * + * @param consumer The consumer that was created after a matching federated resource is detected. * @throws ActiveMQException if an error occurs during the call. */ default void afterCreateFederationConsumer(final FederationConsumer consumer) throws ActiveMQException { @@ -83,9 +75,7 @@ default void afterCreateFederationConsumer(final FederationConsumer consumer) th /** * Before a consumer for a federated resource is closed * - * @param consumer - * The federation consumer that is going to be closed. - * + * @param consumer The federation consumer that is going to be closed. * @throws ActiveMQException if an error occurs during the call. */ default void beforeCloseFederationConsumer(final FederationConsumer consumer) throws ActiveMQException { @@ -95,9 +85,7 @@ default void beforeCloseFederationConsumer(final FederationConsumer consumer) th /** * After a consumer for a federated resource is closed * - * @param consumer - * The federation consumer that has been closed. - * + * @param consumer The federation consumer that has been closed. * @throws ActiveMQException if an error occurs during the call. */ default void afterCloseFederationConsumer(final FederationConsumer consumer) throws ActiveMQException { @@ -107,25 +95,20 @@ default void afterCloseFederationConsumer(final FederationConsumer consumer) thr /** * Before a federation consumer handles a message * - * @param consumer - * The {@link Federation} consumer that is handling a new incoming message. - * @param message - * The {@link Message} that is being handled - * + * @param consumer The {@link Federation} consumer that is handling a new incoming message. + * @param message The {@link Message} that is being handled * @throws ActiveMQException if an error occurs during the call. */ - default void beforeFederationConsumerMessageHandled(final FederationConsumer consumer, Message message) throws ActiveMQException { + default void beforeFederationConsumerMessageHandled(final FederationConsumer consumer, + Message message) throws ActiveMQException { } /** * After a federation consumer handles a message * - * @param consumer - * The {@link Federation} consumer that is handling a new incoming message. - * @param message - * The {@link Message} that is being handled - * + * @param consumer The {@link Federation} consumer that is handling a new incoming message. + * @param message The {@link Message} that is being handled * @throws ActiveMQException if an error occurs during the call. */ default void afterFederationConsumerMessageHandled(final FederationConsumer consumer, Message message) throws ActiveMQException { @@ -136,11 +119,8 @@ default void afterFederationConsumerMessageHandled(final FederationConsumer cons * Conditionally create a federation consumer for an address that matches the configuration of this server * federation. This allows custom logic to be inserted to decide when to create federation consumers * - * @param address - * The address that matched the federation configuration - * - * @return if true, create the consumer, else if false don't create - * + * @param address The address that matched the federation configuration + * @return if {@code true}, create the consumer, else if false don't create * @throws ActiveMQException if an error occurs during the call. */ default boolean shouldCreateFederationConsumerForAddress(final AddressInfo address) throws ActiveMQException { @@ -151,11 +131,8 @@ default boolean shouldCreateFederationConsumerForAddress(final AddressInfo addre * Conditionally create a federation consumer for an address that matches the configuration of this server * federation. This allows custom logic to be inserted to decide when to create federation consumers * - * @param queue - * The queue that matched the federation configuration - * - * @return if true, create the consumer, else if false don't create - * + * @param queue The queue that matched the federation configuration + * @return if {@code true}, create the consumer, else if false don't create * @throws ActiveMQException if an error occurs during the call. */ default boolean shouldCreateFederationConsumerForQueue(final Queue queue) throws ActiveMQException { @@ -163,16 +140,12 @@ default boolean shouldCreateFederationConsumerForQueue(final Queue queue) throws } /** - * Conditionally create a federation consumer for an divert binding that matches the configuration of this - * server federation. This allows custom logic to be inserted to decide when to create federation consumers - * - * @param divert - * The {@link Divert} that matched the federation configuration - * @param queue - * The {@link Queue} that was attached for a divert forwarding address. - * - * @return if true, create the consumer, else if false don't create + * Conditionally create a federation consumer for an divert binding that matches the configuration of this server + * federation. This allows custom logic to be inserted to decide when to create federation consumers * + * @param divert The {@link Divert} that matched the federation configuration + * @param queue The {@link Queue} that was attached for a divert forwarding address. + * @return if {@code true}, create the consumer, else if false don't create * @throws ActiveMQException if an error occurs during the call. */ default boolean shouldCreateFederationConsumerForDivert(Divert divert, Queue queue) throws ActiveMQException { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerAggregation.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerAggregation.java index 344b54cf266..b86318dc050 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerAggregation.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorControllerAggregation.java @@ -30,7 +30,9 @@ import org.apache.activemq.artemis.core.server.mirror.MirrorController; import org.apache.activemq.artemis.core.transaction.Transaction; -/** this will be used when there are multiple replicas in use. */ +/** + * this will be used when there are multiple replicas in use. + */ public class AMQPMirrorControllerAggregation implements MirrorController, ActiveMQComponent { 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 9c1a6f88aa8..a4efb5739a1 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 @@ -82,8 +82,10 @@ public class AMQPMirrorControllerSource extends BasicMirrorController im public static final Symbol INTERNAL_ID = Symbol.getSymbol("x-opt-amq-mr-id"); public static final Symbol INTERNAL_DESTINATION = Symbol.getSymbol("x-opt-amq-mr-dst"); - /* In a Multi-cast address (or JMS Topics) we may in certain cases (clustered-routing for instance) - select which particular queues will receive the routing output */ + /* + * In a Multi-cast address (or JMS Topics) we may in certain cases (clustered-routing for instance) select which + * particular queues will receive the routing output + */ public static final Symbol TARGET_QUEUES = Symbol.getSymbol("x-opt-amq-mr-trg-q"); // Capabilities @@ -467,7 +469,9 @@ public static void validateProtocolData(ReferenceIDSupplier referenceIDSupplier, } } - /** This method will return the brokerID used by the message */ + /** + * This method will return the brokerID used by the message + */ private static String setProtocolData(ReferenceIDSupplier referenceIDSupplier, MessageReference ref) { String brokerID = referenceIDSupplier.getServerID(ref); long id = referenceIDSupplier.getID(ref); @@ -651,9 +655,9 @@ private static class MirrorACKOperation implements Runnable { } /** - * - * @param message the message with the instruction to ack on the target node. Notice this is not the message owned by the reference. - * @param ref the reference being acked + * @param message the message with the instruction to ack on the target node. Notice this is not the message owned + * by the reference. + * @param ref the reference being acked */ public void addMessage(Message message, MessageReference ref) { acks.put(message, ref); 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 5c4304c4748..be0895289d0 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 @@ -101,10 +101,9 @@ public static MirrorController getControllerInUse() { } /** - * Objects of this class can be used by either transaction or by OperationContext. - * It is important that when you're using the transactions you clear any references to - * the operation context. Don't use transaction and OperationContext at the same time - * as that would generate duplicates on the objects cache. + * Objects of this class can be used by either transaction or by OperationContext. It is important that when you're + * using the transactions you clear any references to the operation context. Don't use transaction and + * OperationContext at the same time as that would generate duplicates on the objects cache. */ class ACKMessageOperation implements IOCallback, Runnable { @@ -191,7 +190,9 @@ public void close(boolean remoteLinkClose) throws ActiveMQAMQPException { } } - /** This method will wait both replication and storage to finish their current operations. */ + /** + * This method will wait both replication and storage to finish their current operations. + */ public void flush() { CountDownLatch latch = new CountDownLatch(1); connection.runNow(() -> { @@ -276,11 +277,13 @@ protected void actualDelivery(Message message, Delivery delivery, DeliveryAnnota if (message instanceof AMQPMessage amqpMessage) { - /** We use message annotations, because on the same link we will receive control messages + /* + * We use message annotations, because on the same link we will receive control messages * coming from mirror events, * and the actual messages that need to be replicated. * Using anything from the body would force us to parse the body on regular messages. - * The body of the message may still be used on control messages, on cases where a JSON string is sent. */ + * The body of the message may still be used on control messages, on cases where a JSON string is sent. + */ Object eventType = AMQPMessageBrokerAccessor.getMessageAnnotationProperty(amqpMessage, EVENT_TYPE); if (eventType != null) { if (eventType.equals(ADD_ADDRESS)) { @@ -481,10 +484,10 @@ private void performAck(String nodeID, } /** - * this method returning true means the sendMessage was successful, and the IOContext should no longer be used. - * as the sendMessage was successful the OperationContext of the transaction will take care of the completion. - * The caller of this method should give up any reference to messageCompletionAck when this method returns true. - * */ + * this method returning true means the sendMessage was successful, and the IOContext should no longer be used. as + * the sendMessage was successful the OperationContext of the transaction will take care of the completion. The + * caller of this method should give up any reference to messageCompletionAck when this method returns {@code true}. + */ private boolean sendMessage(Message message, DeliveryAnnotations deliveryAnnotations, ACKMessageOperation messageCompletionAck) throws Exception { if (message.getMessageID() <= 0) { message.setMessageID(server.getStorageManager().generateID()); @@ -560,7 +563,10 @@ private boolean sendMessage(Message message, DeliveryAnnotations deliveryAnnotat return true; } - /** When the source mirror receives messages from a cluster member of his own, it should then fill targetQueues so we could play the same semantic the source applied on its routing */ + /** + * When the source mirror receives messages from a cluster member of his own, it should then fill targetQueues so we + * could play the same semantic the source applied on its routing + */ private void targetQueuesRouting(final Message message, final RoutingContext context, final Collection queueNames) throws Exception { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorMessageFactory.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorMessageFactory.java index 72ffabef825..bb28cbf9c6a 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorMessageFactory.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AMQPMirrorMessageFactory.java @@ -48,8 +48,7 @@ public class AMQPMirrorMessageFactory { /** - * This method is open to make it testable, - * do not use on your applications. + * This method is open to make it testable. Do not use on your applications. */ public static Message createMessage(String to, SimpleString address, SimpleString queue, Object event, String brokerID, Object body, AckReason ackReason) { Header header = new Header(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AckManager.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AckManager.java index f9c7ed3a7e1..0faa078a201 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AckManager.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/AckManager.java @@ -374,7 +374,9 @@ private void retryPage(LongObjectHashMap> queuesToRetry) { boolean needScanOnPaging = false; Iterator>> iter = queuesToRetry.entrySet().iterator(); @@ -469,8 +471,10 @@ private void doACK(Queue targetQueue, MessageReference reference, AckReason reas targetQueue.deliverAsync(); } } - /** The ACKManager will perform the retry on each address's pageStore executor. - * it will perform each address individually, one by one. */ + /* + * The ACKManager will perform the retry on each address's pageStore executor. + * It will perform each address individually, one by one. + */ class MultiStepProgress { Map>> retryList; 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 114cf9ad6f8..58ea22b4a8c 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 @@ -27,7 +27,10 @@ import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; -/** MirrorTransaction disable some syncs in storage, and plays with OperationConsistencyLevel to relax some of the syncs required for Mirroring. */ +/** + * MirrorTransaction disable some syncs in storage, and plays with OperationConsistencyLevel to relax some of the syncs + * required for Mirroring. + */ public class MirrorTransaction extends TransactionImpl { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/ReferenceIDSupplier.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/ReferenceIDSupplier.java index 73671c9c38c..c5bd012241c 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/ReferenceIDSupplier.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/ReferenceIDSupplier.java @@ -27,8 +27,9 @@ import static org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerSource.INTERNAL_ID_EXTRA_PROPERTY; /** - * Since Artemis 2.30.0 this is supplying a new NodeStore per queue. - * It is also parsing MessageReference and Message for the proper ID for the messages. + * Since Artemis 2.30.0 this is supplying a new NodeStore per queue. It is also parsing MessageReference and Message for + * the proper ID for the messages. + * * @since 2.30.0 */ public class ReferenceIDSupplier implements NodeStoreFactory { @@ -42,7 +43,9 @@ public ReferenceIDSupplier(ActiveMQServer server) { this.serverID = server.getNodeID().toString(); } - /** This will return the NodeStore that will be used by the Queue. */ + /** + * This will return the NodeStore that will be used by the Queue. + */ @Override public NodeStore newNodeStore() { return new ReferenceNodeStore(this); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/ReferenceNodeStore.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/ReferenceNodeStore.java index 9c012a6a85c..d7e8fec73f0 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/ReferenceNodeStore.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/mirror/ReferenceNodeStore.java @@ -100,7 +100,9 @@ public LinkedListImpl.Node getNode(String serverID, long id) { } } - /** notice getMap should always return an instance. It should never return null. */ + /** + * notice getMap should always return an instance. It should never return null. + */ private synchronized LongObjectHashMap> getMap(String serverID) { if (serverID == null) { serverID = idSupplier.getDefaultNodeID(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPContentTypeSupport.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPContentTypeSupport.java index e0401381e58..2f1b73453fe 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPContentTypeSupport.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPContentTypeSupport.java @@ -39,11 +39,11 @@ public final class AMQPContentTypeSupport { private static final String ECMASCRIPT = "ecmascript"; /** - * @param contentType - * the contentType of the received message + * Parse the content type from a message and determine the {@code Charset}. + * + * @param contentType the contentType of the received message * @return the character set to use, or null if not to treat the message as text - * @throws ActiveMQAMQPInvalidContentTypeException - * if the content-type is invalid in some way. + * @throws ActiveMQAMQPInvalidContentTypeException if the content-type is invalid in some way. */ public static Charset parseContentTypeForTextualCharset(final String contentType) throws ActiveMQAMQPInvalidContentTypeException { if (contentType == null || contentType.trim().isEmpty()) { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPMessageIdHelper.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPMessageIdHelper.java index 3f483c2fb5e..c6c8d36e7f0 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPMessageIdHelper.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPMessageIdHelper.java @@ -26,32 +26,26 @@ import org.apache.qpid.proton.amqp.UnsignedLong; /** - * Helper class for identifying and converting message-id and correlation-id - * values between the AMQP types and the Strings values used by JMS. - * - *

            - * AMQP messages allow for 4 types of message-id/correlation-id: - * message-id-string, message-id-binary, message-id-uuid, or message-id-ulong. - * In order to accept or return a string representation of these for - * interoperability with other AMQP clients, the following encoding can be used - * after removing or before adding the "ID:" prefix used for a JMSMessageID - * value:
            - * - * {@literal "AMQP_BINARY:"}
            - * {@literal "AMQP_UUID:"}
            - * {@literal "AMQP_ULONG:"}
            - * {@literal "AMQP_STRING:"}
            - * + * Helper class for identifying and converting message-id and correlation-id values between the AMQP types and the + * Strings values used by JMS. *

            + * AMQP messages allow for 4 types of message-id/correlation-id: message-id-string, message-id-binary, message-id-uuid, + * or message-id-ulong. In order to accept or return a string representation of these for interoperability with other + * AMQP clients, the following encoding can be used after removing or before adding the "ID:" prefix used for a + * JMSMessageID value: + *

              + *
            • {@literal "AMQP_BINARY:"} + *
            • {@literal "AMQP_UUID:"} + *
            • {@literal "AMQP_ULONG:"} + *
            • {@literal "AMQP_STRING:"} + *
            * The AMQP_STRING encoding exists only for escaping message-id-string values * that happen to begin with one of the encoding prefixes (including AMQP_STRING * itself). It MUST NOT be used otherwise. - * *

            * When provided a string for conversion which attempts to identify itself as an * encoded binary, uuid, or ulong but can't be converted into the indicated * format, an exception will be thrown. - * */ public class AMQPMessageIdHelper { @@ -74,12 +68,10 @@ public class AMQPMessageIdHelper { private static final char[] HEX_CHARS = "0123456789ABCDEF".toCharArray(); /** - * Checks whether the given string begins with "ID:" prefix used to denote a - * JMSMessageID + * Checks whether the given string begins with "ID:" prefix used to denote a JMSMessageID * - * @param string - * the string to check - * @return true if and only id the string begins with "ID:" + * @param string the string to check + * @return {@code true} if and only id the string begins with "ID:" */ public boolean hasMessageIdPrefix(String string) { if (string == null) { @@ -140,15 +132,12 @@ public Object toCorrelationIdStringOrBytes(Object idObject) { } /** - * Takes the provided non-String AMQP message-id/correlation-id object, and - * convert it it to a String usable as either a JMSMessageID or - * JMSCorrelationID value, encoding the type information as a prefix to - * convey for later use in reversing the process if used to set - * JMSCorrelationID on a message. + * Takes the provided non-String AMQP message-id/correlation-id object, and convert it it to a String usable as + * either a JMSMessageID or JMSCorrelationID value, encoding the type information as a prefix to convey for later use + * in reversing the process if used to set JMSCorrelationID on a message. * - * @param idObject - * the object to process - * @return string to be used for the actual JMS ID. + * @param idObject the object to process + * @return string to be used for the actual JMS ID */ private String convertToIdString(Object idObject) { if (idObject == null) { @@ -203,17 +192,13 @@ private boolean hasAmqpNoPrefix(String stringId, int offset) { } /** - * Takes the provided id string and return the appropriate amqp messageId - * style object. Converts the type based on any relevant encoding information - * found as a prefix. + * Takes the provided id string and return the appropriate amqp messageId style object. Converts the type based on + * any relevant encoding information found as a prefix. * - * @param origId - * the object to be converted + * @param origId the object to be converted * @return the AMQP messageId style object - * - * @throws ActiveMQAMQPIllegalStateException - * if the provided baseId String indicates an encoded type but can't - * be converted to that type. + * @throws ActiveMQAMQPIllegalStateException if the provided baseId String indicates an encoded type but can't be + * converted to that type. */ public Object toIdObject(final String origId) throws ActiveMQAMQPIllegalStateException { if (origId == null) { @@ -254,17 +239,14 @@ public Object toIdObject(final String origId) throws ActiveMQAMQPIllegalStateExc } /** - * Convert the provided hex-string into a binary representation where each - * byte represents two characters of the hex string. - * + * Convert the provided hex-string into a binary representation where each byte represents two characters of the hex + * string. + *

            * The hex characters may be upper or lower case. * - * @param hexString - * string to convert + * @param hexString string to convert * @return a byte array containing the binary representation - * @throws IllegalArgumentException - * if the provided String is a non-even length or contains non-hex - * characters + * @throws IllegalArgumentException if the provided String is a non-even length or contains non-hex characters */ public byte[] convertHexStringToBinary(String hexString) throws IllegalArgumentException { int length = hexString.length(); @@ -308,14 +290,12 @@ private int hexCharToInt(char ch, String orig) throws IllegalArgumentException { } /** - * Convert the provided binary into a hex-string representation where each - * character represents 4 bits of the provided binary, i.e each byte requires - * two characters. - * + * Convert the provided binary into a hex-string representation where each character represents 4 bits of the + * provided binary, i.e each byte requires two characters. + *

            * The returned hex characters are upper-case. * - * @param bytes - * binary to convert + * @param bytes binary to convert * @return a String containing a hex representation of the bytes */ public String convertBinaryToHexString(byte[] bytes) { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPMessageSupport.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPMessageSupport.java index 502b77c9828..d10421d3e9f 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPMessageSupport.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AMQPMessageSupport.java @@ -51,8 +51,8 @@ import static org.apache.activemq.artemis.utils.DestinationUtil.TOPIC_QUALIFIED_PREFIX; /** - * Support class containing constant values and static methods that are used to map to / from - * AMQP Message types being sent or received. + * Support class containing constant values and static methods that are used to map to / from AMQP Message types being + * sent or received. */ public final class AMQPMessageSupport { public static final int NON_PERSISTENT = 1; @@ -71,8 +71,8 @@ public final class AMQPMessageSupport { // Message Properties used to map AMQP to JMS and back /** - * Attribute used to mark the class type of JMS message that a particular message - * instance represents, used internally by the client. + * Attribute used to mark the class type of JMS message that a particular message instance represents, used + * internally by the client. */ public static final Symbol JMS_MSG_TYPE = Symbol.getSymbol("x-opt-jms-msg-type"); @@ -100,26 +100,25 @@ public final class AMQPMessageSupport { public static final Symbol ROUTING_TYPE = Symbol.getSymbol("x-opt-routing-type"); /** - * Value mapping for JMS_MSG_TYPE which indicates the message is a generic JMS Message - * which has no body. + * Value mapping for JMS_MSG_TYPE which indicates the message is a generic JMS Message which has no body. */ public static final byte JMS_MESSAGE = 0; /** - * Value mapping for JMS_MSG_TYPE which indicates the message is a JMS ObjectMessage - * which has an Object value serialized in its message body. + * Value mapping for JMS_MSG_TYPE which indicates the message is a JMS ObjectMessage which has an Object value + * serialized in its message body. */ public static final byte JMS_OBJECT_MESSAGE = 1; /** - * Value mapping for JMS_MSG_TYPE which indicates the message is a JMS MapMessage - * which has an Map instance serialized in its message body. + * Value mapping for JMS_MSG_TYPE which indicates the message is a JMS MapMessage which has an Map instance + * serialized in its message body. */ public static final byte JMS_MAP_MESSAGE = 2; /** - * Value mapping for JMS_MSG_TYPE which indicates the message is a JMS BytesMessage - * which has a body that consists of raw bytes. + * Value mapping for JMS_MSG_TYPE which indicates the message is a JMS BytesMessage which has a body that consists of + * raw bytes. */ public static final byte JMS_BYTES_MESSAGE = 3; @@ -130,12 +129,11 @@ public final class AMQPMessageSupport { public static final byte JMS_STREAM_MESSAGE = 4; /** - * Value mapping for JMS_MSG_TYPE which indicates the message is a JMS TextMessage - * which has a body that contains a UTF-8 encoded String. + * Value mapping for JMS_MSG_TYPE which indicates the message is a JMS TextMessage which has a body that contains a + * UTF-8 encoded String. */ public static final byte JMS_TEXT_MESSAGE = 5; - /** * Content type used to mark Data sections as containing a serialized java object. */ @@ -216,26 +214,20 @@ public final class AMQPMessageSupport { /** * Lookup and return the correct Proton Symbol instance based on the given key. * - * @param key - * the String value name of the Symbol to locate. - * - * @return the Symbol value that matches the given key. + * @param key the String value name of the Symbol to locate. + * @return the Symbol value that matches the given key */ public static Symbol getSymbol(String key) { return Symbol.valueOf(key); } /** - * Safe way to access message annotations which will check internal structure and either - * return the annotation if it exists or null if the annotation or any annotations are - * present. - * - * @param key - * the String key to use to lookup an annotation. - * @param message - * the AMQP message object that is being examined. + * Safe way to access message annotations which will check internal structure and either return the annotation if it + * exists or null if the annotation or any annotations are present. * - * @return the given annotation value or null if not present in the message. + * @param key the String key to use to lookup an annotation. + * @param message the AMQP message object that is being examined. + * @return the given annotation value or null if not present in the message */ public static Object getMessageAnnotation(String key, Message message) { if (message != null && message.getMessageAnnotations() != null) { @@ -247,16 +239,12 @@ public static Object getMessageAnnotation(String key, Message message) { } /** - * Check whether the content-type field of the properties section (if present) in the given - * message matches the provided string (where null matches if there is no content type - * present. + * Check whether the content-type field of the properties section (if present) in the given message matches the + * provided string (where null matches if there is no content type present. * - * @param contentType - * content type string to compare against, or null if none - * @param message - * the AMQP message object that is being examined. - * - * @return true if content type matches + * @param contentType content type string to compare against, or null if none + * @param message the AMQP message object that is being examined. + * @return {@code true} if content type matches */ public static boolean isContentType(String contentType, Message message) { if (contentType == null) { @@ -269,12 +257,9 @@ public static boolean isContentType(String contentType, Message message) { /** * Check whether the content-type given matches the expect value. * - * @param expected - * content type string to compare against or null if not expected to be set - * @param actual - * the AMQP content type symbol from the Properties section - * - * @return true if content type matches + * @param expected content type string to compare against or null if not expected to be set + * @param actual the AMQP content type symbol from the Properties section + * @return {@code true} if content type matches */ public static boolean isContentType(String expected, Symbol actual) { if (expected == null) { @@ -285,9 +270,9 @@ public static boolean isContentType(String expected, Symbol actual) { } /** - * @param contentType - * the contentType of the received message - * @return the character set to use, or null if not to treat the message as text + * {@return the character set to use, or null if not to treat the message as text} + * + * @param contentType the contentType of the received message */ public static Charset getCharsetForTextualContent(String contentType) { try { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AmqpCoreConverter.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AmqpCoreConverter.java index c52a490bbf8..f2fb3e9d6ae 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AmqpCoreConverter.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AmqpCoreConverter.java @@ -105,9 +105,8 @@ import static org.apache.activemq.artemis.utils.DestinationUtil.TOPIC_QUALIFIED_PREFIX; /** - * This class was created just to separate concerns on AMQPConverter. - * For better organization of the code. - * */ + * This class was created just to separate concerns on AMQPConverter. For better organization of the code. + */ public class AmqpCoreConverter { public static ICoreMessage toCore(AMQPMessage message, CoreMessageObjectPools coreMessageObjectPools) throws Exception { return message.toCore(coreMessageObjectPools); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreMapMessageWrapper.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreMapMessageWrapper.java index c73acb235c8..98eda2774d1 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreMapMessageWrapper.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreMapMessageWrapper.java @@ -45,15 +45,13 @@ public final class CoreMapMessageWrapper extends CoreMessageWrapper { public static final byte TYPE = Message.MAP_TYPE; - private final TypedProperties map = new TypedProperties(); - /* + /** * This constructor is used to construct messages prior to sending */ public CoreMapMessageWrapper(ICoreMessage message) { super(message); - } private static Map getMapFromMessageBody(CoreMapMessageWrapper message) { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreTextMessageWrapper.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreTextMessageWrapper.java index 43e30eede2a..f1d1999110e 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreTextMessageWrapper.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/coreWrapper/CoreTextMessageWrapper.java @@ -43,19 +43,15 @@ public class CoreTextMessageWrapper extends CoreMessageWrapper { public static final byte TYPE = Message.TEXT_TYPE; - - // We cache it locally - it's more performant to cache as a SimpleString, the AbstractChannelBuffer write // methods are more efficient for a SimpleString private SimpleString text; - - /* + /** * This constructor is used to construct messages prior to sending */ public CoreTextMessageWrapper(ICoreMessage message) { super(message); - } @Override diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/Federation.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/Federation.java index 1b1e55af020..c6e5d6143fa 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/Federation.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/Federation.java @@ -25,17 +25,17 @@ public interface Federation { /** - * @return the unique name that was assigned to this server federation connector. + * {@return the unique name that was assigned to this server federation connector} */ String getName(); /** - * @return the {@link ActiveMQServer} instance assigned to this {@link Federation} + * {@return the {@link ActiveMQServer} instance assigned to this {@link Federation}} */ ActiveMQServer getServer(); /** - * @return is this federation instance started (may not be connected yet). + * {@return is this federation instance started (may not be connected yet)} */ boolean isStarted(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConstants.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConstants.java index 58377148880..6dcc65175a8 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConstants.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConstants.java @@ -18,14 +18,13 @@ package org.apache.activemq.artemis.protocol.amqp.federation; /** - * Some predefined constants used in various scenarios when building and managing a - * federation between peers. + * Some predefined constants used in various scenarios when building and managing a federation between peers. */ public abstract class FederationConstants { /** - * Constant value used in properties or other protocol constructs to indicate - * the name of the broker federation that an operation belongs to. + * Constant value used in properties or other protocol constructs to indicate the name of the broker federation that + * an operation belongs to. */ public static final String FEDERATION_NAME = "federation-name"; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConsumer.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConsumer.java index b3df6f5503a..493cd62b0d8 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConsumer.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConsumer.java @@ -22,12 +22,12 @@ public interface FederationConsumer { /** - * @return the {@link Federation} that this consumer operates under. + * {@return the {@link Federation} that this consumer operates under} */ Federation getFederation(); /** - * @return an information object that defines the characteristics of the {@link FederationConsumer} + * {@return an information object that defines the characteristics of the {@link FederationConsumer}} */ FederationConsumerInfo getConsumerInfo(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConsumerInfo.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConsumerInfo.java index 15c21eed0e5..87f37560ea3 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConsumerInfo.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationConsumerInfo.java @@ -19,9 +19,8 @@ import org.apache.activemq.artemis.api.core.RoutingType; /** - * Information and identification interface for Federation consumers that will be - * created on the remote broker as demand on the local broker is detected. The - * behavior and meaning of some APIs in this interface may vary slightly depending + * Information and identification interface for Federation consumers that will be created on the remote broker as demand + * on the local broker is detected. The behavior and meaning of some APIs in this interface may vary slightly depending * on the role of the consumer (Address or Queue). */ public interface FederationConsumerInfo { @@ -39,22 +38,21 @@ enum Role { } /** - * @return a unique Id for the consumer being represented. + * {@return a unique Id for the consumer being represented} */ String getId(); /** - * @return the type of federation consumer being represented. + * {@return the type of federation consumer being represented} */ Role getRole(); /** * Gets the queue name that will be used for this federation consumer instance. - * - * For Queue federation this will be the name of the queue whose messages are - * being federated to this server instance. For an Address federation this will - * be an automatically generated name that should be unique to a given federation - * instance + *

            + * For Queue federation this will be the name of the queue whose messages are being federated to this server + * instance. For an Address federation this will be an automatically generated name that should be unique to a given + * federation instance * * @return the queue name associated with the federation consumer */ @@ -62,48 +60,43 @@ enum Role { /** * Gets the address that will be used for this federation consumer instance. + *

            + * For Queue federation this is the address under which the matching queue must reside. For Address federation this + * is the actual address whose messages are being federated. * - * For Queue federation this is the address under which the matching queue must - * reside. For Address federation this is the actual address whose messages are - * being federated. - * - * @return the address associated with this federation consumer. + * @return the address associated with this federation consumer */ String getAddress(); /** - * Gets the FQQN that comprises the address and queue where the remote consumer - * will be attached. + * Gets the FQQN that comprises the address and queue where the remote consumer will be attached. * - * @return provides the FQQN that can be used to address the consumer queue directly. + * @return provides the FQQN that can be used to address the consumer queue directly */ String getFqqn(); /** - * Gets the routing type that will be requested when creating a consumer on the - * remote server. + * Gets the routing type that will be requested when creating a consumer on the remote server. * - * @return the routing type of the remote consumer. + * @return the routing type of the remote consumer */ RoutingType getRoutingType(); /** * Gets the filter string that will be used when creating the remote consumer. + *

            + * For Queue federation this will be the filter that exists on the local queue that is requesting federation of + * messages from the remote. For address federation this filter will be used to restrict some movement of messages + * amongst federated server addresses. * - * For Queue federation this will be the filter that exists on the local queue that - * is requesting federation of messages from the remote. For address federation this - * filter will be used to restrict some movement of messages amongst federated server - * addresses. - * - * @return the filter string in use for the federation consumer. + * @return the filter string in use for the federation consumer */ String getFilterString(); /** - * Gets the priority value that will be requested for the remote consumer that is - * created. + * Gets the priority value that will be requested for the remote consumer that is created. * - * @return the assigned consumer priority for the federation consumer. + * @return the assigned consumer priority for the federation consumer */ int getPriority(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromAddressPolicy.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromAddressPolicy.java index 439dc0c7b2d..9374166aff1 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromAddressPolicy.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromAddressPolicy.java @@ -35,8 +35,8 @@ import org.apache.activemq.artemis.core.settings.impl.Match; /** - * Policy used to provide federation of remote to local broker addresses, once created the policy - * configuration is immutable. + * Policy used to provide federation of remote to local broker addresses, once created the policy configuration is + * immutable. */ public class FederationReceiveFromAddressPolicy implements FederationReceiveFromResourcePolicy, BiPredicate { @@ -133,14 +133,11 @@ public TransformerConfiguration getTransformerConfiguration() { } /** - * Convenience test method for those who have an {@link AddressInfo} object - * but don't want to deal with the {@link SimpleString} object or any null - * checks. + * Convenience test method for those who have an {@link AddressInfo} object but don't want to deal with the + * {@link SimpleString} object or any null checks. * - * @param addressInfo - * The address info to check which if null will result in a negative result. - * - * @return true if the address value matches this configured policy. + * @param addressInfo The address info to check which if null will result in a negative result. + * @return {@code true} if the address value matches this configured policy */ public boolean test(AddressInfo addressInfo) { if (addressInfo != null) { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromQueuePolicy.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromQueuePolicy.java index 8a5be0d161d..f13f331506b 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromQueuePolicy.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromQueuePolicy.java @@ -32,8 +32,8 @@ import org.apache.activemq.artemis.core.settings.impl.Match; /** - * Policy used to provide federation of remote to local broker queues, once created the policy - * configuration is immutable. + * Policy used to provide federation of remote to local broker queues, once created the policy configuration is + * immutable. */ public class FederationReceiveFromQueuePolicy implements FederationReceiveFromResourcePolicy, BiPredicate { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromResourcePolicy.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromResourcePolicy.java index b656aa89451..2cbc0acda49 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromResourcePolicy.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/federation/FederationReceiveFromResourcePolicy.java @@ -21,28 +21,28 @@ import org.apache.activemq.artemis.core.config.TransformerConfiguration; /** - * Interface that a Federation receive from (address or queue) policy should implement - * and provides some common APIs that each should share. + * Interface that a Federation receive from (address or queue) policy should implement and provides some common APIs + * that each should share. */ public interface FederationReceiveFromResourcePolicy { /** - * @return the federation type this policy configuration defines. + * {@return the federation type this policy configuration defines} */ FederationType getPolicyType(); /** - * @return the name assigned to this federation policy. + * {@return the name assigned to this federation policy} */ String getPolicyName(); /** - * @return a {@link Map} of properties that were used in the policy configuration. + * {@return a {@link Map} of properties that were used in the policy configuration} */ Map getProperties(); /** - * @return the {@link TransformerConfiguration} that was specified in the policy configuration. + * {@return the {@link TransformerConfiguration} that was specified in the policy configuration} */ TransformerConfiguration getTransformerConfiguration(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/logger/ActiveMQAMQPProtocolMessageBundle.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/logger/ActiveMQAMQPProtocolMessageBundle.java index bd0cba8bc17..2c08e684ec8 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/logger/ActiveMQAMQPProtocolMessageBundle.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/logger/ActiveMQAMQPProtocolMessageBundle.java @@ -28,10 +28,10 @@ /** * Logger Codes 119000 - 119999 - * - * (Though IDs 119030 - 119299 are to be avoided due to use by other classes historically, - * ActiveMQClientMessageBundle and ActiveMQMessageBundle, prior to their codes being - * changed in commit b3529dcea428fa697aacbceacc6641e47cfb74ba for ARTEMIS-1018) + *

            + * (Though IDs 119030 - 119299 are to be avoided due to use by other classes historically, ActiveMQClientMessageBundle + * and ActiveMQMessageBundle, prior to their codes being changed in commit b3529dcea428fa697aacbceacc6641e47cfb74ba for + * ARTEMIS-1018) */ @LogBundle(projectCode = "AMQ", regexID = "119[3-9][0-9]{2}|1190[0-2][0-9]", retiredIDs = {119000, 119003, 119004, 119009, 119012, 119013}) public interface ActiveMQAMQPProtocolMessageBundle { 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 8b4178eaa7b..88f8c783c7f 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 @@ -126,7 +126,9 @@ public void enableAutoRead() { private final boolean useCoreSubscriptionNaming; - /** Outgoing means created by the AMQP Bridge */ + /** + * Outgoing means created by the AMQP Bridge + */ private final boolean bridgeConnection; private final ScheduleOperator scheduleOp = new ScheduleOperator(new ScheduleRunnable()); @@ -206,15 +208,12 @@ public void initialize() throws Exception { } /** - * Adds a listener that will be invoked any time an AMQP link is remotely closed - * before having been closed on this end of the connection. - * - * @param id - * A unique ID assigned to the listener used to later remove it if needed. - * @param linkCloseListener - * The instance of a closed listener. + * Adds a listener that will be invoked any time an AMQP link is remotely closed before having been closed on this + * end of the connection. * - * @return this connection context instance. + * @param id A unique ID assigned to the listener used to later remove it if needed. + * @param linkCloseListener The instance of a closed listener. + * @return this connection context instance */ public AMQPConnectionContext addLinkRemoteCloseListener(String id, LinkCloseListener linkCloseListener) { linkCloseListeners.put(id, linkCloseListener); @@ -224,17 +223,15 @@ public AMQPConnectionContext addLinkRemoteCloseListener(String id, LinkCloseList /** * Remove the link remote close listener that is identified by the given ID. * - * @param id - * The unique ID assigned to the listener when it was added. + * @param id The unique ID assigned to the listener when it was added. */ public void removeLinkRemoteCloseListener(String id) { linkCloseListeners.remove(id); } /** - * Clear all link remote close listeners, usually done before connection - * termination to avoid any remote close events triggering processing - * after the connection shutdown has already started. + * Clear all link remote close listeners, usually done before connection termination to avoid any remote close events + * triggering processing after the connection shutdown has already started. */ public void clearLinkRemoteCloseListeners() { linkCloseListeners.clear(); @@ -651,9 +648,9 @@ public void onRemoteOpen(Connection connection) throws Exception { initialize(); /* - * This can be null which is in effect an empty map, also we really don't need to check this for in bound connections - * but its here in case we add support for outbound connections. - * */ + * This can be null which is in effect an empty map, also we really don't need to check this for in bound + * connections but its here in case we add support for outbound connections. + */ if (connection.getRemoteProperties() == null || !connection.getRemoteProperties().containsKey(CONNECTION_OPEN_FAILED)) { long nextKeepAliveTime = handler.tick(true); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConstants.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConstants.java index ce631ef3111..adb38350510 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConstants.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConstants.java @@ -22,9 +22,9 @@ public class AMQPConstants { /* - * Connection Properties - * http://docs.oasis-open.org/amqp/core/v1.0/amqp-core-complete-v1.0.pdf#subsection.2.7.1 - * */ + * Connection Properties + * http://docs.oasis-open.org/amqp/core/v1.0/amqp-core-complete-v1.0.pdf#subsection.2.7.1 + */ public static class Connection { public static final int DEFAULT_IDLE_TIMEOUT = -1; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageReader.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageReader.java index 04d786d7e73..15453d18b43 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageReader.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageReader.java @@ -31,8 +31,7 @@ import org.slf4j.LoggerFactory; /** - * Reader of {@link AMQPLargeMessage} content which reads all bytes and completes once a - * non-partial delivery is read. + * Reader of {@link AMQPLargeMessage} content which reads all bytes and completes once a non-partial delivery is read. */ public class AMQPLargeMessageReader implements MessageReader { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java index 1425476408f..833cee5f2bf 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPLargeMessageWriter.java @@ -44,9 +44,8 @@ import io.netty.buffer.PooledByteBufAllocator; /** - * A writer of {@link AMQPLargeMessage} content that handles the read from - * large message file and write into the AMQP sender with some respect for - * the AMQP frame size in use by this connection. + * A writer of {@link AMQPLargeMessage} content that handles the read from large message file and write into the AMQP + * sender with some respect for the AMQP frame size in use by this connection. */ public class AMQPLargeMessageWriter implements MessageWriter { @@ -272,7 +271,7 @@ private boolean deliverInitialPacket(final LargeBodyReader context, final ByteBu /** * This must be used when either the delivery annotations or re-encoded buffer is bigger than the frame size. - *
            + *

            * This will create one expandable buffer, send and flush it. */ private void sendAndFlushInitialPacket(DeliveryAnnotations deliveryAnnotationsToEncode, LargeBodyReader context) throws Exception { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPMessageWriter.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPMessageWriter.java index 5a396630c5e..ed4339e8f1d 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPMessageWriter.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPMessageWriter.java @@ -33,9 +33,8 @@ import org.slf4j.LoggerFactory; /** - * An writer of AMQP (non-large) messages or messages which will convert any - * non-AMQP message to AMQP before writing the encoded bytes into the AMQP - * sender. + * An writer of AMQP (non-large) messages or messages which will convert any non-AMQP message to AMQP before writing the + * encoded bytes into the AMQP sender. */ public class AMQPMessageWriter implements MessageWriter { 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 78f3797c9e1..fdfd3c9ae31 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 @@ -121,10 +121,6 @@ public void initialize() throws Exception { } } - /** - * @param consumer - * @param queueName - */ public void disconnect(Object consumer, String queueName) { ProtonServerSenderContext protonConsumer = senders.remove(consumer); if (protonConsumer != null) { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreLargeMessageReader.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreLargeMessageReader.java index b2821bd4817..4710660d531 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreLargeMessageReader.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreLargeMessageReader.java @@ -49,10 +49,9 @@ import io.netty.buffer.Unpooled; /** - * Reader of tunneled large Core message that have been written as the body of an - * AMQP delivery with a custom message format that indicates this payload. The reader - * will extract bytes from the delivery and write them into a Core large message file - * which is then routed into the broker as if received from a Core connection. + * Reader of tunneled large Core message that have been written as the body of an AMQP delivery with a custom message + * format that indicates this payload. The reader will extract bytes from the delivery and write them into a Core large + * message file which is then routed into the broker as if received from a Core connection. */ public class AMQPTunneledCoreLargeMessageReader implements MessageReader { @@ -60,20 +59,18 @@ public class AMQPTunneledCoreLargeMessageReader implements MessageReader { private enum State { /** - * Awaiting initial decode of first section in delivery which could be delivery - * annotations or could be the first data section which will be the core message - * headers and properties. + * Awaiting initial decode of first section in delivery which could be delivery annotations or could be the first + * data section which will be the core message headers and properties. */ INITIALIZING, /** - * Accumulating the bytes from the remote that comprise the message headers and - * properties that must be decoded before creating the large message instance. + * Accumulating the bytes from the remote that comprise the message headers and properties that must be decoded + * before creating the large message instance. */ CORE_HEADER_BUFFERING, /** - * Awaiting a Data section that contains some or all of the bytes of the - * Core large message body, there can be multiple Data sections if the size - * is greater than 2GB or the peer encodes them in smaller chunks + * Awaiting a Data section that contains some or all of the bytes of the Core large message body, there can be + * multiple Data sections if the size is greater than 2GB or the peer encodes them in smaller chunks */ BODY_SECTION_PENDING, /** diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreLargeMessageWriter.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreLargeMessageWriter.java index 04a3ad2f1ba..a9d53eb0541 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreLargeMessageWriter.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreLargeMessageWriter.java @@ -43,12 +43,10 @@ import io.netty.buffer.Unpooled; /** - * Writer of tunneled large Core messages that will be written as the body of an - * AMQP delivery with a custom message format that indicates this payload. The writer - * will read bytes from the Core large message file and write them into an AMQP - * Delivery that will be sent across to the remote peer where it can be processed - * and a Core message recreated for dispatch as if it had been sent from a Core - * connection. + * Writer of tunneled large Core messages that will be written as the body of an AMQP delivery with a custom message + * format that indicates this payload. The writer will read bytes from the Core large message file and write them into + * an AMQP Delivery that will be sent across to the remote peer where it can be processed and a Core message recreated + * for dispatch as if it had been sent from a Core connection. */ public class AMQPTunneledCoreLargeMessageWriter implements MessageWriter { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreMessageReader.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreMessageReader.java index a245b534e57..87dcf085aa8 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreMessageReader.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreMessageReader.java @@ -42,10 +42,9 @@ import org.apache.qpid.proton.engine.Receiver; /** - * Reader of tunneled Core message that have been written as the body of an AMQP - * delivery with a custom message format that indicates this payload. The reader - * will extract bytes from the delivery and decode from them a standard Core message - * which is then routed into the broker as if received from a Core connection. + * Reader of tunneled Core message that have been written as the body of an AMQP delivery with a custom message format + * that indicates this payload. The reader will extract bytes from the delivery and decode from them a standard Core + * message which is then routed into the broker as if received from a Core connection. */ public class AMQPTunneledCoreMessageReader implements MessageReader { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreMessageWriter.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreMessageWriter.java index 5aaa09a66a7..5e603947576 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreMessageWriter.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreMessageWriter.java @@ -41,12 +41,10 @@ import io.netty.buffer.Unpooled; /** - * Writer of tunneled Core messages that will be written as the body of an AMQP - * delivery with a custom message format that indicates this payload. The writer - * will encode the bytes from the Core large message file and write them into an - * AMQP Delivery that will be sent across to the remote peer where it can be - * processed and a Core message recreated for dispatch as if it had been sent from - * a Core connection. + * Writer of tunneled Core messages that will be written as the body of an AMQP delivery with a custom message format + * that indicates this payload. The writer will encode the bytes from the Core large message file and write them into an + * AMQP Delivery that will be sent across to the remote peer where it can be processed and a Core message recreated for + * dispatch as if it had been sent from a Core connection. */ public class AMQPTunneledCoreMessageWriter implements MessageWriter { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledMessageConstants.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledMessageConstants.java index d3d5eaca94f..8928c75d861 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledMessageConstants.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledMessageConstants.java @@ -17,15 +17,13 @@ package org.apache.activemq.artemis.protocol.amqp.proton; /** - * Message constants used for handling the "tunneling" of other protocol messages - * in an AMQP delivery sent from one broker to another without conversion. - * - * A tunneled Core message is sent with a custom message format indicating either - * a standard or large core message is carried within. The message is encoded using - * the standard (message format zero) AMQP message structure. The core message is - * encoded in the body section as two or more Data sections. The first being the - * message headers and properties encoding. Any remaining Data sections comprise - * the body of the Core message. + * Message constants used for handling the "tunneling" of other protocol messages in an AMQP delivery sent from one + * broker to another without conversion. + *

            + * A tunneled Core message is sent with a custom message format indicating either a standard or large core message is + * carried within. The message is encoded using the standard (message format zero) AMQP message structure. The core + * message is encoded in the body section as two or more Data sections. The first being the message headers and + * properties encoding. Any remaining Data sections comprise the body of the Core message. */ public class AMQPTunneledMessageConstants { @@ -36,19 +34,13 @@ public class AMQPTunneledMessageConstants { */ private static final int ARTEMIS_TUNNELED_MESSAGE_FORMAT_PREFIX = 0x468C0000; - /* - * Used to indicate that the format contains a Core message (non-large). - */ + // Used to indicate that the format contains a Core message (non-large). private static final int ARTEMIS_CORE_MESSAGE_TYPE = 0x00000100; - /* - * Used to indicate that the format contains a Core large message. - */ + // Used to indicate that the format contains a Core large message. private static final int ARTEMIS_CORE_LARGE_MESSAGE_TYPE = 0x00000200; - /* - * Indicate version one of the message format - */ + // Indicate version one of the message format private static final int ARTEMIS_MESSAGE_FORMAT_V1 = 0x00; /** diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AmqpSupport.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AmqpSupport.java index 25c827ee052..5236d1f96b5 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AmqpSupport.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AmqpSupport.java @@ -102,50 +102,42 @@ public class AmqpSupport { public static final Symbol SOLE_CONNECTION_CAPABILITY = Symbol.valueOf("sole-connection-for-container"); /** - * A capability added to the sender or receiver links that indicate that the link either wants - * support for or offers support for tunneling Core messages as custom formatted AMQP messages. + * A capability added to the sender or receiver links that indicate that the link either wants support for or offers + * support for tunneling Core messages as custom formatted AMQP messages. */ public static final Symbol CORE_MESSAGE_TUNNELING_SUPPORT = Symbol.getSymbol("AMQ_CORE_MESSAGE_TUNNELING"); /** - * Property value that can be applied to federation configuration that controls if the federation - * receivers will request that the sender peer tunnel core messages inside an AMQP message as a binary - * blob to be unwrapped on the other side. The sending peer would still need to support this feature - * for message tunneling to occur. + * Property value that can be applied to federation configuration that controls if the federation receivers will + * request that the sender peer tunnel core messages inside an AMQP message as a binary blob to be unwrapped on the + * other side. The sending peer would still need to support this feature for message tunneling to occur. */ public static final String TUNNEL_CORE_MESSAGES = "tunnel-core-messages"; /** - * A priority value added to a remote receiver link attach that indicates the desired priority - * for the receiver created for the link. + * A priority value added to a remote receiver link attach that indicates the desired priority for the receiver + * created for the link. */ public static final Symbol RECEIVER_PRIORITY = Symbol.getSymbol("priority"); /** - * Check the set of remote properties sent on link attach for any values that - * are treated as indicating priority and return the match if any. If no priority - * is indicated in the link properties this method returns null. + * Check the set of remote properties sent on link attach for any values that are treated as indicating priority and + * return the match if any. If no priority is indicated in the link properties this method returns null. * - * @param remoteProperties - * The {@link Map} of remote properties sent on the remote attach. - * - * @return a {@link Number} indicating the desired link priority or null if none. + * @param remoteProperties The {@link Map} of remote properties sent on the remote attach. + * @return a {@link Number} indicating the desired link priority or null if none */ public static Number getReceiverPriority(Map remoteProperties) { return getReceiverPriority(remoteProperties, null); } /** - * Check the set of remote properties sent on link attach for any values that - * are treated as indicating priority and return the match if any. If no priority - * is indicated in the link properties this method returns null. - * - * @param remoteProperties - * The {@link Map} of remote properties sent on the remote attach. - * @param defaultPriority - * The default value that should be returned if no remote priority indicated. + * Check the set of remote properties sent on link attach for any values that are treated as indicating priority and + * return the match if any. If no priority is indicated in the link properties this method returns null. * - * @return a {@link Number} indicating the desired link priority or null if none. + * @param remoteProperties The {@link Map} of remote properties sent on the remote attach. + * @param defaultPriority The default value that should be returned if no remote priority indicated. + * @return a {@link Number} indicating the desired link priority or null if none */ public static Number getReceiverPriority(Map remoteProperties, Number defaultPriority) { final Number remotePriority = remoteProperties != null ? (Number) remoteProperties.get(RECEIVER_PRIORITY) : null; @@ -157,7 +149,7 @@ public static Number getReceiverPriority(Map remoteProperties, N * * @param symbols the set of Symbols to search. * @param key the value to try and find in the Symbol array. - * @return true if the key is found in the given Symbol array. + * @return {@code true} if the key is found in the given Symbol array */ public static boolean contains(Symbol[] symbols, Symbol key) { if (symbols == null || symbols.length == 0) { @@ -174,12 +166,11 @@ public static boolean contains(Symbol[] symbols, Symbol key) { } /** - * Search for a particular filter using a set of known identification values - * in the Map of filters. + * Search for a particular filter using a set of known identification values in the Map of filters. * * @param filters The filters map that should be searched. * @param filterIds The aliases for the target filter to be located. - * @return the filter if found in the mapping or null if not found. + * @return the filter if found in the mapping or null if not found */ public static Map.Entry findFilter(Map filters, Object[] filterIds) { @@ -215,39 +206,32 @@ public static Map.Entry findFilter(Map fi private static final Symbol[] EMPTY_CAPABILITIES = new Symbol[0]; /** - * Verifies that the desired capabilities that were sent to the remote were indeed - * offered in return. If the remote has not offered a capability that was desired then - * the initiating resource should determine if the offered set is still acceptable or - * it should close the link and report the reason. + * Verifies that the desired capabilities that were sent to the remote were indeed offered in return. If the remote + * has not offered a capability that was desired then the initiating resource should determine if the offered set is + * still acceptable or it should close the link and report the reason. *

            - * The remote could have offered more capabilities than the requested desired capabilities, - * this method does not validate that or consider that a failure. - * - * @param link - * The link in question (Sender or Receiver). + * The remote could have offered more capabilities than the requested desired capabilities, this method does not + * validate that or consider that a failure. * - * @return true if the remote offered all of the capabilities that were desired. + * @param link The link in question (Sender or Receiver). + * @return {@code true} if the remote offered all of the capabilities that were desired */ public static boolean verifyOfferedCapabilities(final Link link) { return verifyCapabilities(link.getRemoteOfferedCapabilities(), link.getDesiredCapabilities()); } /** - * Verifies that the given set of desired capabilities (which should be the full set of - * desired capabilities configured on the link or a subset of those values) are indeed - * offered in return. If the remote has not offered a capability that was desired then - * the initiating resource should determine if the offered set is still acceptable or - * it should close the link and report the reason. + * Verifies that the given set of desired capabilities (which should be the full set of desired capabilities + * configured on the link or a subset of those values) are indeed offered in return. If the remote has not offered a + * capability that was desired then the initiating resource should determine if the offered set is still acceptable + * or it should close the link and report the reason. *

            - * The remote could have offered more capabilities than the requested desired capabilities, - * this method does not validate that or consider that a failure. + * The remote could have offered more capabilities than the requested desired capabilities, this method does not + * validate that or consider that a failure. * - * @param link - * The link in question (Sender or Receiver). - * @param capabilities - * The capabilities that are required being checked for. - * - * @return true if the remote offered all of the capabilities that were desired. + * @param link The link in question (Sender or Receiver). + * @param capabilities The capabilities that are required being checked for. + * @return {@code true} if the remote offered all of the capabilities that were desired */ public static boolean verifyOfferedCapabilities(final Link link, final Symbol... capabilities) { return verifyCapabilities(link.getRemoteOfferedCapabilities(), capabilities); @@ -256,15 +240,12 @@ public static boolean verifyOfferedCapabilities(final Link link, final Symbol... /** * Verifies that the given desired capability is present in the remote link details. *

            - * The remote could have desired more capabilities than the one given, this method does - * not validate that or consider that a failure. - * - * @param link - * The link in question (Sender or Receiver). - * @param desiredCapability - * The non-null capability that is being checked as being desired. + * The remote could have desired more capabilities than the one given, this method does not validate that or consider + * that a failure. * - * @return true if the remote desired all of the capabilities that were given. + * @param link The link in question (Sender or Receiver). + * @param desiredCapability The non-null capability that is being checked as being desired. + * @return {@code true} if the remote desired all of the capabilities that were given */ public static boolean verifyDesiredCapability(final Link link, final Symbol desiredCapability) { return verifyCapabilities(link.getRemoteDesiredCapabilities(), desiredCapability); @@ -273,12 +254,9 @@ public static boolean verifyDesiredCapability(final Link link, final Symbol desi /** * Verifies that the desired capability is present in the Source capabilities. * - * @param source - * The Source instance whose capabilities are being searched. - * @param capability - * The non-null capability that is being checked as being desired. - * - * @return true if the remote desired all of the capabilities that were given. + * @param source The Source instance whose capabilities are being searched. + * @param capability The non-null capability that is being checked as being desired. + * @return {@code true} if the remote desired all of the capabilities that were given */ public static boolean verifySourceCapability(final Source source, final Symbol capability) { return verifyCapabilities(source.getCapabilities(), capability); @@ -287,12 +265,9 @@ public static boolean verifySourceCapability(final Source source, final Symbol c /** * Verifies that the desired capability is present in the Source capabilities. * - * @param target - * The Target instance whose capabilities are being searched. - * @param capability - * The non-null capability that is being checked as being desired. - * - * @return true if the remote desired all of the capabilities that were given. + * @param target The Target instance whose capabilities are being searched. + * @param capability The non-null capability that is being checked as being desired. + * @return {@code true} if the remote desired all of the capabilities that were given */ public static boolean verifyTargetCapability(final Target target, final Symbol capability) { return verifyCapabilities(target.getCapabilities(), capability); @@ -301,15 +276,12 @@ public static boolean verifyTargetCapability(final Target target, final Symbol c /** * Verifies that the given set of capabilities contains each of the desired capabilities. *

            - * The remote could have offered more capabilities than the requested desired capabilities, - * this method does not validate that or consider that a failure. + * The remote could have offered more capabilities than the requested desired capabilities, this method does not + * validate that or consider that a failure. * - * @param offered - * The capabilities that were offered from the remote or were set by the local side - * @param desired - * The desired capabilities to search for in the offered set. - * - * @return true if the desired capabilities were found in the offered set. + * @param offered The capabilities that were offered from the remote or were set by the local side + * @param desired The desired capabilities to search for in the offered set. + * @return {@code true} if the desired capabilities were found in the offered set */ public static boolean verifyCapabilities(final Symbol[] offered, final Symbol... desired) { final Symbol[] desiredCapabilites = desired == null ? EMPTY_CAPABILITIES : desired; @@ -336,20 +308,13 @@ public static boolean verifyCapabilities(final Symbol[] offered, final Symbol... /** * Given the input values construct a Queue name for use in messaging handlers. * - * @param useCoreSubscriptionNaming - * Should the name match core client subscription naming. - * @param clientId - * The client ID of the remote peer. - * @param senderId - * The ID assigned to the sender asking for a generated Queue name. - * @param shared - * Is this Queue used for shared subscriptions - * @param global - * Should the shared subscription Queue indicate globally shared. - * @param isVolatile - * Is the Queue meant to be volatile or not. - * - * @return a queue name based on the provided inputs. + * @param useCoreSubscriptionNaming Should the name match core client subscription naming. + * @param clientId The client ID of the remote peer. + * @param senderId The ID assigned to the sender asking for a generated Queue name. + * @param shared Is this Queue used for shared subscriptions + * @param global Should the shared subscription Queue indicate globally shared. + * @param isVolatile Is the Queue meant to be volatile or not. + * @return a queue name based on the provided inputs */ public static SimpleString createQueueName(boolean useCoreSubscriptionNaming, String clientId, diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AmqpTransferTagGenerator.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AmqpTransferTagGenerator.java index 3337fd122a3..402068bb417 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AmqpTransferTagGenerator.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AmqpTransferTagGenerator.java @@ -20,8 +20,8 @@ import java.util.Deque; /** - * Utility class that can generate and if enabled pool the binary tag values - * used to identify transfers over an AMQP link. + * Utility class that can generate and if enabled pool the binary tag values used to identify transfers over an AMQP + * link. */ public final class AmqpTransferTagGenerator { @@ -47,7 +47,7 @@ public AmqpTransferTagGenerator(boolean pool) { /** * Retrieves the next available tag. * - * @return a new or unused tag depending on the pool option. + * @return a new or unused tag depending on the pool option */ public synchronized byte[] getNextTag() { byte[] tagBytes = null; @@ -71,11 +71,9 @@ public synchronized byte[] getNextTag() { } /** - * When used as a pooled cache of tags the unused tags should always be - * returned once the transfer has been settled. + * When used as a pooled cache of tags the unused tags should always be returned once the transfer has been settled. * - * @param data - * a previously borrowed tag that is no longer in use. + * @param data a previously borrowed tag that is no longer in use. */ public synchronized void returnTag(byte[] data) { if (tagPool != null && tagPool.size() < maxPoolSize) { @@ -86,26 +84,24 @@ public synchronized void returnTag(byte[] data) { /** * Gets the current max pool size value. * - * @return the current max tag pool size. + * @return the current max tag pool size */ public int getMaxPoolSize() { return maxPoolSize; } /** - * Sets the max tag pool size. If the size is smaller than the current number - * of pooled tags the pool will drain over time until it matches the max. + * Sets the max tag pool size. If the size is smaller than the current number of pooled tags the pool will drain over + * time until it matches the max. * - * @param maxPoolSize - * the maximum number of tags to hold in the pool. + * @param maxPoolSize the maximum number of tags to hold in the pool. */ public void setMaxPoolSize(int maxPoolSize) { this.maxPoolSize = maxPoolSize; } /** - * @return true if the generator is using a pool of tags to reduce - * allocations. + * {@return {@code true} if the generator is using a pool of tags to reduce allocations} */ public boolean isPooling() { return tagPool != null; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/DefaultSenderController.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/DefaultSenderController.java index ffa0198eb0b..d1d95c418db 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/DefaultSenderController.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/DefaultSenderController.java @@ -74,13 +74,11 @@ import org.slf4j.LoggerFactory; /** - * The default {@link SenderController} instance used by and sender context that is not - * assigned a custom controller. This controller is extensible so that specialized sender - * controllers can be created from it. + * The default {@link SenderController} instance used by and sender context that is not assigned a custom controller. + * This controller is extensible so that specialized sender controllers can be created from it. *

            - * The default controller works best with incoming AMQP clients and JMS over AMQP clients. - * For intra-broker connections it is likely that a custom sender controller would be a more - * flexible option that using the default controller. + * The default controller works best with incoming AMQP clients and JMS over AMQP clients. For intra-broker connections + * it is likely that a custom sender controller would be a more flexible option that using the default controller. */ public class DefaultSenderController implements SenderController { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/MessageReader.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/MessageReader.java index 020dc6d1422..ccad21ca31c 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/MessageReader.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/MessageReader.java @@ -22,47 +22,42 @@ import org.apache.qpid.proton.engine.Delivery; /** - * Message reader for incoming messages from and AMQP receiver context which will - * handle the read and decode of message payload into am AMQP message. + * Message reader for incoming messages from and AMQP receiver context which will handle the read and decode of message + * payload into am AMQP message. */ public interface MessageReader { /** - * Closes the reader and releases any in use resources. If the reader was not - * finished processing an incoming message when closed the reader should release - * any resources that might be held such as large message files etc. + * Closes the reader and releases any in use resources. If the reader was not finished processing an incoming message + * when closed the reader should release any resources that might be held such as large message files etc. */ void close(); /** - * Reset any internal state of this reader and prepares it to begin processing a - * new delivery. A previously closed reader can be reset for reuse. + * Reset any internal state of this reader and prepares it to begin processing a new delivery. A previously closed + * reader can be reset for reuse. * - * @return this {@link MessageReader} instance. + * @return this {@link MessageReader} instance */ MessageReader open(); /** - * Reads the bytes from an incoming delivery which might not be complete yet - * but allows the reader to consume pending bytes to prevent stalling the sender - * because the session window was exhausted. Once a delivery has been fully read - * and is no longer partial the readBytes method will return the decoded message - * for dispatch. - * + * Reads the bytes from an incoming delivery which might not be complete yet but allows the reader to consume pending + * bytes to prevent stalling the sender because the session window was exhausted. Once a delivery has been fully read + * and is no longer partial the readBytes method will return the decoded message for dispatch. + *

            * Notice that asynchronous Readers will never return the Message but will rather call a complete operation on the * Server Receiver. * - * @param delivery - * The delivery that has pending incoming bytes. + * @param delivery The delivery that has pending incoming bytes. */ Message readBytes(Delivery delivery) throws Exception; /** - * Once a message has been read but before the reader is closed this API offers - * access to any delivery annotations that were present upon decode of the read - * message. + * Once a message has been read but before the reader is closed this API offers access to any delivery annotations + * that were present upon decode of the read message. * - * @return any DeliveryAnnotations that were read as part of decoding the message. + * @return any DeliveryAnnotations that were read as part of decoding the message */ DeliveryAnnotations getDeliveryAnnotations(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/MessageWriter.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/MessageWriter.java index 911ffcc5905..90a395bb9e5 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/MessageWriter.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/MessageWriter.java @@ -22,18 +22,16 @@ import org.apache.activemq.artemis.core.server.MessageReference; /** - * Message writer for outgoing message from and AMQP sender context which will - * handle the encode and write of message payload into am AMQP sender. + * Message writer for outgoing message from and AMQP sender context which will handle the encode and write of message + * payload into am AMQP sender. */ public interface MessageWriter extends Consumer { /** - * Entry point for asynchronous delivery mechanics which is equivalent to calling - * the {@link #writeBytes(MessageReference)} method. - * - * @param messageReference - * The original message reference that triggered the delivery. + * Entry point for asynchronous delivery mechanics which is equivalent to calling the + * {@link #writeBytes(MessageReference)} method. * + * @param messageReference The original message reference that triggered the delivery. * @see #writeBytes(MessageReference) */ @Override @@ -42,53 +40,46 @@ default void accept(MessageReference messageReference) { } /** - * This should return true when a delivery is still in progress as a - * hint to the sender that new messages can't be accepted yet. The handler can be - * paused during delivery of large payload data due to IO or session back pressure. - * The context is responsible for scheduling itself for resumption when it finds - * that it must halt delivery work. + * This should return {@code true} when a delivery is still in progress as a hint to the sender that new messages + * can't be accepted yet. The handler can be paused during delivery of large payload data due to IO or session back + * pressure. The context is responsible for scheduling itself for resumption when it finds that it must halt delivery + * work. *

            - * This could be called from outside the connection thread so the state should be - * thread safe however the sender should take care to restart deliveries in a safe - * way taking into account that this value might not get seen by other threads in - * its non-busy state when the delivery completes. + * This could be called from outside the connection thread so the state should be thread safe however the sender + * should take care to restart deliveries in a safe way taking into account that this value might not get seen by + * other threads in its non-busy state when the delivery completes. * - * @return true if the handler is still working on delivering a message. + * @return {@code true} if the handler is still working on delivering a message */ default boolean isWriting() { return false; } /** - * Begin delivery of a message providing the original message reference instance. The writer - * should be linked to a parent sender or sender controller which it will use for obtaining - * services needed to send and complete sending operations. This must be called from the - * connection thread. + * Begin delivery of a message providing the original message reference instance. The writer should be linked to a + * parent sender or sender controller which it will use for obtaining services needed to send and complete sending + * operations. This must be called from the connection thread. *

            - * Once delivery processing completes (successful or not) the handler must inform the - * server sender of the outcome so that further deliveries can be sent or error processing - * can commence. + * Once delivery processing completes (successful or not) the handler must inform the server sender of the outcome so + * that further deliveries can be sent or error processing can commence. * - * @param messageReference - * The original message reference that triggered the delivery. + * @param messageReference The original message reference that triggered the delivery. */ void writeBytes(MessageReference messageReference); /** - * Mark the writer as done and release any resources that it might be holding, this call - * should trigger the busy method to return false for any handler that has a busy state. - * It is expected that the sender will close each handler after it reports that writing - * the message has completed. This must be called from the connection thread. + * Mark the writer as done and release any resources that it might be holding, this call should trigger the busy + * method to return false for any handler that has a busy state. It is expected that the sender will close each + * handler after it reports that writing the message has completed. This must be called from the connection thread. */ default void close() { // By default stateless writers have no reaction to closed events. } /** - * Opens the handler and ensures the handler state is in its initial values to prepare for - * a new message write. This is only applicable to handlers that have state data but should - * be called on every handler by the sender context as it doesn't know which instances need - * opened. + * Opens the handler and ensures the handler state is in its initial values to prepare for a new message write. This + * is only applicable to handlers that have state data but should be called on every handler by the sender context as + * it doesn't know which instances need opened. */ default MessageWriter open(MessageReference reference) { // Default for stateless handlers is to do nothing here. diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonAbstractReceiver.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonAbstractReceiver.java index 1bfdebaa47e..794b9055b4e 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonAbstractReceiver.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonAbstractReceiver.java @@ -91,9 +91,8 @@ public AMQPSessionContext getSessionContext() { } /** - * Starts the receiver if not already started which triggers a flow of credit - * to the remote to begin the processing of incoming messages. This must be - * called on the connection thread and will throw and exception if not. + * Starts the receiver if not already started which triggers a flow of credit to the remote to begin the processing + * of incoming messages. This must be called on the connection thread and will throw and exception if not. * * @throws IllegalStateException if not called from the connection thread or is closed or stopping. */ @@ -115,19 +114,15 @@ public void start() { } /** - * Stop the receiver from granting additional credit and drains any granted credit - * from the link already. If any pending settles or queued message remain in the work - * queue then the stop occurs asynchronously and the stop callback is signaled later - * otherwise it will be triggered on the current thread to avoid state changes from - * making an asynchronous call invalid. The stop call allows a timeout to be specified - * which will signal the stopped consumer if the timeout elapses and leaves the receiver - * in the stopping state which does not allow for a restart. - * - * @param stopTimeout - * A time in milliseconds to wait for the stop to complete before considering it as having failed. - * @param onStopped - * A consumer that is signaled once the receiver has stopped or the timeout elapsed. + * Stop the receiver from granting additional credit and drains any granted credit from the link already. If any + * pending settles or queued message remain in the work queue then the stop occurs asynchronously and the stop + * callback is signaled later otherwise it will be triggered on the current thread to avoid state changes from making + * an asynchronous call invalid. The stop call allows a timeout to be specified which will signal the stopped + * consumer if the timeout elapses and leaves the receiver in the stopping state which does not allow for a restart. * + * @param stopTimeout A time in milliseconds to wait for the stop to complete before considering it as having + * failed. + * @param onStopped A consumer that is signaled once the receiver has stopped or the timeout elapsed. * @throws IllegalStateException if the receiver is currently in the stopping state. */ public void stop(int stopTimeout, BiConsumer onStopped) { @@ -192,7 +187,8 @@ public boolean isClosed() { return state == ReceiverState.CLOSED; } - /** Set the proper operation context in the Thread Local. + /** + * Set the proper operation context in the Thread Local. * Return the old context*/ protected OperationContext recoverContext() { return sessionSPI.recoverContext(); @@ -208,26 +204,22 @@ protected void closeCurrentReader() { } /** - * Subclass can override this to provide a custom credit runnable that performs - * other checks or applies credit in a manner more fitting that implementation. + * Subclass can override this to provide a custom credit runnable that performs other checks or applies credit in a + * manner more fitting that implementation. * - * @param connection - * The {@link AMQPConnectionContext} that this resource falls under. - * - * @return a {@link Runnable} that will perform the actual credit granting operation. + * @param connection The {@link AMQPConnectionContext} that this resource falls under. + * @return a {@link Runnable} that will perform the actual credit granting operation */ protected Runnable createCreditRunnable(AMQPConnectionContext connection) { return createCreditRunnable(connection.getAmqpCredits(), connection.getAmqpLowCredits(), receiver, connection, this); } /** - * Subclass can override this to provide the minimum large message size that should - * be used when creating receiver instances. - * - * @param connection - * The {@link AMQPConnectionContext} that this resource falls under. + * Subclass can override this to provide the minimum large message size that should be used when creating receiver + * instances. * - * @return the minimum large message size configuration value for this receiver. + * @param connection The {@link AMQPConnectionContext} that this resource falls under. + * @return the minimum large message size configuration value for this receiver */ protected int getConfiguredMinLargeMessageSize(AMQPConnectionContext connection) { return connection.getProtocolManager().getAmqpMinLargeMessageSize(); @@ -236,18 +228,12 @@ protected int getConfiguredMinLargeMessageSize(AMQPConnectionContext connection) /** * This Credit Runnable can be used to manage the credit replenishment of a target AMQP receiver. * - * @param refill - * The number of credit to top off the receiver to - * @param threshold - * The low water mark for credit before refill is done - * @param receiver - * The proton receiver that will have its credit refilled - * @param connection - * The connection that own the receiver - * @param context - * The context that will be associated with the receiver - * - * @return A new Runnable that can be used to keep receiver credit replenished. + * @param refill The number of credit to top off the receiver to + * @param threshold The low water mark for credit before refill is done + * @param receiver The proton receiver that will have its credit refilled + * @param connection The connection that own the receiver + * @param context The context that will be associated with the receiver + * @return A new Runnable that can be used to keep receiver credit replenished */ public static Runnable createCreditRunnable(int refill, int threshold, @@ -258,20 +244,15 @@ public static Runnable createCreditRunnable(int refill, } /** - * This servers as the default credit runnable which grants credit in batches based on a - * low water mark and a configured credit size to top the credit up to once the low water - * mark has been reached. + * This servers as the default credit runnable which grants credit in batches based on a low water mark and a + * configured credit size to top the credit up to once the low water mark has been reached. */ protected static class FlowControlRunner implements Runnable { - /* - * The number of credits sent to the remote when the runnable decides that a top off is needed. - */ + // The number of credits sent to the remote when the runnable decides that a top off is needed. final int refill; - /* - * The low water mark before the runnable considers performing a credit top off. - */ + // The low water mark before the runnable considers performing a credit top off. final int threshold; final Receiver receiver; @@ -406,7 +387,7 @@ protected MessageReader trySelectMessageReader(Receiver receiver, Delivery deliv } } - /* + /** * called when Proton receives a message to be delivered via a Delivery. * * This may be called more than once per deliver so we have to cache the buffer until we have received it all. @@ -479,29 +460,21 @@ public void onExceptionWhileReading(Throwable e) { } /** - * Returns either the fixed address assigned to this sender, or the last address used by - * an anonymous relay sender. If this is an anonymous relay and no send has occurred then - * this method returns null. - * - * @return the assigned address or the last used address if any for anonymous relay senders. + * {@return either the fixed address assigned to this sender, or the last address used by an anonymous relay sender; + * if this is an anonymous relay and no send has occurred then this method returns {@code null}} */ protected abstract SimpleString getAddressInUse(); /** - * Perform the actual message processing for an inbound message. The subclass either consumes and settles - * the message in place or hands it off to another intermediary who is responsible for eventually settling - * the newly read message. + * Perform the actual message processing for an inbound message. The subclass either consumes and settles the message + * in place or hands it off to another intermediary who is responsible for eventually settling the newly read + * message. * - * @param message - * The message as provided from the remote or after local transformation by subclass. - * @param delivery - * The proton delivery where the message bytes where read from - * @param deliveryAnnotations - * The delivery annotations if present that accompanied the incoming message. - * @param receiver - * The proton receiver that represents the link over which the message was sent. - * @param tx - * The transaction under which the incoming message was sent. + * @param message The message as provided from the remote or after local transformation by subclass. + * @param delivery The proton delivery where the message bytes where read from + * @param deliveryAnnotations The delivery annotations if present that accompanied the incoming message. + * @param receiver The proton receiver that represents the link over which the message was sent. + * @param tx The transaction under which the incoming message was sent. */ protected abstract void actualDelivery(Message message, Delivery delivery, DeliveryAnnotations deliveryAnnotations, Receiver receiver, Transaction tx); @@ -536,9 +509,9 @@ private void signalStoppedCallback(boolean stopped) { /** * Performs the actual credit top up logic for the receiver. - * - * This can be overridden in the subclass to run its own logic for credit top - * up instead of using the default logic used in this abstract base. + *

            + * This can be overridden in the subclass to run its own logic for credit top up instead of using the default logic + * used in this abstract base. */ protected void doCreditTopUpRun() { connection.requireInHandler(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonDeliveryHandler.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonDeliveryHandler.java index 43f191368ff..dbd9ebfe1d8 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonDeliveryHandler.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonDeliveryHandler.java @@ -30,9 +30,10 @@ public interface ProtonDeliveryHandler { void onMessage(Delivery delivery) throws ActiveMQAMQPException; /* - * we have to distinguish between a remote close on the link and a close via a connection or session as the latter mean - * that a link reattach can happen and we need to keep the underlying resource (queue/subscription) around for pub subs - * */ + * We have to distinguish between a remote close on the link and a close via a connection or session as the latter + * mean that a link reattach can happen and we need to keep the underlying resource (queue/subscription) around for + * pub subs + */ void close(boolean remoteLinkClose) throws ActiveMQAMQPException; void close(ErrorCondition condition) throws ActiveMQAMQPException; 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 ef1e0aa3f47..b658f6d7c45 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 @@ -73,8 +73,8 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr protected final AMQPSessionCallback sessionSPI; /** - * The model proton uses requires us to hold a lock in certain times - * to sync the credits we have versus the credits that are being held in proton + * The model proton uses requires us to hold a lock in certain times to sync the credits we have versus the credits + * that are being held in proton */ private final Object creditsLock = new Object(); private final boolean amqpTreatRejectAsUnmodifiedDeliveryFailed; @@ -201,9 +201,6 @@ private void setupCredit() { } } - /* - * start the sender - */ public void start() throws ActiveMQAMQPException { sessionSPI.start(); @@ -219,7 +216,7 @@ public void start() throws ActiveMQAMQPException { } /** - * create the actual underlying ActiveMQ Artemis Server Consumer + * Create the actual underlying ActiveMQ Artemis Server Consumer */ @Override public void initialize() throws Exception { @@ -248,9 +245,6 @@ public void initialize() throws Exception { } } - /* - * close the sender - */ @Override public void close(ErrorCondition condition) throws ActiveMQAMQPException { if (!closed) { @@ -276,9 +270,6 @@ public void close(ErrorCondition condition) throws ActiveMQAMQPException { } } - /* - * close the sender - */ @Override public void close(boolean remoteLinkClose) throws ActiveMQAMQPException { if (!closed) { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/SenderController.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/SenderController.java index e5ffc468478..344594cc6d5 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/SenderController.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/SenderController.java @@ -33,61 +33,50 @@ public void writeBytes(MessageReference reference) { } /** - * Used as an initial state for message writers in controllers to ensure that a - * valid version is chosen when a message is dispatched. + * Used as an initial state for message writers in controllers to ensure that a valid version is chosen when a + * message is dispatched. */ MessageWriter REJECTING_MESSAGE_WRITER = new RejectingOutgoingMessageWriter(); /** * Initialize sender controller state and handle open of AMQP sender resources * - * @param senderContext - * The sender context that is requesting controller initialization. - * - * @return a server consumer that has been initialize by the controller. - * + * @param senderContext The sender context that is requesting controller initialization. + * @return a server consumer that has been initialize by the controller * @throws Exception if an error occurs during initialization. */ Consumer init(ProtonServerSenderContext senderContext) throws Exception; /** - * Handle close of the sever sender AMQP resources either from remote link - * detach or local close usually due to connection drop. - * - * @param remoteClose - * Indicates if the remote link detached the sender or local action closed it. + * Handle close of the sever sender AMQP resources either from remote link detach or local close usually due to + * connection drop. * + * @param remoteClose Indicates if the remote link detached the sender or local action closed it. * @throws Exception if an error occurs during close. */ void close(boolean remoteClose) throws Exception; /** - * Called when the sender is being locally closed due to some error or forced - * shutdown due to resource deletion etc. The default implementation of this - * API does nothing in response to this call. + * Called when the sender is being locally closed due to some error or forced shutdown due to resource deletion etc. + * The default implementation of this API does nothing in response to this call. * - * @param error - * The error condition that triggered the close. + * @param error The error condition that triggered the close. */ default void close(ErrorCondition error) { } /** - * Controller selects a outgoing delivery writer that will handle the encoding and writing - * of the target {@link Message} carried in the given {@link MessageReference}. The selection - * process should take into account how the message pre-processing will mutate the outgoing - * message. - * - * The default implementation performs no caching of writers and should be overridden in - * subclasses to reduce GC churn, the default version is suitable for tests. - * - * @param sender - * The server sender that will make use of the returned delivery context. - * @param reference - * The message that must be sent using an outgoing context + * Controller selects a outgoing delivery writer that will handle the encoding and writing of the target + * {@link Message} carried in the given {@link MessageReference}. The selection process should take into account how + * the message pre-processing will mutate the outgoing message. + *

            + * The default implementation performs no caching of writers and should be overridden in subclasses to reduce GC + * churn, the default version is suitable for tests. * - * @return an {@link MessageWriter} to use when sending the message in the reference. + * @param sender The server sender that will make use of the returned delivery context. + * @param reference The message that must be sent using an outgoing context + * @return an {@link MessageWriter} to use when sending the message in the reference */ default MessageWriter selectOutgoingMessageWriter(ProtonServerSenderContext sender, MessageReference reference) { final MessageWriter selected; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/EventHandler.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/EventHandler.java index 4c4ac408edc..83f6934ce04 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/EventHandler.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/EventHandler.java @@ -24,9 +24,6 @@ import org.apache.qpid.proton.engine.Session; import org.apache.qpid.proton.engine.Transport; -/** - * EventHandler - */ public interface EventHandler { default void onAuthInit(ProtonHandler handler, Connection connection, boolean sasl) { 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 e794b5e08c9..a4a0076076c 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 @@ -97,16 +97,13 @@ public class ProtonHandler extends ProtonInitializable implements SaslListener { volatile boolean readable = true; - /** afterFlush and afterFlushSet properties - * are set by afterFlush methods. - * This is to be called after the flush loop. - * this is usually to be used by flow control events that - * have to take place after the incoming bytes are settled. - * - * There is only one afterFlush most of the time, and for that reason - * as an optimization we will try to use a single place most of the time - * however if more are needed we will use the list. - * */ + /** + * afterFlush and afterFlushSet properties are set by afterFlush methods. This is to be called after the flush loop. + * this is usually to be used by flow control events that have to take place after the incoming bytes are settled. + *

            + * There is only one afterFlush most of the time, and for that reason as an optimization we will try to use a single + * place most of the time however if more are needed we will use the list. + */ private Runnable afterFlush; protected Set afterFlushSet; @@ -204,9 +201,8 @@ public Long tick(boolean firstTick) { } /** - * We cannot flush until the initial handshake was finished. - * If this happens before the handshake, the connection response will happen without SASL - * and the client will respond and fail with an invalid code. + * We cannot flush until the initial handshake was finished. If this happens before the handshake, the connection + * response will happen without SASL and the client will respond and fail with an invalid code. */ public void scheduledFlush() { if (receivedFirstPacket) { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionImpl.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionImpl.java index 0e3c4e63ea6..c03ff13d4bb 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionImpl.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionImpl.java @@ -34,17 +34,18 @@ import org.apache.qpid.proton.engine.Delivery; /** - * AMQP Protocol has different TX Rollback behaviour for Acks depending on whether an AMQP delivery has been settled - * or not. This class extends the Core TransactionImpl used for normal TX behaviour. In the case where deliveries - * have been settled, normal Ack rollback is applied. For cases where deliveries are unsettled and rolled back, - * we increment the delivery count and return to the consumer. + * AMQP Protocol has different TX Rollback behaviour for Acks depending on whether an AMQP delivery has been settled or + * not. This class extends the Core TransactionImpl used for normal TX behaviour. In the case where deliveries have + * been settled, normal Ack rollback is applied. For cases where deliveries are unsettled and rolled back, we increment + * the delivery count and return to the consumer. */ public class ProtonTransactionImpl extends TransactionImpl { - /* We need to track the Message reference against the AMQP objects, so we can check whether the corresponding - deliveries have been settled. We also need to ensure we are settling on the correct link. Hence why we keep a ref - to the ProtonServerSenderContext here. - */ + /** + * We need to track the Message reference against the AMQP objects, so we can check whether the corresponding + * deliveries have been settled. We also need to ensure we are settling on the correct link. Hence why we keep a + * ref to the ProtonServerSenderContext here. + */ final Map> deliveries = new HashMap<>(); private boolean discharged; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionRefsOperation.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionRefsOperation.java index 1f61920c2c0..f4d88712425 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionRefsOperation.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/transaction/ProtonTransactionRefsOperation.java @@ -30,10 +30,10 @@ import org.apache.qpid.proton.engine.Delivery; /** - * AMQP Protocol has different TX Rollback behaviour for Acks depending on whether an AMQP delivery has been settled - * or not. This class extends the Core RefsOperation used for normal acks. In the case where deliveries have been - * settled, normal Ack rollback is applied. For cases where deliveries are unsettled and rolled back, we increment - * the delivery count and return to the consumer. + * AMQP Protocol has different TX Rollback behaviour for Acks depending on whether an AMQP delivery has been settled or + * not. This class extends the Core RefsOperation used for normal acks. In the case where deliveries have been + * settled, normal Ack rollback is applied. For cases where deliveries are unsettled and rolled back, we increment the + * delivery count and return to the consumer. */ public class ProtonTransactionRefsOperation extends RefsOperation { 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 97c916b5090..fe506fac280 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 @@ -29,9 +29,6 @@ import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; -/** - * - */ public class ExternalServerSASLFactory implements ServerSASLFactory { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); 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 5f9e1b5c887..dcfd0b7666f 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 @@ -31,9 +31,7 @@ import java.security.PrivilegedExceptionAction; import java.util.HashMap; -/* - * delegate the the jdk GSSAPI support - */ +// delegate the the jdk GSSAPI support public class GSSAPIServerSASL implements ServerSASL { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ServerSASLFactory.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ServerSASLFactory.java index 5cfa5224f91..f0ffca4381f 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ServerSASLFactory.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ServerSASLFactory.java @@ -29,31 +29,26 @@ public interface ServerSASLFactory { /** - * @return the name of the scheme to offer + * {@return the name of the scheme to offer} */ String getMechanism(); /** * creates a new {@link ServerSASL} for the provided context - * @param server - * @param manager - * @param connection - * @param remotingConnection + * * @return a new instance of {@link ServerSASL} that implements the provided mechanism */ ServerSASL create(ActiveMQServer server, ProtocolManager manager, Connection connection, RemotingConnection remotingConnection); /** - * returns the precedence of the given SASL mechanism, the default precedence is zero, where - * higher means better - * @return the precedence of this mechanism + * {@return the precedence of the given SASL mechanism, the default precedence is zero, where higher means better} */ int getPrecedence(); /** - * @return true if this mechanism should be part of the servers default permitted - * protocols or false if it must be explicitly configured + * {@return {@code true} if this mechanism should be part of the servers default permitted protocols or {@code false} + * if it must be explicitly configured} */ boolean isDefaultPermitted(); } diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ServerSASLPlain.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ServerSASLPlain.java index 42d9f946e64..d28257517b7 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ServerSASLPlain.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/ServerSASLPlain.java @@ -64,9 +64,6 @@ public void done() { /** * Hook for subclasses to perform the authentication here - * - * @param user - * @param password */ protected boolean authenticate(String user, String password) { return true; diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/SCRAMClientSASL.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/SCRAMClientSASL.java index f7b62b9a70f..8439378ba43 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/SCRAMClientSASL.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/SCRAMClientSASL.java @@ -36,11 +36,10 @@ public class SCRAMClientSASL implements ClientSASL { private final String password; /** - * @param scram the SCRAM mechanism to use + * @param scram the SCRAM mechanism to use * @param username the username for authentication * @param password the password for authentication */ - public SCRAMClientSASL(SCRAM scram, String username, String password) { this(scram, username, password, UUID.randomUUID().toString()); } 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 4b6bb0dd807..a152ec5b1e7 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 @@ -43,8 +43,8 @@ import org.slf4j.Logger; /** - * abstract class that implements the SASL-SCRAM authentication scheme, concrete implementations - * must supply the {@link SCRAM} type to use and be register via SPI + * abstract class that implements the SASL-SCRAM authentication scheme, concrete implementations must supply the + * {@link SCRAM} type to use and be register via SPI */ public abstract class SCRAMServerSASLFactory implements ServerSASLFactory { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramClientFunctionality.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramClientFunctionality.java index 6a243f37ce8..d988b797b86 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramClientFunctionality.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramClientFunctionality.java @@ -23,8 +23,10 @@ */ @SuppressWarnings("unused") public interface ScramClientFunctionality { + /** * Prepares the first client message + * * @param username Username of the user * @return First client message * @throws ScramException if username contains prohibited characters @@ -33,38 +35,41 @@ public interface ScramClientFunctionality { /** * Prepares client's final message - * @param password User password + * + * @param password User password * @param serverFirstMessage Server's first message * @return Client's final message - * @throws ScramException if there is an error processing server's message, i.e. it violates the - * protocol + * @throws ScramException if there is an error processing server's message, i.e. it violates the protocol */ String prepareFinalMessage(String password, String serverFirstMessage) throws ScramException; /** * Checks if the server's final message is valid + * * @param serverFinalMessage Server's final message - * @throws ScramException if there is an error processing server's message, i.e. it violates the - * protocol + * @throws ScramException if there is an error processing server's message, i.e. it violates the protocol */ void checkServerFinalMessage(String serverFinalMessage) throws ScramException; /** - * Checks if authentication is successful. You can call this method only if authentication is - * completed. Ensure that using {@link #isEnded()} + * Checks if authentication is successful. You can call this method only if authentication is completed. Ensure that + * using {@link #isEnded()} + * * @return true if successful, false otherwise */ boolean isSuccessful(); /** - * Checks if authentication is completed, either successfully or not. Authentication is completed - * if {@link #getState()} returns ENDED. + * Checks if authentication is completed, either successfully or not. Authentication is completed if + * {@link #getState()} returns ENDED. + * * @return true if authentication has ended */ boolean isEnded(); /** * Gets the state of the authentication procedure + * * @return Current state */ State getState(); @@ -73,21 +78,21 @@ public interface ScramClientFunctionality { * State of the authentication procedure */ enum State { - /** - * Initial state - */ - INITIAL, - /** - * State after first message is prepared - */ - FIRST_PREPARED, - /** - * State after final message is prepared - */ - FINAL_PREPARED, - /** - * Authentication is completes, either successfully or not - */ - ENDED + /** + * Initial state + */ + INITIAL, + /** + * State after first message is prepared + */ + FIRST_PREPARED, + /** + * State after final message is prepared + */ + FINAL_PREPARED, + /** + * Authentication is completes, either successfully or not + */ + ENDED } } diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramClientFunctionalityImpl.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramClientFunctionalityImpl.java index 1f566e6cac1..69d0294bdbe 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramClientFunctionalityImpl.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramClientFunctionalityImpl.java @@ -56,8 +56,9 @@ public class ScramClientFunctionalityImpl implements ScramClientFunctionality { /** * Create new ScramClientFunctionalityImpl + * * @param digestName Digest to be used - * @param hmacName HMAC to be used + * @param hmacName HMAC to be used */ public ScramClientFunctionalityImpl(String digestName, String hmacName) { this(digestName, hmacName, UUID.randomUUID().toString()); @@ -65,8 +66,9 @@ public ScramClientFunctionalityImpl(String digestName, String hmacName) { /** * Create new ScramClientFunctionalityImpl - * @param digestName Digest to be used - * @param hmacName HMAC to be used + * + * @param digestName Digest to be used + * @param hmacName HMAC to be used * @param clientNonce Client nonce to be used */ public ScramClientFunctionalityImpl(String digestName, String hmacName, String clientNonce) { @@ -86,12 +88,12 @@ public ScramClientFunctionalityImpl(String digestName, String hmacName, String c } /** - * Prepares first client message You may want to use - * {@link StringPrep#isContainingProhibitedCharacters(String)} in order to check if the username - * contains only valid characters + * Prepares first client message You may want to use {@link StringPrep#isContainingProhibitedCharacters(String)} in + * order to check if the username contains only valid characters + * * @param username Username * @return prepared first message - * @throws ScramException if username contains prohibited characters + * @throws ScramException if {@code username} contains prohibited characters */ @Override public String prepareFirstMessage(String username) throws ScramException { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramServerFunctionality.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramServerFunctionality.java index b78575c45b4..0d3b0433c4a 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramServerFunctionality.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramServerFunctionality.java @@ -16,9 +16,8 @@ package org.apache.activemq.artemis.protocol.amqp.sasl.scram; -import java.security.MessageDigest; - import javax.crypto.Mac; +import java.security.MessageDigest; import org.apache.activemq.artemis.spi.core.security.scram.ScramException; import org.apache.activemq.artemis.spi.core.security.scram.UserData; @@ -27,16 +26,18 @@ * Provides building blocks for creating SCRAM authentication server */ public interface ScramServerFunctionality { + /** * Handles client's first message + * * @param message Client's first message * @return username extracted from the client message - * @throws ScramException */ String handleClientFirstMessage(String message) throws ScramException; /** * Prepares server's first message + * * @param userData user data needed to prepare the message * @return Server's first message */ @@ -44,28 +45,31 @@ public interface ScramServerFunctionality { /** * Prepares server's final message + * * @param clientFinalMessage Client's final message * @return Server's final message - * @throws ScramException */ String prepareFinalMessage(String clientFinalMessage) throws ScramException; /** - * Checks if authentication is completed, either successfully or not. Authentication is completed - * if {@link #getState()} returns ENDED. + * Checks if authentication is completed, either successfully or not. Authentication is completed if + * {@link #getState()} returns ENDED. + * * @return true if authentication has ended */ boolean isSuccessful(); /** - * Checks if authentication is completed, either successfully or not. Authentication is completed - * if {@link #getState()} returns ENDED. + * Checks if authentication is completed, either successfully or not. Authentication is completed if + * {@link #getState()} returns ENDED. + * * @return true if authentication has ended */ boolean isEnded(); /** * Gets the state of the authentication procedure + * * @return Current state */ State getState(); @@ -74,22 +78,22 @@ public interface ScramServerFunctionality { * State of the authentication procedure */ enum State { - /** - * Initial state - */ - INITIAL, - /** - * First client message is handled (username is extracted) - */ - FIRST_CLIENT_MESSAGE_HANDLED, - /** - * First server message is prepared - */ - PREPARED_FIRST, - /** - * Authentication is completes, either successfully or not - */ - ENDED + /** + * Initial state + */ + INITIAL, + /** + * First client message is handled (username is extracted) + */ + FIRST_CLIENT_MESSAGE_HANDLED, + /** + * First server message is prepared + */ + PREPARED_FIRST, + /** + * Authentication is completes, either successfully or not + */ + ENDED } MessageDigest getDigest(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramServerFunctionalityImpl.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramServerFunctionalityImpl.java index 07cc0e16c9e..79365864856 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramServerFunctionalityImpl.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/scram/ScramServerFunctionalityImpl.java @@ -51,20 +51,20 @@ public class ScramServerFunctionalityImpl implements ScramServerFunctionality { /** * Creates new ScramServerFunctionalityImpl + * * @param digestName Digest to be used - * @param hmacName HMAC to be used - * @throws NoSuchAlgorithmException + * @param hmacName HMAC to be used */ public ScramServerFunctionalityImpl(String digestName, String hmacName) throws NoSuchAlgorithmException { this(digestName, hmacName, UUID.randomUUID().toString()); } /** - * /** Creates new ScramServerFunctionalityImpl - * @param digestName Digest to be used - * @param hmacName HMAC to be used + * Creates new ScramServerFunctionalityImpl + * + * @param digestName Digest to be used + * @param hmacName HMAC to be used * @param serverPartNonce Server's part of the nonce - * @throws NoSuchAlgorithmException */ public ScramServerFunctionalityImpl(String digestName, String hmacName, String serverPartNonce) throws NoSuchAlgorithmException { @@ -84,9 +84,9 @@ public ScramServerFunctionalityImpl(String digestName, String hmacName, /** * Handles client's first message + * * @param message Client's first message * @return username extracted from the client message - * @throws ScramException */ @Override public String handleClientFirstMessage(String message) throws ScramException { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyReadable.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyReadable.java index 5e22a4e15bc..152197cd798 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyReadable.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyReadable.java @@ -29,8 +29,8 @@ import static org.apache.activemq.artemis.utils.Preconditions.checkNotNull; /** - * {@link ReadableBuffer} implementation that wraps a Netty {@link ByteBuf} to - * allow use of Netty buffers to be used when decoding AMQP messages. + * {@link ReadableBuffer} implementation that wraps a Netty {@link ByteBuf} to allow use of Netty buffers to be used + * when decoding AMQP messages. */ public class NettyReadable implements ReadableBuffer { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyWritable.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyWritable.java index 6f363db3e0d..905beeccfa2 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyWritable.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/NettyWritable.java @@ -25,8 +25,8 @@ import io.netty.buffer.ByteBuf; /** - * {@link WritableBuffer} implementation that wraps a Netty {@link ByteBuf} to - * allow use of Netty buffers to be used when encoding AMQP messages. + * {@link WritableBuffer} implementation that wraps a Netty {@link ByteBuf} to allow use of Netty buffers to be used + * when encoding AMQP messages. */ public class NettyWritable implements WritableBuffer { diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/TLSEncode.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/TLSEncode.java index 11094e538ed..56c1c9694d2 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/TLSEncode.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/util/TLSEncode.java @@ -20,7 +20,9 @@ import org.apache.qpid.proton.codec.DecoderImpl; import org.apache.qpid.proton.codec.EncoderImpl; -/** This can go away if Proton provides this feature. */ +/** + * This can go away if Proton provides this feature. + */ public class TLSEncode { // For now Proton requires that we create a decoder to create an encoder diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageTest.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageTest.java index 531500a944c..51228637f4d 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageTest.java +++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageTest.java @@ -2156,7 +2156,9 @@ public void testGetSendBufferWithDeliveryAnnotations() { } - /** It validates we are not adding a header if we don't need to */ + /** + * It validates we are not adding a header if we don't need to + */ @Test public void testGetSendBufferWithDeliveryAnnotationsAndNoHeader() { MessageImpl protonMessage = (MessageImpl) Message.Factory.create(); diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicySupportTest.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicySupportTest.java index c3e03b7cb4b..9cab8247b0e 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicySupportTest.java +++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/connect/federation/AMQPFederationPolicySupportTest.java @@ -77,8 +77,7 @@ import io.netty.buffer.PooledByteBufAllocator; /** - * Tests for basic error checking and expected outcomes of the federation - * policy support class. + * Tests for basic error checking and expected outcomes of the federation policy support class. */ public class AMQPFederationPolicySupportTest { diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/message/AMQPMessageIdHelperTest.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/message/AMQPMessageIdHelperTest.java index 3ea496e0704..5135c518816 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/message/AMQPMessageIdHelperTest.java +++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/message/AMQPMessageIdHelperTest.java @@ -45,8 +45,8 @@ public void setUp() throws Exception { } /** - * Test that {@link AMQPMessageIdHelper#hasMessageIdPrefix(String)} returns - * true for strings that begin "ID:" + * Test that {@link AMQPMessageIdHelper#hasMessageIdPrefix(String)} returns {@code true} for strings that begin + * "ID:" */ @Test public void testHasIdPrefixWithPrefix() { @@ -55,8 +55,8 @@ public void testHasIdPrefixWithPrefix() { } /** - * Test that {@link AMQPMessageIdHelper#hasMessageIdPrefix(String)} returns - * false for string beings "ID" without colon. + * Test that {@link AMQPMessageIdHelper#hasMessageIdPrefix(String)} returns false for string beings "ID" without + * colon. */ @Test public void testHasIdPrefixWithIDButNoColonPrefix() { @@ -65,8 +65,7 @@ public void testHasIdPrefixWithIDButNoColonPrefix() { } /** - * Test that {@link AMQPMessageIdHelper#hasMessageIdPrefix(String)} returns - * false for null + * Test that {@link AMQPMessageIdHelper#hasMessageIdPrefix(String)} returns false for null */ @Test public void testHasIdPrefixWithNull() { @@ -75,8 +74,8 @@ public void testHasIdPrefixWithNull() { } /** - * Test that {@link AMQPMessageIdHelper#hasMessageIdPrefix(String)} returns - * false for strings that doesnt have "ID:" anywhere + * Test that {@link AMQPMessageIdHelper#hasMessageIdPrefix(String)} returns false for strings that doesnt have "ID:" + * anywhere */ @Test public void testHasIdPrefixWithoutPrefix() { @@ -85,8 +84,8 @@ public void testHasIdPrefixWithoutPrefix() { } /** - * Test that {@link AMQPMessageIdHelper#hasMessageIdPrefix(String)} returns - * false for strings has lowercase "id:" prefix + * Test that {@link AMQPMessageIdHelper#hasMessageIdPrefix(String)} returns false for strings has lowercase "id:" + * prefix */ @Test public void testHasIdPrefixWithLowercaseID() { @@ -95,8 +94,7 @@ public void testHasIdPrefixWithLowercaseID() { } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns - * null if given null + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns null if given null */ @Test public void testToMessageIdStringWithNull() { @@ -104,8 +102,7 @@ public void testToMessageIdStringWithNull() { } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} throws an - * IAE if given an unexpected object type. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} throws an IAE if given an unexpected object type. */ @Test public void testToMessageIdStringThrowsIAEWithUnexpectedType() { @@ -124,8 +121,8 @@ private void doToMessageIdTestImpl(Object idObject, String expected) { } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns - * the given basic "ID:content" string unchanged. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns the given basic "ID:content" string + * unchanged. */ @Test public void testToMessageIdStringWithString() { @@ -135,8 +132,8 @@ public void testToMessageIdStringWithString() { } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns - * the given basic string with the 'no prefix' prefix and "ID:" prefix. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns the given basic string with the 'no + * prefix' prefix and "ID:" prefix. */ @Test public void testToMessageIdStringWithStringNoPrefix() { @@ -147,9 +144,8 @@ public void testToMessageIdStringWithStringNoPrefix() { } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating lack of "ID:" prefix, when the given string happens to - * begin with the {@link AMQPMessageIdHelper#AMQP_UUID_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating lack of "ID:" prefix, + * when the given string happens to begin with the {@link AMQPMessageIdHelper#AMQP_UUID_PREFIX}. */ @Test public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForUUID() { @@ -160,9 +156,8 @@ public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForUUID() } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating lack of "ID:" prefix, when the given string happens to - * begin with the {@link AMQPMessageIdHelper#AMQP_ULONG_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating lack of "ID:" prefix, + * when the given string happens to begin with the {@link AMQPMessageIdHelper#AMQP_ULONG_PREFIX}. */ @Test public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForLong() { @@ -173,9 +168,8 @@ public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForLong() } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating lack of "ID:" prefix, when the given string happens to - * begin with the {@link AMQPMessageIdHelper#AMQP_BINARY_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating lack of "ID:" prefix, + * when the given string happens to begin with the {@link AMQPMessageIdHelper#AMQP_BINARY_PREFIX}. */ @Test public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForBinary() { @@ -186,9 +180,8 @@ public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForBinary( } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating lack of "ID:" prefix, when the given string happens to - * begin with the {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating lack of "ID:" prefix, + * when the given string happens to begin with the {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX}. */ @Test public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForString() { @@ -199,10 +192,8 @@ public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForString( } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating lack of "ID:" prefix, effectively twice, when the given - * string happens to begin with the - * {@link AMQPMessageIdHelper#AMQP_NO_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating lack of "ID:" prefix, + * effectively twice, when the given string happens to begin with the {@link AMQPMessageIdHelper#AMQP_NO_PREFIX}. */ @Test public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForNoIdPrefix() { @@ -213,8 +204,8 @@ public void testToMessageIdStringWithStringBeginningWithEncodingPrefixForNoIdPre } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating an AMQP encoded UUID when given a UUID object. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating an AMQP encoded UUID + * when given a UUID object. */ @Test public void testToMessageIdStringWithUUID() { @@ -225,8 +216,8 @@ public void testToMessageIdStringWithUUID() { } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating an AMQP encoded ulong when given a UnsignedLong object. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating an AMQP encoded ulong + * when given a UnsignedLong object. */ @Test public void testToMessageIdStringWithUnsignedLong() { @@ -237,8 +228,8 @@ public void testToMessageIdStringWithUnsignedLong() { } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating an AMQP encoded binary when given a Binary object. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating an AMQP encoded binary + * when given a Binary object. */ @Test public void testToMessageIdStringWithBinary() { @@ -251,10 +242,9 @@ public void testToMessageIdStringWithBinary() { } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating an escaped string, when given an input string that - * already has the "ID:" prefix, but follows it with an encoding prefix, in - * this case the {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating an escaped string, + * when given an input string that already has the "ID:" prefix, but follows it with an encoding prefix, in this case + * the {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX}. */ @Test public void testToMessageIdStringWithStringBeginningWithIdAndEncodingPrefixForString() { @@ -265,10 +255,9 @@ public void testToMessageIdStringWithStringBeginningWithIdAndEncodingPrefixForSt } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating an escaped string, when given an input string that - * already has the "ID:" prefix, but follows it with an encoding prefix, in - * this case the {@link AMQPMessageIdHelper#AMQP_UUID_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating an escaped string, + * when given an input string that already has the "ID:" prefix, but follows it with an encoding prefix, in this case + * the {@link AMQPMessageIdHelper#AMQP_UUID_PREFIX}. */ @Test public void testToMessageIdStringWithStringBeginningWithIdAndEncodingPrefixForUUID() { @@ -279,10 +268,9 @@ public void testToMessageIdStringWithStringBeginningWithIdAndEncodingPrefixForUU } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating an escaped string, when given an input string that - * already has the "ID:" prefix, but follows it with an encoding prefix, in - * this case the {@link AMQPMessageIdHelper#AMQP_ULONG_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating an escaped string, + * when given an input string that already has the "ID:" prefix, but follows it with an encoding prefix, in this case + * the {@link AMQPMessageIdHelper#AMQP_ULONG_PREFIX}. */ @Test public void testToMessageIdStringWithStringBeginningWithIdAndEncodingPrefixForUlong() { @@ -293,10 +281,9 @@ public void testToMessageIdStringWithStringBeginningWithIdAndEncodingPrefixForUl } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating an escaped string, when given an input string that - * already has the "ID:" prefix, but follows it with an encoding prefix, in - * this case the {@link AMQPMessageIdHelper#AMQP_BINARY_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating an escaped string, + * when given an input string that already has the "ID:" prefix, but follows it with an encoding prefix, in this case + * the {@link AMQPMessageIdHelper#AMQP_BINARY_PREFIX}. */ @Test public void testToMessageIdStringWithStringBeginningWithIdAndEncodingPrefixForBinary() { @@ -307,10 +294,9 @@ public void testToMessageIdStringWithStringBeginningWithIdAndEncodingPrefixForBi } /** - * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a - * string indicating an escaped string, when given an input string that - * already has the "ID:" prefix, but follows it with an encoding prefix, in - * this case the {@link AMQPMessageIdHelper#AMQP_NO_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a string indicating an escaped string, + * when given an input string that already has the "ID:" prefix, but follows it with an encoding prefix, in this case + * the {@link AMQPMessageIdHelper#AMQP_NO_PREFIX}. */ @Test public void testToMessageIdStringWithStringBeginningWithIdAndEncodingPrefixForNoIDPrefix() { @@ -321,8 +307,8 @@ public void testToMessageIdStringWithStringBeginningWithIdAndEncodingPrefixForNo } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns null if given null + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns {@code null} if given + * {@code null} */ @Test public void testToCorrelationIdStringWithNull() { @@ -330,8 +316,8 @@ public void testToCorrelationIdStringWithNull() { } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} throws - * an IAE if given an unexpected object type. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} throws an IAE if given an unexpected + * object type. */ @Test public void testToCorrelationIdStringThrowsIAEWithUnexpectedType() { @@ -356,9 +342,8 @@ private void doToCorrelationIDBytesTestImpl(Object idObject, byte[] expected) { } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns the given basic string unchanged when it has the "ID:" prefix (but - * no others). + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns the given basic string + * unchanged when it has the "ID:" prefix (but no others). */ @Test public void testToCorrelationIdStringWithString() { @@ -368,9 +353,8 @@ public void testToCorrelationIdStringWithString() { } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns the given basic string unchanged when it lacks the "ID:" prefix - * (and any others) + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns the given basic string + * unchanged when it lacks the "ID:" prefix (and any others) */ @Test public void testToCorrelationIdStringWithStringNoPrefix() { @@ -380,9 +364,8 @@ public void testToCorrelationIdStringWithStringNoPrefix() { } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string unchanged when it lacks the "ID:" prefix but happens to - * already begin with the {@link AMQPMessageIdHelper#AMQP_UUID_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string unchanged when it + * lacks the "ID:" prefix but happens to already begin with the {@link AMQPMessageIdHelper#AMQP_UUID_PREFIX}. */ @Test public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForUUID() { @@ -392,9 +375,8 @@ public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForUUI } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string unchanged when it lacks the "ID:" prefix but happens to - * already begin with the {@link AMQPMessageIdHelper#AMQP_ULONG_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string unchanged when it + * lacks the "ID:" prefix but happens to already begin with the {@link AMQPMessageIdHelper#AMQP_ULONG_PREFIX}. */ @Test public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForLong() { @@ -404,9 +386,8 @@ public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForLon } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string unchanged when it lacks the "ID:" prefix but happens to - * already begin with the {@link AMQPMessageIdHelper#AMQP_BINARY_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string unchanged when it + * lacks the "ID:" prefix but happens to already begin with the {@link AMQPMessageIdHelper#AMQP_BINARY_PREFIX}. */ @Test public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForBinary() { @@ -416,9 +397,8 @@ public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForBin } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string unchanged when it lacks the "ID:" prefix but happens to - * already begin with the {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string unchanged when it + * lacks the "ID:" prefix but happens to already begin with the {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX}. */ @Test public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForString() { @@ -428,9 +408,8 @@ public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForStr } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string unchanged when it lacks the "ID:" prefix but happens to - * already begin with the {@link AMQPMessageIdHelper#AMQP_NO_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string unchanged when it + * lacks the "ID:" prefix but happens to already begin with the {@link AMQPMessageIdHelper#AMQP_NO_PREFIX}. */ @Test public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForNoIdPrefix() { @@ -440,8 +419,8 @@ public void testToCorrelationIdStringWithStringBeginningWithEncodingPrefixForNoI } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string indicating an AMQP encoded UUID when given a UUID object. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string indicating an AMQP + * encoded UUID when given a UUID object. */ @Test public void testToCorrelationIdStringWithUUID() { @@ -452,9 +431,8 @@ public void testToCorrelationIdStringWithUUID() { } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string indicating an AMQP encoded ulong when given a - * UnsignedLong object. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string indicating an AMQP + * encoded ulong when given a UnsignedLong object. */ @Test public void testToCorrelationIdStringWithUnsignedLong() { @@ -465,8 +443,8 @@ public void testToCorrelationIdStringWithUnsignedLong() { } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a byte[] when given a Binary object. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a byte[] when given a Binary + * object. */ @Test public void testToCorrelationIdByteArrayWithBinary() { @@ -485,10 +463,9 @@ public void testToCorrelationIdByteArrayWithBinaryWithOffset() { } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string indicating an escaped string, when given an input string - * that already has the "ID:" prefix, but follows it with an encoding prefix, - * in this case the {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string indicating an escaped + * string, when given an input string that already has the "ID:" prefix, but follows it with an encoding prefix, in + * this case the {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX}. */ @Test public void testToCorrelationIdStringWithStringBeginningWithIdAndEncodingPrefixForString() { @@ -499,10 +476,9 @@ public void testToCorrelationIdStringWithStringBeginningWithIdAndEncodingPrefixF } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string indicating an escaped string, when given an input string - * that already has the "ID:" prefix, but follows it with an encoding prefix, - * in this case the {@link AMQPMessageIdHelper#AMQP_UUID_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string indicating an escaped + * string, when given an input string that already has the "ID:" prefix, but follows it with an encoding prefix, in + * this case the {@link AMQPMessageIdHelper#AMQP_UUID_PREFIX}. */ @Test public void testToCorrelationIdStringWithStringBeginningWithIdAndEncodingPrefixForUUID() { @@ -513,10 +489,9 @@ public void testToCorrelationIdStringWithStringBeginningWithIdAndEncodingPrefixF } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string indicating an escaped string, when given an input string - * that already has the "ID:" prefix, but follows it with an encoding prefix, - * in this case the {@link AMQPMessageIdHelper#AMQP_ULONG_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string indicating an escaped + * string, when given an input string that already has the "ID:" prefix, but follows it with an encoding prefix, in + * this case the {@link AMQPMessageIdHelper#AMQP_ULONG_PREFIX}. */ @Test public void testToCorrelationIdStringWithStringBeginningWithIdAndEncodingPrefixForUlong() { @@ -527,10 +502,9 @@ public void testToCorrelationIdStringWithStringBeginningWithIdAndEncodingPrefixF } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string indicating an escaped string, when given an input string - * that already has the "ID:" prefix, but follows it with an encoding prefix, - * in this case the {@link AMQPMessageIdHelper#AMQP_BINARY_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string indicating an escaped + * string, when given an input string that already has the "ID:" prefix, but follows it with an encoding prefix, in + * this case the {@link AMQPMessageIdHelper#AMQP_BINARY_PREFIX}. */ @Test public void testToCorrelationIdStringWithStringBeginningWithIdAndEncodingPrefixForBinary() { @@ -541,10 +515,9 @@ public void testToCorrelationIdStringWithStringBeginningWithIdAndEncodingPrefixF } /** - * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} - * returns a string indicating an escaped string, when given an input string - * that already has the "ID:" prefix, but follows it with an encoding prefix, - * in this case the {@link AMQPMessageIdHelper#AMQP_NO_PREFIX}. + * Test that {@link AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)} returns a string indicating an escaped + * string, when given an input string that already has the "ID:" prefix, but follows it with an encoding prefix, in + * this case the {@link AMQPMessageIdHelper#AMQP_NO_PREFIX}. */ @Test public void testToCorrelationIdStringWithStringBeginningWithIdAndEncodingPrefixForNoIDPrefix() { @@ -561,11 +534,10 @@ private void doToIdObjectTestImpl(String idString, Object expected) throws Activ } /** - * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns an - * UnsignedLong when given a string indicating an encoded AMQP ulong id. + * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns an UnsignedLong when given a string indicating an + * encoded AMQP ulong id. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testToIdObjectWithEncodedUlong() throws Exception { @@ -576,12 +548,10 @@ public void testToIdObjectWithEncodedUlong() throws Exception { } /** - * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns a Binary - * when given a string indicating an encoded AMQP binary id, using upper case - * hex characters + * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns a Binary when given a string indicating an + * encoded AMQP binary id, using upper case hex characters * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testToIdObjectWithEncodedBinaryUppercaseHexString() throws Exception { @@ -594,11 +564,9 @@ public void testToIdObjectWithEncodedBinaryUppercaseHexString() throws Exception } /** - * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns null when - * given null. + * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns null when given null. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testToIdObjectWithNull() throws Exception { @@ -606,12 +574,10 @@ public void testToIdObjectWithNull() throws Exception { } /** - * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns a Binary - * when given a string indicating an encoded AMQP binary id, using lower case - * hex characters. + * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns a Binary when given a string indicating an + * encoded AMQP binary id, using lower case hex characters. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testToIdObjectWithEncodedBinaryLowercaseHexString() throws Exception { @@ -624,11 +590,10 @@ public void testToIdObjectWithEncodedBinaryLowercaseHexString() throws Exception } /** - * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns a UUID - * when given a string indicating an encoded AMQP uuid id. + * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns a UUID when given a string indicating an encoded + * AMQP uuid id. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testToIdObjectWithEncodedUuid() throws Exception { @@ -639,11 +604,10 @@ public void testToIdObjectWithEncodedUuid() throws Exception { } /** - * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns a string - * unchanged when given a string without any prefix. + * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns a string unchanged when given a string without + * any prefix. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testToIdObjectWithAppSpecificString() throws Exception { @@ -653,11 +617,10 @@ public void testToIdObjectWithAppSpecificString() throws Exception { } /** - * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns a string - * unchanged when given a string with only the 'ID:' prefix. + * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns a string unchanged when given a string with only + * the 'ID:' prefix. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testToIdObjectWithSimplIdString() throws Exception { @@ -667,13 +630,11 @@ public void testToIdObjectWithSimplIdString() throws Exception { } /** - * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns the - * remainder of the provided string after removing the 'ID:' and - * {@link AMQPMessageIdHelper#AMQP_NO_PREFIX} prefix used to indicate it - * originally had no 'ID:' prefix [when arriving as a message id]. + * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns the remainder of the provided string after + * removing the 'ID:' and {@link AMQPMessageIdHelper#AMQP_NO_PREFIX} prefix used to indicate it originally had no + * 'ID:' prefix [when arriving as a message id]. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testToIdObjectWithStringContainingEncodingPrefixForNoIdPrefix() throws Exception { @@ -684,12 +645,10 @@ public void testToIdObjectWithStringContainingEncodingPrefixForNoIdPrefix() thro } /** - * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns the - * remainder of the provided string after removing the - * {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX} prefix. + * Test that {@link AMQPMessageIdHelper#toIdObject(String)} returns the remainder of the provided string after + * removing the {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX} prefix. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testToIdObjectWithStringContainingIdStringEncodingPrefix() throws Exception { @@ -700,15 +659,12 @@ public void testToIdObjectWithStringContainingIdStringEncodingPrefix() throws Ex } /** - * Test that when given a string with with the - * {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX} prefix and then - * additionally the {@link AMQPMessageIdHelper#AMQP_UUID_PREFIX}, the - * {@link AMQPMessageIdHelper#toIdObject(String)} method returns the - * remainder of the provided string after removing the + * Test that when given a string with with the {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX} prefix and then + * additionally the {@link AMQPMessageIdHelper#AMQP_UUID_PREFIX}, the {@link AMQPMessageIdHelper#toIdObject(String)} + * method returns the remainder of the provided string after removing the * {@link AMQPMessageIdHelper#AMQP_STRING_PREFIX} prefix. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testToIdObjectWithStringContainingIdStringEncodingPrefixAndThenUuidPrefix() throws Exception { @@ -719,10 +675,9 @@ public void testToIdObjectWithStringContainingIdStringEncodingPrefixAndThenUuidP } /** - * Test that {@link AMQPMessageIdHelper#toIdObject(String)} throws an - * {@link IdConversionException} when presented with an encoded binary hex - * string of uneven length (after the prefix) that thus can't be converted - * due to each byte using 2 characters + * Test that {@link AMQPMessageIdHelper#toIdObject(String)} throws an {@link IdConversionException} when presented + * with an encoded binary hex string of uneven length (after the prefix) that thus can't be converted due to each + * byte using 2 characters */ @Test public void testToIdObjectWithStringContainingBinaryHexThrowsICEWithUnevenLengthString() { @@ -739,10 +694,9 @@ public void testToIdObjectWithStringContainingBinaryHexThrowsICEWithUnevenLength } /** - * Test that {@link AMQPMessageIdHelper#toIdObject(String)} throws an - * {@link IdConversionException} when presented with an encoded binary hex - * string (after the prefix) that contains characters other than 0-9 and A-F - * and a-f, and thus can't be converted + * Test that {@link AMQPMessageIdHelper#toIdObject(String)} throws an {@link IdConversionException} when presented + * with an encoded binary hex string (after the prefix) that contains characters other than 0-9 and A-F and a-f, and + * thus can't be converted */ @Test public void testToIdObjectWithStringContainingBinaryHexThrowsICEWithNonHexCharacters() { diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/message/JMSMappingInboundTransformerTest.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/message/JMSMappingInboundTransformerTest.java index 0fb62a048bb..6b6668f7ba7 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/message/JMSMappingInboundTransformerTest.java +++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/message/JMSMappingInboundTransformerTest.java @@ -65,8 +65,7 @@ public void setUp() { * Test that a message with no body section, but with the content type set to * {@value AMQPMessageSupport#OCTET_STREAM_CONTENT_TYPE} results in a BytesMessage * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateBytesMessageFromNoBodySectionAndContentType() throws Exception { @@ -84,11 +83,10 @@ public void testCreateBytesMessageFromNoBodySectionAndContentType() throws Excep } /** - * Test that a message with no body section, and no content-type results in a BytesMessage - * when not otherwise annotated to indicate the type of JMS message it is. + * Test that a message with no body section, and no content-type results in a BytesMessage when not otherwise + * annotated to indicate the type of JMS message it is. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateBytesMessageFromNoBodySectionAndNoContentType() throws Exception { @@ -115,11 +113,10 @@ public void testCreateTextMessageFromNoBodySectionAndContentType() throws Except /** * Test that a data body containing nothing, but with the content type set to - * {@value AMQPMessageSupport#OCTET_STREAM_CONTENT_TYPE} results in a BytesMessage when not - * otherwise annotated to indicate the type of JMS message it is. + * {@value AMQPMessageSupport#OCTET_STREAM_CONTENT_TYPE} results in a BytesMessage when not otherwise annotated to + * indicate the type of JMS message it is. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateBytesMessageFromDataWithEmptyBinaryAndContentType() throws Exception { @@ -136,12 +133,10 @@ public void testCreateBytesMessageFromDataWithEmptyBinaryAndContentType() throws } /** - * Test that a message with an empty data body section, and with the content type set to an - * unknown value results in a BytesMessage when not otherwise annotated to indicate the type - * of JMS message it is. + * Test that a message with an empty data body section, and with the content type set to an unknown value results in + * a BytesMessage when not otherwise annotated to indicate the type of JMS message it is. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateBytesMessageFromDataWithUnknownContentType() throws Exception { @@ -157,11 +152,10 @@ public void testCreateBytesMessageFromDataWithUnknownContentType() throws Except } /** - * Test that a receiving a data body containing nothing and no content type being set results - * in a BytesMessage when not otherwise annotated to indicate the type of JMS message it is. + * Test that a receiving a data body containing nothing and no content type being set results in a BytesMessage when + * not otherwise annotated to indicate the type of JMS message it is. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateBytesMessageFromDataWithEmptyBinaryAndNoContentType() throws Exception { @@ -297,11 +291,10 @@ private void doCreateTextMessageFromDataWithContentTypeTestImpl(String contentTy // ----- AmqpValue transformations ----------------------------------------// /** - * Test that an amqp-value body containing a string results in a TextMessage when not - * otherwise annotated to indicate the type of JMS message it is. + * Test that an amqp-value body containing a string results in a TextMessage when not otherwise annotated to indicate + * the type of JMS message it is. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateTextMessageFromAmqpValueWithString() throws Exception { @@ -315,11 +308,10 @@ public void testCreateTextMessageFromAmqpValueWithString() throws Exception { } /** - * Test that an amqp-value body containing a null results in an TextMessage when not - * otherwise annotated to indicate the type of JMS message it is. + * Test that an amqp-value body containing a null results in an TextMessage when not otherwise annotated to indicate + * the type of JMS message it is. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateTextMessageFromAmqpValueWithNull() throws Exception { @@ -333,12 +325,11 @@ public void testCreateTextMessageFromAmqpValueWithNull() throws Exception { } /** - * Test that a message with an AmqpValue section containing a Binary, but with the content - * type set to {@value AMQPMessageSupport#SERIALIZED_JAVA_OBJECT_CONTENT_TYPE} results in an - * ObjectMessage when not otherwise annotated to indicate the type of JMS message it is. + * Test that a message with an AmqpValue section containing a Binary, but with the content type set to + * {@value AMQPMessageSupport#SERIALIZED_JAVA_OBJECT_CONTENT_TYPE} results in an ObjectMessage when not otherwise + * annotated to indicate the type of JMS message it is. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateObjectMessageFromAmqpValueWithBinaryAndContentType() throws Exception { @@ -353,11 +344,10 @@ public void testCreateObjectMessageFromAmqpValueWithBinaryAndContentType() throw } /** - * Test that an amqp-value body containing a map results in an MapMessage when not otherwise - * annotated to indicate the type of JMS message it is. + * Test that an amqp-value body containing a map results in an MapMessage when not otherwise annotated to indicate + * the type of JMS message it is. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateAmqpMapMessageFromAmqpValueWithMap() throws Exception { @@ -372,11 +362,10 @@ public void testCreateAmqpMapMessageFromAmqpValueWithMap() throws Exception { } /** - * Test that an amqp-value body containing a list results in an StreamMessage when not - * otherwise annotated to indicate the type of JMS message it is. + * Test that an amqp-value body containing a list results in an StreamMessage when not otherwise annotated to + * indicate the type of JMS message it is. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateAmqpStreamMessageFromAmqpValueWithList() throws Exception { @@ -391,11 +380,10 @@ public void testCreateAmqpStreamMessageFromAmqpValueWithList() throws Exception } /** - * Test that an amqp-sequence body containing a list results in an StreamMessage when not - * otherwise annotated to indicate the type of JMS message it is. + * Test that an amqp-sequence body containing a list results in an StreamMessage when not otherwise annotated to + * indicate the type of JMS message it is. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateAmqpStreamMessageFromAmqpSequence() throws Exception { @@ -410,11 +398,10 @@ public void testCreateAmqpStreamMessageFromAmqpSequence() throws Exception { } /** - * Test that an amqp-value body containing a binary value results in BytesMessage when not - * otherwise annotated to indicate the type of JMS message it is. + * Test that an amqp-value body containing a binary value results in BytesMessage when not otherwise annotated to + * indicate the type of JMS message it is. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateAmqpBytesMessageFromAmqpValueWithBinary() throws Exception { @@ -429,12 +416,10 @@ public void testCreateAmqpBytesMessageFromAmqpValueWithBinary() throws Exception } /** - * Test that an amqp-value body containing a value which can't be categorized results in an - * exception from the transformer and then try the transformer's own fallback transformer to - * result in an BytesMessage. + * Test that an amqp-value body containing a value which can't be categorized results in an exception from the + * transformer and then try the transformer's own fallback transformer to result in an BytesMessage. * - * @throws Exception - * if an error occurs during the test. + * @throws Exception if an error occurs during the test. */ @Test public void testCreateBytesMessageFromAmqpValueWithUncategorisedContent() throws Exception { diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/SCRAMTest.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/SCRAMTest.java index b278ded6402..0cbf8ee322e 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/SCRAMTest.java +++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/sasl/SCRAMTest.java @@ -53,9 +53,6 @@ @ExtendWith(ParameterizedTestExtension.class) public class SCRAMTest { - /** - * - */ private final SCRAM mechanism; private static final byte[] SALT = new byte[32]; private static final String SNONCE = "server"; diff --git a/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/client/HornetQClientProtocolManagerFactory.java b/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/client/HornetQClientProtocolManagerFactory.java index fe4e38e12f8..90504701e95 100644 --- a/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/client/HornetQClientProtocolManagerFactory.java +++ b/artemis-protocols/artemis-hqclient-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/hornetq/client/HornetQClientProtocolManagerFactory.java @@ -43,8 +43,8 @@ public ClientProtocolManagerFactory setLocator(ServerLocator locator) { } /** - * Adapt the transport configuration by replacing the factoryClassName corresponding to an HornetQ's NettyConnectorFactory - * by the Artemis-based implementation. + * Adapt the transport configuration by replacing the factoryClassName corresponding to an HornetQ's + * NettyConnectorFactory by the Artemis-based implementation. */ @Override public TransportConfiguration adaptTransportConfiguration(TransportConfiguration tc) { diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnection.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnection.java index 06f31122ef0..09d901cb0ac 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnection.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnection.java @@ -111,11 +111,6 @@ public boolean getConnected() { return connected; } - /** - * Returns the name of the protocol for this Remoting Connection - * - * @return - */ @Override public String getProtocolName() { return MQTTProtocolManagerFactory.MQTT_PROTOCOL_NAME + (protocolVersion != null ? protocolVersion : ""); diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java index cedd8153c54..3890ab92fff 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java @@ -79,9 +79,11 @@ synchronized void connect(MqttConnectMessage connect, String validatedUser, Stri session.setServerSession(serverSession, internalServerSession); if (cleanStart) { - /* [MQTT-3.1.2-6] If CleanSession is set to 1, the Client and Server MUST discard any previous Session and + /* + * [MQTT-3.1.2-6] If CleanSession is set to 1, the Client and Server MUST discard any previous Session and * start a new one. This Session lasts as long as the Network Connection. State data associated with this Session - * MUST NOT be reused in any subsequent Session */ + * MUST NOT be reused in any subsequent Session + */ session.clean(true); session.setClean(true); } @@ -187,7 +189,7 @@ synchronized void disconnect(boolean failure) { } finally { if (session.getState() != null) { String clientId = session.getState().getClientId(); - /** + /* * ensure that the connection for the client ID matches *this* connection otherwise we could remove the * entry for the client who "stole" this client ID via [MQTT-3.1.4-2] */ 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 3c5c139a0d5..484537578d5 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 @@ -239,9 +239,7 @@ void handleConnect(MqttConnectMessage connect) throws Exception { return; } - /* - * Perform authentication *before* attempting redirection because redirection may be based on the user's role. - */ + // Perform authentication *before* attempting redirection because redirection may be based on the user's role. String password = connect.payload().passwordInBytes() == null ? null : new String(connect.payload().passwordInBytes(), CharsetUtil.UTF_8); String username = connect.payload().userName(); Pair validationData = null; @@ -457,7 +455,8 @@ private boolean checkClientVersion() { return true; } - /* The MQTT specification states: + /* + * The MQTT specification states: * * [MQTT-3.1.4-2] If the client ID represents a client already connected to the server then the server MUST * disconnect the existing client 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 7e48b7faf19..bae4cd77a5b 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 @@ -252,9 +252,11 @@ public void addChannelHandlers(ChannelPipeline pipeline) { /** * Relevant portions of the specs we support: - * MQTT 3.1 - https://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html#connect - * MQTT 3.1.1 - http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718028 - * MQTT 5 - https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901033 + *

              + *
            • MQTT 3.1 - https://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html#connect + *
            • MQTT 3.1.1 - http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718028 + *
            • MQTT 5 - https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901033 + *
            */ @Override public boolean isProtocol(byte[] array) { 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 2fcce4117ef..a0e12a0492b 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 @@ -178,7 +178,6 @@ protected void sendMessage(ICoreMessage message, ServerConsumer consumer, int de * Sends a message either on behalf of the client or on behalf of the broker (Will Messages) * * @param internal if true means on behalf of the broker (skips authorisation) and does not return ack. - * @throws Exception */ void sendToQueue(MqttPublishMessage message, boolean internal) throws Exception { synchronized (lock) { @@ -340,8 +339,6 @@ void handlePubRec(int messageId) throws Exception { /** * Once we get an acknowledgement for a QoS 1 or 2 message we allow messages to flow - * - * @param consumerId */ private void releaseFlowControl(Long consumerId) { ServerConsumer consumer = session.getServerSession().locateConsumer(consumerId); 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 3aa9162883c..1535c7792ab 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 @@ -101,18 +101,19 @@ public MQTTSessionState(String clientId) { /** * This constructor deserializes session data from a message. The format is as follows. - * - * - byte: version - * - int: subscription count - * + *
              + *
            • byte: version + *
            • int: subscription count + *
            * There may be 0 or more subscriptions. The subscription format is as follows. - * - * - String: topic name - * - int: QoS - * - boolean: no-local - * - boolean: retain as published - * - int: retain handling - * - int (nullable): subscription identifier + *
              + *
            • String: topic name + *
            • int: QoS + *
            • boolean: no-local + *
            • boolean: retain as published + *
            • int: retain handling + *
            • int (nullable): subscription identifier + *
            * * @param message the message holding the MQTT session data */ diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTStateManager.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTStateManager.java index 4ddfd77709d..d27d992d45b 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTStateManager.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTStateManager.java @@ -1,20 +1,21 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.core.protocol.mqtt; import java.lang.invoke.MethodHandles; @@ -137,7 +138,7 @@ public void scanSessions() { } public MQTTSessionState getSessionState(String clientId) throws Exception { - /* [MQTT-3.1.2-4] Attach an existing session if one exists otherwise create a new one. */ + // [MQTT-3.1.2-4] Attach an existing session if one exists otherwise create a new one. if (sessionStates.containsKey(clientId)) { return sessionStates.get(clientId); } else { @@ -241,10 +242,8 @@ public void removeConnectedClient(String clientId) { } /** - * @param clientId - * @param connection - * @return the {@code MQTTConnection} that the added connection replaced or null if there was no previous entry for - * the {@code clientId} + * {@return the {@code MQTTConnection} that the added connection replaced or null if there was no previous entry for + * the {@code clientId}} */ public MQTTConnection addConnectedClient(String clientId, MQTTConnection connection) { return connectedClients.put(clientId, connection); @@ -254,7 +253,9 @@ public MQTTConnection getConnectedClient(String clientId) { return connectedClients.get(clientId); } - /** For DEBUG only */ + /** + * For DEBUG only + */ public Map getConnectedClients() { return connectedClients; } diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSubscriptionManager.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSubscriptionManager.java index 3d3527a472c..69c5424e3a4 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSubscriptionManager.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSubscriptionManager.java @@ -51,9 +51,7 @@ public class MQTTSubscriptionManager { private final ConcurrentMap consumers; - /* - * We filter out certain messages (e.g. management messages, notifications) - */ + // We filter out certain messages (e.g. management messages, notifications) private final SimpleString messageFilter; /* @@ -289,9 +287,7 @@ short[] removeSubscriptions(List topics, boolean enforceSecurity) throws /** * As per MQTT Spec. Subscribes this client to a number of MQTT topics. * - * @param subscriptions - * @return An array of integers representing the list of accepted QoS for each topic. - * @throws Exception + * @return An array of integers representing the list of accepted QoS for each topic */ int[] addSubscriptions(List subscriptions, Integer subscriptionIdentifier) throws Exception { MQTTSessionState state = session.getState(); 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 b044d198d6f..eb6dcafa170 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 @@ -146,8 +146,8 @@ public class MQTTUtil { * {@code topicFilter} may be either for a shared subscription in the format {@code $share//} * or a normal MQTT topic filter (e.g. {@code a/b/#}, {@code a/+/c}, {@code a/b/c}, etc.). * - * @param topicFilter the MQTT topic filter - * @param clientId the MQTT client ID, used for normal (i.e. non-shared) subscriptions + * @param topicFilter the MQTT topic filter + * @param clientId the MQTT client ID, used for normal (i.e. non-shared) subscriptions * @param wildcardConfiguration the {@code WildcardConfiguration} governing the core broker * @return the name of the core subscription queue based on the input */ @@ -169,7 +169,7 @@ public static String getCoreQueueFromMqttTopic(String topicFilter, String client * {@code topicFilter} must be normal (i.e. non-shared). It should not be in the format * {@code $share//}. * - * @param topicFilter the MQTT topic filter + * @param topicFilter the MQTT topic filter * @param wildcardConfiguration the {@code WildcardConfiguration} governing the core broker * @return the name of the core addres based on the input */ @@ -185,19 +185,20 @@ public static String getCoreAddressFromMqttTopic(String topicFilter, WildcardCon * also prefixes the return with * {@link org.apache.activemq.artemis.core.protocol.mqtt.MQTTUtil#MQTT_RETAIN_ADDRESS_PREFIX} * - * @param topicFilter the MQTT topic filter + * @param topicFilter the MQTT topic filter * @param wildcardConfiguration the {@code WildcardConfiguration} governing the core broker * @return the name of the core address based on the input, stripping - * {@link org.apache.activemq.artemis.core.protocol.mqtt.MQTTUtil#MQTT_RETAIN_ADDRESS_PREFIX} if it exists + * {@link org.apache.activemq.artemis.core.protocol.mqtt.MQTTUtil#MQTT_RETAIN_ADDRESS_PREFIX} if it exists */ public static String getCoreRetainAddressFromMqttTopic(String topicFilter, WildcardConfiguration wildcardConfiguration) { return MQTT_RETAIN_ADDRESS_PREFIX + getCoreAddressFromMqttTopic(topicFilter, wildcardConfiguration); } /** + * Convert a Core address name into a proper MQTT topic name * - * @param address the core address - * @param wildcardConfiguration the {@code WildcardConfiguration} governing the core broker + * @param address the core address; can't be {@code null} + * @param wildcardConfiguration the {@code WildcardConfiguration} governing the core broker; can't be {@code null} * @return the name of the MQTT topic based on the input */ public static String getMqttTopicFromCoreAddress(String address, WildcardConfiguration wildcardConfiguration) { @@ -462,7 +463,7 @@ public static int calculateRemainingLength(String topicName, MqttProperties prop return size; } - /* + /** * https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901027 */ private static int calculatePublishPropertiesSize(MqttProperties properties) { @@ -520,7 +521,7 @@ private static int calculatePublishPropertiesSize(MqttProperties properties) { } } - /* + /** * https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Remaining_Length: * "The packet size is the total number of bytes in an MQTT Control Packet, this is equal to the length of the Fixed * Header plus the Remaining Length." @@ -532,9 +533,7 @@ public static int calculateMessageSize(MqttPublishMessage message) { return 1 + calculateVariableByteIntegerSize(message.fixedHeader().remainingLength()) + message.fixedHeader().remainingLength(); } - /* - * https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901011 - */ + // https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901011 private static int calculateVariableByteIntegerSize(int vbi) { int count = 0; do { @@ -571,7 +570,7 @@ public static T getProperty(Class type, MqttProperties properties, MqttPr * * @param topicFilter String in the format {@code $share//} * @return {@code Pair} with {@code shareName} and {@code topicFilter} respectively or {@code null} - * and {@code topicFilter} if not in the shared-subscription format. + * and {@code topicFilter} if not in the shared-subscription format. */ public static Pair decomposeSharedSubscriptionTopicFilter(String topicFilter) { if (isSharedSubscription(topicFilter)) { @@ -585,8 +584,9 @@ public static Pair decomposeSharedSubscriptionTopicFilter(String } /** + * Test whether an MQTT topic filter is for a shared subscription. * - * @param topicFilter the topic filter + * @param topicFilter the MQTT topic filter * @return {@code true} if the input starts with {@code $share/}, {@code false} otherwise */ public static boolean isSharedSubscription(String topicFilter) { diff --git a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtilTest.java b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtilTest.java index 77c4396376b..d461ca0e06c 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtilTest.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTUtilTest.java @@ -1,20 +1,21 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.core.protocol.mqtt; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/StateSerDeTest.java b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/StateSerDeTest.java index da56cab3d79..e1721a8e544 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/StateSerDeTest.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/StateSerDeTest.java @@ -1,20 +1,21 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.core.protocol.mqtt; import static org.junit.jupiter.api.Assertions.assertEquals; 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 94d90869831..5446dedfe35 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 @@ -174,18 +174,16 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se private volatile boolean noLocal; /** - * Openwire doesn't sen transactions associated with any sessions. - * It will however send beingTX / endTX as it would be doing it with XA Transactions. - * But always without any association with Sessions. - * This collection will hold nonXA transactions. Hopefully while they are in transit only. + * Openwire doesn't sen transactions associated with any sessions. It will however send beingTX / endTX as it would + * be doing it with XA Transactions. But always without any association with Sessions. This collection will hold + * nonXA transactions. Hopefully while they are in transit only. */ private final Map txMap = new ConcurrentHashMap<>(); private final ActiveMQServer server; /** - * This is to be used with connection operations that don't have a session. - * Such as TM operations. + * This is to be used with connection operations that don't have a session. Such as TM operations. */ private ServerSession internalSession; @@ -403,7 +401,9 @@ private void act(Command command) { } } - /** It will send the response through the operation context, as soon as everything is confirmed on disk */ + /** + * It will send the response through the operation context, as soon as everything is confirmed on disk + */ private void sendAsyncResponse(final int commandId, final Response response) throws Exception { if (response != null) { operationContext.executeOnCompletion(new IOCallback() { @@ -1402,8 +1402,7 @@ public void beforeRollback(Transaction tx) throws Exception { } /** - * Openwire will redeliver rolled back references. - * We need to return those here. + * Openwire will redeliver rolled back references. We need to return those here. */ private void returnReferences(Transaction tx, AMQSession session) throws Exception { if (session == null || session.isClosed()) { diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireFrameParser.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireFrameParser.java index 7314bc573f1..82d79f9a7e0 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireFrameParser.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireFrameParser.java @@ -28,7 +28,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** This MessageDecoder is based on LengthFieldBasedFrameDecoder. +/** + * This MessageDecoder is based on LengthFieldBasedFrameDecoder. * When OpenWire clients send a Large Message (large in the context of size only as openwire does not support message chunk streaming). * In that context the server will transfer the huge frame to a Heap Buffer, instead of keeping a really large native buffer. * 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 46d843297cc..7b4375837ed 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 @@ -18,6 +18,7 @@ import javax.jms.InvalidClientIDException; import java.io.IOException; +import java.lang.invoke.MethodHandles; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -80,7 +81,6 @@ 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; @@ -146,9 +146,10 @@ public class OpenWireProtocolManager extends AbstractProtocolManager * To add an interceptor to ActiveMQ Artemis server, you have to modify the server configuration file - * {@literal broker.xml}.
            + * {@literal broker.xml}. */ public interface StompFrameInterceptor extends BaseInterceptor { 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 bea06cd4bfd..83c9710b3ee 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 @@ -53,9 +53,6 @@ import static org.apache.activemq.artemis.core.protocol.stomp.ActiveMQStompProtocolMessageBundle.BUNDLE; -/** - * StompProtocolManager - */ public class StompProtocolManager extends AbstractProtocolManager { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java index b338456b9ed..24ffb78de86 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/VersionedStompFrameHandler.java @@ -406,11 +406,8 @@ private void populateFrameBodyFromLargeMessage(StompFrame frame, ICoreMessage se } /** - * this method is called when a newer version of handler is created. It should - * take over the state of the decoder of the existingHandler so that - * the decoding can be continued. For V10 handler it's never called. - * - * @param existingHandler + * this method is called when a newer version of handler is created. It should take over the state of the decoder of + * the existingHandler so that the decoding can be continued. For V10 handler it's never called. */ public void initDecoder(VersionedStompFrameHandler existingHandler) { throw BUNDLE.invalidCall(); 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 868ccf9de6c..a75573feda5 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 @@ -300,7 +300,8 @@ private HeartBeater(ScheduledExecutorService scheduledExecutorService, String ttlMinStr = (String) connection.getAcceptorUsed().getConfiguration().get(TransportConstants.CONNECTION_TTL_MIN); long ttlMin = ttlMinStr == null ? 1000 : Long.parseLong(ttlMinStr); - /* The connection's TTL should be one of the following: + /* + * The connection's TTL should be one of the following: * 1) clientPing * heartBeatToTtlModifier * 2) ttlMin * 3) ttlMax @@ -502,7 +503,6 @@ protected boolean parseCommand() throws ActiveMQStompException { break; } - /**** added by meddy, 27 april 2011, handle header parser for reply to websocket protocol ****/ case E: { if (!tryIncrement(offset + COMMAND_ERROR_LENGTH + eolLen)) { return false; @@ -523,7 +523,6 @@ protected boolean parseCommand() throws ActiveMQStompException { break; } - /**** end ****/ case S: { if (workingBuffer[offset + 1] == E) { if (!tryIncrement(offset + COMMAND_SEND_LENGTH + eolLen)) { diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v12/StompFrameHandlerV12.java b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v12/StompFrameHandlerV12.java index 9c3d43ad417..9bd9a987c83 100644 --- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v12/StompFrameHandlerV12.java +++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v12/StompFrameHandlerV12.java @@ -64,8 +64,7 @@ public StompFrame createMessageFrame(ICoreMessage serverMessage, } /** - * Version 1.2's ACK frame only requires 'id' header - * here we use id = messageID + * Version 1.2's ACK frame only requires 'id' header here we use id = messageID */ @Override public StompFrame onAck(StompFrame request) { diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/jms/referenceable/ConnectionFactoryObjectFactory.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/jms/referenceable/ConnectionFactoryObjectFactory.java index 4c7a68afa7f..c9263d92e23 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/jms/referenceable/ConnectionFactoryObjectFactory.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/jms/referenceable/ConnectionFactoryObjectFactory.java @@ -18,7 +18,7 @@ /** * Done for back compatibility with the package/class move. - * + *

            * Should be removed on next major version change. */ public class ConnectionFactoryObjectFactory extends org.apache.activemq.artemis.ra.referenceable.ActiveMQRAConnectionFactoryObjectFactory { diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/jms/referenceable/SerializableObjectRefAddr.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/jms/referenceable/SerializableObjectRefAddr.java index 92aaf9e9b93..870fa163b76 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/jms/referenceable/SerializableObjectRefAddr.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/jms/referenceable/SerializableObjectRefAddr.java @@ -20,7 +20,7 @@ /** * Done for back compatibility with the package/class move. - * + *

            * Should be removed on next major version change. */ public class SerializableObjectRefAddr extends org.apache.activemq.artemis.ra.referenceable.SerializableObjectRefAddr { 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 36c721ca398..696171f45f9 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 @@ -25,7 +25,7 @@ import java.lang.invoke.MethodHandles; /** - * A wrapper for a message + * A wrapper for a {@link BytesMessage} */ public class ActiveMQRABytesMessage extends ActiveMQRAMessage implements BytesMessage { @@ -44,10 +44,7 @@ public ActiveMQRABytesMessage(final BytesMessage message, final ActiveMQRASessio } /** - * Get body length - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public long getBodyLength() throws JMSException { @@ -57,10 +54,7 @@ public long getBodyLength() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public boolean readBoolean() throws JMSException { @@ -70,10 +64,7 @@ public boolean readBoolean() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public byte readByte() throws JMSException { @@ -83,12 +74,7 @@ public byte readByte() throws JMSException { } /** - * Read - * - * @param value The value - * @param length The length - * @return The result - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int readBytes(final byte[] value, final int length) throws JMSException { @@ -100,11 +86,7 @@ public int readBytes(final byte[] value, final int length) throws JMSException { } /** - * Read - * - * @param value The value - * @return The result - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int readBytes(final byte[] value) throws JMSException { @@ -116,10 +98,7 @@ public int readBytes(final byte[] value) throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public char readChar() throws JMSException { @@ -129,10 +108,7 @@ public char readChar() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public double readDouble() throws JMSException { @@ -142,10 +118,7 @@ public double readDouble() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public float readFloat() throws JMSException { @@ -155,10 +128,7 @@ public float readFloat() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int readInt() throws JMSException { @@ -168,10 +138,7 @@ public int readInt() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public long readLong() throws JMSException { @@ -181,10 +148,7 @@ public long readLong() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public short readShort() throws JMSException { @@ -194,10 +158,7 @@ public short readShort() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int readUnsignedByte() throws JMSException { @@ -207,10 +168,7 @@ public int readUnsignedByte() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int readUnsignedShort() throws JMSException { @@ -220,10 +178,7 @@ public int readUnsignedShort() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public String readUTF() throws JMSException { @@ -233,9 +188,7 @@ public String readUTF() throws JMSException { } /** - * Reset - * - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void reset() throws JMSException { @@ -245,10 +198,7 @@ public void reset() throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeBoolean(final boolean value) throws JMSException { @@ -260,10 +210,7 @@ public void writeBoolean(final boolean value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeByte(final byte value) throws JMSException { @@ -275,12 +222,7 @@ public void writeByte(final byte value) throws JMSException { } /** - * Write - * - * @param value The value - * @param offset The offset - * @param length The length - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeBytes(final byte[] value, final int offset, final int length) throws JMSException { @@ -292,10 +234,7 @@ public void writeBytes(final byte[] value, final int offset, final int length) t } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeBytes(final byte[] value) throws JMSException { @@ -307,10 +246,7 @@ public void writeBytes(final byte[] value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeChar(final char value) throws JMSException { @@ -322,10 +258,7 @@ public void writeChar(final char value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeDouble(final double value) throws JMSException { @@ -337,10 +270,7 @@ public void writeDouble(final double value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeFloat(final float value) throws JMSException { @@ -352,10 +282,7 @@ public void writeFloat(final float value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeInt(final int value) throws JMSException { @@ -367,10 +294,7 @@ public void writeInt(final int value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeLong(final long value) throws JMSException { @@ -382,10 +306,7 @@ public void writeLong(final long value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeObject(final Object value) throws JMSException { @@ -395,10 +316,7 @@ public void writeObject(final Object value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeShort(final short value) throws JMSException { @@ -410,10 +328,7 @@ public void writeShort(final short value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeUTF(final String value) throws JMSException { 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 9c7f91a9352..e831d28acf8 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 @@ -41,39 +41,18 @@ import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; -/** - * The connection factory - */ public class ActiveMQRAConnectionFactoryImpl implements ActiveMQRAConnectionFactory { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Serial version UID - */ static final long serialVersionUID = 7981708919479859360L; - /** - * The managed connection factory - */ private final ActiveMQRAManagedConnectionFactory mcf; - /** - * The connection manager - */ private ConnectionManager cm; - /** - * Naming reference - */ private Reference reference; - /** - * Constructor - * - * @param mcf The managed connection factory - * @param cm The connection manager - */ public ActiveMQRAConnectionFactoryImpl(final ActiveMQRAManagedConnectionFactory mcf, final ConnectionManager cm) { logger.trace("constructor({}, {})", mcf, cm); @@ -91,9 +70,7 @@ public ActiveMQRAConnectionFactoryImpl(final ActiveMQRAManagedConnectionFactory } /** - * Set the reference - * - * @param reference The reference + * {@inheritDoc} */ @Override public void setReference(final Reference reference) { @@ -103,9 +80,7 @@ public void setReference(final Reference reference) { } /** - * Get the reference - * - * @return The reference + * {@inheritDoc} */ @Override public Reference getReference() { @@ -124,10 +99,7 @@ public Reference getReference() { } /** - * Create a queue connection - * - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public QueueConnection createQueueConnection() throws JMSException { @@ -141,12 +113,7 @@ public QueueConnection createQueueConnection() throws JMSException { } /** - * Create a queue connection - * - * @param userName The user name - * @param password The password - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public QueueConnection createQueueConnection(final String userName, final String password) throws JMSException { @@ -164,10 +131,7 @@ public QueueConnection createQueueConnection(final String userName, final String } /** - * Create a topic connection - * - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public TopicConnection createTopicConnection() throws JMSException { @@ -181,12 +145,7 @@ public TopicConnection createTopicConnection() throws JMSException { } /** - * Create a topic connection - * - * @param userName The user name - * @param password The password - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public TopicConnection createTopicConnection(final String userName, final String password) throws JMSException { @@ -203,10 +162,7 @@ public TopicConnection createTopicConnection(final String userName, final String } /** - * Create a connection - * - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public Connection createConnection() throws JMSException { @@ -220,12 +176,7 @@ public Connection createConnection() throws JMSException { } /** - * Create a connection - * - * @param userName The user name - * @param password The password - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public Connection createConnection(final String userName, final String password) throws JMSException { @@ -243,10 +194,7 @@ public Connection createConnection(final String userName, final String password) } /** - * Create a XA queue connection - * - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public XAQueueConnection createXAQueueConnection() throws JMSException { @@ -260,12 +208,7 @@ public XAQueueConnection createXAQueueConnection() throws JMSException { } /** - * Create a XA queue connection - * - * @param userName The user name - * @param password The password - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public XAQueueConnection createXAQueueConnection(final String userName, final String password) throws JMSException { @@ -282,10 +225,7 @@ public XAQueueConnection createXAQueueConnection(final String userName, final St } /** - * Create a XA topic connection - * - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public XATopicConnection createXATopicConnection() throws JMSException { @@ -299,12 +239,7 @@ public XATopicConnection createXATopicConnection() throws JMSException { } /** - * Create a XA topic connection - * - * @param userName The user name - * @param password The password - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public XATopicConnection createXATopicConnection(final String userName, final String password) throws JMSException { @@ -321,10 +256,7 @@ public XATopicConnection createXATopicConnection(final String userName, final St } /** - * Create a XA connection - * - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public XAConnection createXAConnection() throws JMSException { @@ -338,12 +270,7 @@ public XAConnection createXAConnection() throws JMSException { } /** - * Create a XA connection - * - * @param userName The user name - * @param password The password - * @return The connection - * @throws JMSException Thrown if the operation fails + * {@inheritDoc} */ @Override public XAConnection createXAConnection(final String userName, final String password) throws JMSException { @@ -359,16 +286,25 @@ public XAConnection createXAConnection(final String userName, final String passw return s; } + /** + * {@inheritDoc} + */ @Override public JMSContext createContext() { return createContext(null, null); } + /** + * {@inheritDoc} + */ @Override public JMSContext createContext(String userName, String password) { return createContext(userName, password, Session.AUTO_ACKNOWLEDGE); } + /** + * {@inheritDoc} + */ @Override public JMSContext createContext(String userName, String password, int sessionMode) { @SuppressWarnings("resource") @@ -389,16 +325,25 @@ public JMSContext createContext(String userName, String password, int sessionMod return conn.createContext(sessionMode); } + /** + * {@inheritDoc} + */ @Override public JMSContext createContext(int sessionMode) { return createContext(null, null, sessionMode); } + /** + * {@inheritDoc} + */ @Override public XAJMSContext createXAContext() { return createXAContext(null, null); } + /** + * {@inheritDoc} + */ @Override public XAJMSContext createXAContext(String userName, String password) { ActiveMQRASessionFactoryImpl conn = new ActiveMQRASessionFactoryImpl(mcf, cm, getResourceAdapter().getTSR(), ActiveMQRAConnectionFactory.XA_CONNECTION); @@ -423,11 +368,17 @@ private void validateUser(ActiveMQRASessionFactoryImpl s) throws JMSException { session.close(); } + /** + * {@inheritDoc} + */ @Override public ActiveMQConnectionFactory getDefaultFactory() throws ResourceException { return ((ActiveMQResourceAdapter) mcf.getResourceAdapter()).getDefaultActiveMQConnectionFactory(); } + /** + * {@inheritDoc} + */ @Override public ActiveMQResourceAdapter getResourceAdapter() { return (ActiveMQResourceAdapter) mcf.getResourceAdapter(); 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 c5dbcc2ea9b..456cd42a550 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 @@ -33,16 +33,8 @@ public class ActiveMQRAConnectionManager implements ConnectionManager { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - - /** - * Serial version UID - */ static final long serialVersionUID = 4409118162975011014L; - /** - * Constructor - */ public ActiveMQRAConnectionManager() { logger.trace("constructor()"); } 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 aca42ab5fb6..c3d26f4d93c 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 @@ -28,7 +28,9 @@ import java.lang.invoke.MethodHandles; /** - * This class implements javax.jms.ConnectionMetaData + * This class implements {@link javax.jms.ConnectionMetaData} + * + * {@inheritDoc} */ public class ActiveMQRAConnectionMetaData implements ConnectionMetaData { @@ -52,17 +54,12 @@ public class ActiveMQRAConnectionMetaData implements ConnectionMetaData { JMS_MINOR_VERSION = Integer.parseInt(versionProps.getProperty("activemq.version.implementation.minorVersion", "0")); } - /** - * Constructor - */ public ActiveMQRAConnectionMetaData() { logger.trace("constructor()"); } /** - * Get the JMS version - * - * @return The version + * {@inheritDoc} */ @Override public String getJMSVersion() { @@ -71,9 +68,7 @@ public String getJMSVersion() { } /** - * Get the JMS major version - * - * @return The major version + * {@inheritDoc} */ @Override public int getJMSMajorVersion() { @@ -82,9 +77,7 @@ public int getJMSMajorVersion() { } /** - * Get the JMS minor version - * - * @return The minor version + * {@inheritDoc} */ @Override public int getJMSMinorVersion() { @@ -93,9 +86,7 @@ public int getJMSMinorVersion() { } /** - * Get the JMS provider name - * - * @return The name + * {@inheritDoc} */ @Override public String getJMSProviderName() { @@ -105,9 +96,7 @@ public String getJMSProviderName() { } /** - * Get the provider version - * - * @return The version + * {@inheritDoc} */ @Override public String getProviderVersion() { @@ -117,9 +106,7 @@ public String getProviderVersion() { } /** - * Get the provider major version - * - * @return The version + * {@inheritDoc} */ @Override public int getProviderMajorVersion() { @@ -129,9 +116,7 @@ public int getProviderMajorVersion() { } /** - * Get the provider minor version - * - * @return The version + * {@inheritDoc} */ @Override public int getProviderMinorVersion() { @@ -141,9 +126,7 @@ public int getProviderMinorVersion() { } /** - * Get the JMS XPropertyNames - * - * @return The names + * {@inheritDoc} */ @Override public Enumeration getJMSXPropertyNames() { 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 d879d0d4833..96769bdbd4f 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 @@ -24,48 +24,24 @@ import java.lang.invoke.MethodHandles; /** - * Connection request information + * {@inheritDoc} */ public class ActiveMQRAConnectionRequestInfo implements ConnectionRequestInfo { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * The user name - */ private String userName; - /** - * The password - */ private String password; - /** - * The client id - */ private String clientID; - /** - * The type - */ private final int type; - /** - * Use transactions - */ private final boolean transacted; - /** - * The acknowledge mode - */ private final int acknowledgeMode; - /** - * Constructor - * - * @param prop The resource adapter properties - * @param type The connection type - */ public ActiveMQRAConnectionRequestInfo(final ActiveMQRAProperties prop, final int type) { logger.trace("constructor({})", prop); @@ -77,13 +53,6 @@ public ActiveMQRAConnectionRequestInfo(final ActiveMQRAProperties prop, final in acknowledgeMode = Session.AUTO_ACKNOWLEDGE; } - /** - * Constructor - * - * @param transacted Use transactions - * @param acknowledgeMode The acknowledge mode - * @param type The connection type - */ public ActiveMQRAConnectionRequestInfo(final boolean transacted, final int acknowledgeMode, final int type) { if (logger.isTraceEnabled()) { logger.trace("constructor({}, {}, {})", transacted, acknowledgeMode, type); @@ -113,88 +82,48 @@ public void setDefaults(final ActiveMQRAProperties prop) { } } - /** - * Get the user name - * - * @return The value - */ public String getUserName() { logger.trace("getUserName()"); return userName; } - /** - * Set the user name - * - * @param userName The value - */ public void setUserName(final String userName) { logger.trace("setUserName({})", userName); this.userName = userName; } - /** - * Get the password - * - * @return The value - */ public String getPassword() { logger.trace("getPassword()"); return password; } - /** - * Set the password - * - * @param password The value - */ public void setPassword(final String password) { logger.trace("setPassword(****)"); this.password = password; } - /** - * Get the client id - * - * @return The value - */ public String getClientID() { logger.trace("getClientID()"); return clientID; } - /** - * Set the client id - * - * @param clientID The value - */ public void setClientID(final String clientID) { logger.trace("setClientID({})", clientID); this.clientID = clientID; } - /** - * Get the connection type - * - * @return The type - */ public int getType() { logger.trace("getType()"); return type; } - /** - * Use transactions - * - * @return True if transacted; otherwise false - */ public boolean isTransacted() { if (logger.isTraceEnabled()) { logger.trace("isTransacted() {}", transacted); @@ -203,23 +132,12 @@ public boolean isTransacted() { return transacted; } - /** - * Get the acknowledge mode - * - * @return The mode - */ public int getAcknowledgeMode() { logger.trace("getAcknowledgeMode()"); return acknowledgeMode; } - /** - * Indicates whether some other object is "equal to" this one. - * - * @param obj Object with which to compare - * @return True if this object is the same as the obj argument; false otherwise. - */ @Override public boolean equals(final Object obj) { logger.trace("equals({})", obj); @@ -239,11 +157,6 @@ public boolean equals(final Object obj) { } } - /** - * Return the hash code for the object - * - * @return The hash code - */ @Override public int hashCode() { logger.trace("hashCode()"); 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 4d424fc6205..0aad45108cd 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 @@ -37,66 +37,34 @@ public class ActiveMQRACredential implements Serializable { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Serial version UID - */ static final long serialVersionUID = 210476602237497193L; - /** - * The user name - */ private String userName; - /** - * The password - */ private String password; - /** - * Private constructor - */ private ActiveMQRACredential() { logger.trace("constructor()"); } - /** - * Get the user name - * - * @return The value - */ public String getUserName() { logger.trace("getUserName()"); return userName; } - /** - * Set the user name - * - * @param userName The value - */ private void setUserName(final String userName) { logger.trace("setUserName({})", userName); this.userName = userName; } - /** - * Get the password - * - * @return The value - */ public String getPassword() { logger.trace("getPassword()"); return password; } - /** - * Set the password - * - * @param password The value - */ private void setPassword(final String password) { logger.trace("setPassword(****)"); @@ -139,11 +107,6 @@ public static ActiveMQRACredential getCredential(final ManagedConnectionFactory return jc; } - /** - * String representation - * - * @return The representation - */ @Override public String toString() { logger.trace("toString()"); @@ -156,22 +119,10 @@ public String toString() { */ private static class GetCredentialAction implements PrivilegedAction { - /** - * The subject - */ private final Subject subject; - /** - * The managed connection factory - */ private final ManagedConnectionFactory mcf; - /** - * Constructor - * - * @param subject The subject - * @param mcf The managed connection factory - */ GetCredentialAction(final Subject subject, final ManagedConnectionFactory mcf) { logger.trace("constructor({}, {})", subject, mcf); @@ -180,9 +131,7 @@ private static class GetCredentialAction implements PrivilegedAction eventListeners; - /** - * Handles - */ private final Set handles; - /** - * Lock - */ private ReentrantLock lock = new ReentrantLock(); // Physical connection stuff @@ -126,14 +96,6 @@ public final class ActiveMQRAManagedConnection implements ManagedConnection, Exc private boolean inManagedTx; - /** - * Constructor - * - * @param mcf The managed connection factory - * @param cri The connection request information - * @param userName The user name - * @param password The password - */ public ActiveMQRAManagedConnection(final ActiveMQRAManagedConnectionFactory mcf, final ActiveMQRAConnectionRequestInfo cri, final ActiveMQResourceAdapter ra, @@ -176,12 +138,7 @@ public ActiveMQRAManagedConnection(final ActiveMQRAManagedConnectionFactory mcf, } /** - * Get a connection - * - * @param subject The security subject - * @param cxRequestInfo The request info - * @return The connection - * @throws ResourceException Thrown if an error occurs + * {@inheritDoc} */ @Override public synchronized Object getConnection(final Subject subject, @@ -209,11 +166,6 @@ public synchronized Object getConnection(final Subject subject, return session; } - /** - * Destroy all handles. - * - * @throws ResourceException Failed to close one or more handles. - */ private void destroyHandles() throws ResourceException { logger.trace("destroyHandles()"); @@ -225,9 +177,7 @@ private void destroyHandles() throws ResourceException { } /** - * Destroy the physical connection. - * - * @throws ResourceException Could not property close the session and connection. + * {@inheritDoc} */ @Override public void destroy() throws ResourceException { @@ -262,12 +212,10 @@ public void destroy() throws ResourceException { // The following calls should not be necessary, as the connection should close the // ClientSessionFactory, which will close the sessions. try { - /** + /* * (xa|nonXA)Session.close() may NOT be called BEFORE connection.close() - *

            * If the ClientSessionFactory is trying to fail-over or reconnect with -1 attempts, and * one calls session.close() it may effectively dead-lock. - *

            * connection close will close the ClientSessionFactory which will close all sessions. */ connection.close(); @@ -289,9 +237,7 @@ public void destroy() throws ResourceException { } /** - * Cleanup - * - * @throws ResourceException Thrown if an error occurs + * {@inheritDoc} */ @Override public void cleanup() throws ResourceException { @@ -315,11 +261,7 @@ public void cleanup() throws ResourceException { } /** - * Move a handler from one mc to this one. - * - * @param obj An object of type ActiveMQSession. - * @throws ResourceException Failed to associate connection. - * @throws IllegalStateException ManagedConnection in an illegal state. + * {@inheritDoc} */ @Override public void associateConnection(final Object obj) throws ResourceException { @@ -395,9 +337,7 @@ protected void unlock() { } /** - * Add a connection event listener. - * - * @param l The connection event listener to be added. + * {@inheritDoc} */ @Override public void addConnectionEventListener(final ConnectionEventListener l) { @@ -407,9 +347,7 @@ public void addConnectionEventListener(final ConnectionEventListener l) { } /** - * Remove a connection event listener. - * - * @param l The connection event listener to be removed. + * {@inheritDoc} */ @Override public void removeConnectionEventListener(final ConnectionEventListener l) { @@ -419,10 +357,7 @@ public void removeConnectionEventListener(final ConnectionEventListener l) { } /** - * Get the XAResource for the connection. - * - * @return The XAResource for the connection. - * @throws ResourceException XA transaction not supported + * {@inheritDoc} */ @Override public XAResource getXAResource() throws ResourceException { @@ -449,10 +384,7 @@ public XAResource getXAResource() throws ResourceException { } /** - * Get the location transaction for the connection. - * - * @return The local transaction for the connection. - * @throws ResourceException Thrown if operation fails. + * {@inheritDoc} */ @Override public LocalTransaction getLocalTransaction() throws ResourceException { @@ -466,11 +398,7 @@ public LocalTransaction getLocalTransaction() throws ResourceException { } /** - * Get the meta data for the connection. - * - * @return The meta data for the connection. - * @throws ResourceException Thrown if the operation fails. - * @throws IllegalStateException Thrown if the managed connection already is destroyed. + * {@inheritDoc} */ @Override public ManagedConnectionMetaData getMetaData() throws ResourceException { @@ -484,10 +412,9 @@ public ManagedConnectionMetaData getMetaData() throws ResourceException { } /** - * Set the log writer -- NOT SUPPORTED - * - * @param out The log writer - * @throws ResourceException If operation fails + * NOT SUPPORTED + *

            + * {@inheritDoc} */ @Override public void setLogWriter(final PrintWriter out) throws ResourceException { @@ -495,10 +422,9 @@ public void setLogWriter(final PrintWriter out) throws ResourceException { } /** - * Get the log writer -- NOT SUPPORTED - * - * @return Always null - * @throws ResourceException If operation fails + * NOT SUPPORTED + *

            + * {@inheritDoc} */ @Override public PrintWriter getLogWriter() throws ResourceException { @@ -508,9 +434,7 @@ public PrintWriter getLogWriter() throws ResourceException { } /** - * Notifies user of a JMS exception. - * - * @param exception The JMS exception + * {@inheritDoc} */ @Override public void onException(final JMSException exception) { @@ -540,12 +464,6 @@ public void onException(final JMSException exception) { sendEvent(event); } - /** - * Get the session for this connection. - * - * @return The session - * @throws JMSException - */ protected Session getSession() throws JMSException { if (xaResource != null && inManagedTx) { logger.trace("getSession() -> XA session {}", xaSession.getSession()); @@ -558,11 +476,6 @@ protected Session getSession() throws JMSException { } } - /** - * Send an event. - * - * @param event The event to send. - */ protected void sendEvent(final ConnectionEvent event) { logger.trace("sendEvent({})", event); @@ -599,11 +512,6 @@ protected void sendEvent(final ConnectionEvent event) { } } - /** - * Remove a handle from the handle map. - * - * @param handle The handle to remove. - */ protected void removeHandle(final ActiveMQRASession handle) { logger.trace("removeHandle({})", handle); @@ -613,7 +521,7 @@ protected void removeHandle(final ActiveMQRASession handle) { /** * Get the request info for this connection. * - * @return The connection request info for this connection. + * @return The connection request info for this connection */ protected ActiveMQRAConnectionRequestInfo getCRI() { logger.trace("getCRI()"); @@ -621,22 +529,12 @@ protected ActiveMQRAConnectionRequestInfo getCRI() { return cri; } - /** - * Get the connection factory for this connection. - * - * @return The connection factory for this connection. - */ protected ActiveMQRAManagedConnectionFactory getManagedConnectionFactory() { logger.trace("getManagedConnectionFactory()"); return mcf; } - /** - * Start the connection - * - * @throws JMSException Thrown if the connection can't be started - */ void start() throws JMSException { logger.trace("start()"); @@ -645,11 +543,6 @@ void start() throws JMSException { } } - /** - * Stop the connection - * - * @throws JMSException Thrown if the connection can't be stopped - */ void stop() throws JMSException { logger.trace("stop()"); @@ -658,22 +551,12 @@ void stop() throws JMSException { } } - /** - * Get the user name - * - * @return The user name - */ protected String getUserName() { logger.trace("getUserName()"); return userName; } - /** - * Setup the connection. - * - * @throws ResourceException Thrown if a connection couldn't be created - */ private void setup() throws ResourceException { logger.trace("setup()"); 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 7198afe561f..f9e80499448 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 @@ -36,46 +36,22 @@ 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(MethodHandles.lookup().lookupClass()); - /** - * Serial version UID - */ static final long serialVersionUID = -1452379518562456741L; - /** - * The resource adapter - */ private ActiveMQResourceAdapter ra; - /** - * Connection manager - */ private ConnectionManager cm; - /** - * The managed connection factory properties - */ private final ActiveMQRAMCFProperties mcfProperties; - /** - * Connection Factory used if properties are set - */ private ActiveMQConnectionFactory recoveryConnectionFactory; - /** - * The resource recovery if there is one - */ private XARecoveryConfig resourceRecovery; - /** - * Constructor - */ public ActiveMQRAManagedConnectionFactory() { logger.trace("constructor()"); @@ -85,10 +61,7 @@ public ActiveMQRAManagedConnectionFactory() { } /** - * Creates a Connection Factory instance - * - * @return javax.resource.cci.ConnectionFactory instance - * @throws ResourceException Thrown if a connection factory can't be created + * {@inheritDoc} */ @Override public Object createConnectionFactory() throws ResourceException { @@ -98,11 +71,7 @@ public Object createConnectionFactory() throws ResourceException { } /** - * Creates a Connection Factory instance - * - * @param cxManager The connection manager - * @return javax.resource.cci.ConnectionFactory instance - * @throws ResourceException Thrown if a connection factory can't be created + * {@inheritDoc} */ @Override public Object createConnectionFactory(final ConnectionManager cxManager) throws ResourceException { @@ -118,12 +87,7 @@ public Object createConnectionFactory(final ConnectionManager cxManager) throws } /** - * Creates a new physical connection to the underlying EIS resource manager. - * - * @param subject Caller's security information - * @param cxRequestInfo Additional resource adapter specific connection request information - * @return The managed connection - * @throws ResourceException Thrown if a managed connection can't be created + * {@inheritDoc} */ @Override public ManagedConnection createManagedConnection(final Subject subject, @@ -160,13 +124,7 @@ public XARecoveryConfig getResourceRecovery() { } /** - * Returns a matched connection from the candidate set of connections. - * - * @param connectionSet The candidate connection set - * @param subject Caller's security information - * @param cxRequestInfo Additional resource adapter specific connection request information - * @return The managed connection - * @throws ResourceException Thrown if the managed connection can not be found + * {@inheritDoc} */ @Override public ManagedConnection matchManagedConnections(final Set connectionSet, @@ -201,10 +159,9 @@ public ManagedConnection matchManagedConnections(final Set connectionSet, } /** - * Set the log writer -- NOT SUPPORTED - * - * @param out The writer - * @throws ResourceException Thrown if the writer can't be set + * NOT SUPPORTED + *

            + * {@inheritDoc} */ @Override public void setLogWriter(final PrintWriter out) throws ResourceException { @@ -212,10 +169,9 @@ public void setLogWriter(final PrintWriter out) throws ResourceException { } /** - * Get the log writer -- NOT SUPPORTED - * - * @return The writer - * @throws ResourceException Thrown if the writer can't be retrieved + * NOT SUPPORTED + *

            + * {@inheritDoc} */ @Override public PrintWriter getLogWriter() throws ResourceException { @@ -225,9 +181,7 @@ public PrintWriter getLogWriter() throws ResourceException { } /** - * Get the resource adapter - * - * @return The resource adapter + * {@inheritDoc} */ @Override public ResourceAdapter getResourceAdapter() { @@ -241,12 +195,7 @@ public boolean isIgnoreJTA() { } /** - * Set the resource adapter - *
            - * This should ensure that when the RA is stopped, this MCF will be stopped as well. - * - * @param ra The resource adapter - * @throws ResourceException Thrown if incorrect resource adapter + * {@inheritDoc} */ @Override public void setResourceAdapter(final ResourceAdapter ra) throws ResourceException { @@ -260,12 +209,6 @@ public void setResourceAdapter(final ResourceAdapter ra) throws ResourceExceptio this.ra.setManagedConnectionFactory(this); } - /** - * Indicates whether some other object is "equal to" this one. - * - * @param obj Object with which to compare - * @return True if this object is the same as the obj argument; false otherwise. - */ @Override public boolean equals(final Object obj) { logger.trace("equals({})", obj); @@ -282,11 +225,6 @@ public boolean equals(final Object obj) { } } - /** - * Return the hash code for the object - * - * @return The hash code - */ @Override public int hashCode() { logger.trace("hashCode()"); @@ -297,11 +235,6 @@ public int hashCode() { return hash; } - /** - * Get the default session type - * - * @return The value - */ public String getSessionDefaultType() { logger.trace("getSessionDefaultType()"); @@ -311,7 +244,7 @@ public String getSessionDefaultType() { /** * Set the default session type * - * @param type either javax.jms.Topic or javax.jms.Queue + * @param type either {@literal javax.jms.Topic} or {@literal javax.jms.Queue} */ public void setSessionDefaultType(final String type) { logger.trace("setSessionDefaultType({})", type); @@ -319,9 +252,6 @@ public void setSessionDefaultType(final String type) { mcfProperties.setSessionDefaultType(type); } - /** - * @return the connectionParameters - */ public String getConnectionParameters() { return mcfProperties.getStrConnectionParameters(); } @@ -330,9 +260,6 @@ public void setConnectionParameters(final String configuration) { mcfProperties.setConnectionParameters(configuration); } - /** - * @return the transportType - */ public String getConnectorClassName() { return mcfProperties.getConnectorClassName(); } @@ -698,57 +625,30 @@ public void setInitialConnectAttempts(final Integer initialConnectAttempts) { mcfProperties.setInitialConnectAttempts(initialConnectAttempts); } - - /** - * Get the useTryLock. - * - * @return the useTryLock. - */ public Integer getUseTryLock() { logger.trace("getUseTryLock()"); return mcfProperties.getUseTryLock(); } - /** - * Set the useTryLock. - * - * @param useTryLock the useTryLock. - */ public void setUseTryLock(final Integer useTryLock) { logger.trace("setUseTryLock({})", useTryLock); mcfProperties.setUseTryLock(useTryLock); } - /** - * Get the connection metadata - * - * @return The metadata - */ public ConnectionMetaData getMetaData() { logger.trace("getMetadata()"); return new ActiveMQRAConnectionMetaData(); } - /** - * Get the managed connection factory properties - * - * @return The properties - */ protected ActiveMQRAMCFProperties getProperties() { logger.trace("getProperties()"); return mcfProperties; } - /** - * Get a connection request info instance - * - * @param info The instance that should be updated; may be null - * @return The instance - */ private ActiveMQRAConnectionRequestInfo getCRI(final ActiveMQRAConnectionRequestInfo info) { logger.trace("getCRI({})", info); 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 7e8e0297df0..9fd7e8c9a53 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 @@ -26,18 +26,12 @@ import java.lang.invoke.MethodHandles; /** - * A wrapper for a message + * A wrapper for a {@link MapMessage}. */ public class ActiveMQRAMapMessage extends ActiveMQRAMessage implements MapMessage { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Create a new wrapper - * - * @param message the message - * @param session the session - */ public ActiveMQRAMapMessage(final MapMessage message, final ActiveMQRASession session) { super(message, session); @@ -45,11 +39,7 @@ public ActiveMQRAMapMessage(final MapMessage message, final ActiveMQRASession se } /** - * Get - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public boolean getBoolean(final String name) throws JMSException { @@ -59,11 +49,7 @@ public boolean getBoolean(final String name) throws JMSException { } /** - * Get - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public byte getByte(final String name) throws JMSException { @@ -73,11 +59,7 @@ public byte getByte(final String name) throws JMSException { } /** - * Get - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public byte[] getBytes(final String name) throws JMSException { @@ -87,11 +69,7 @@ public byte[] getBytes(final String name) throws JMSException { } /** - * Get - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public char getChar(final String name) throws JMSException { @@ -101,11 +79,7 @@ public char getChar(final String name) throws JMSException { } /** - * Get - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public double getDouble(final String name) throws JMSException { @@ -115,11 +89,7 @@ public double getDouble(final String name) throws JMSException { } /** - * Get - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public float getFloat(final String name) throws JMSException { @@ -129,11 +99,7 @@ public float getFloat(final String name) throws JMSException { } /** - * Get - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int getInt(final String name) throws JMSException { @@ -143,11 +109,7 @@ public int getInt(final String name) throws JMSException { } /** - * Get - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public long getLong(final String name) throws JMSException { @@ -157,10 +119,7 @@ public long getLong(final String name) throws JMSException { } /** - * Get the map names - * - * @return The values - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Enumeration getMapNames() throws JMSException { @@ -170,11 +129,7 @@ public Enumeration getMapNames() throws JMSException { } /** - * Get - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Object getObject(final String name) throws JMSException { @@ -184,11 +139,7 @@ public Object getObject(final String name) throws JMSException { } /** - * Get - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public short getShort(final String name) throws JMSException { @@ -198,11 +149,7 @@ public short getShort(final String name) throws JMSException { } /** - * Get - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public String getString(final String name) throws JMSException { @@ -212,11 +159,7 @@ public String getString(final String name) throws JMSException { } /** - * Does the item exist - * - * @param name The name - * @return True / false - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public boolean itemExists(final String name) throws JMSException { @@ -226,11 +169,7 @@ public boolean itemExists(final String name) throws JMSException { } /** - * Set - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setBoolean(final String name, final boolean value) throws JMSException { @@ -242,11 +181,7 @@ public void setBoolean(final String name, final boolean value) throws JMSExcepti } /** - * Set - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setByte(final String name, final byte value) throws JMSException { @@ -258,13 +193,7 @@ public void setByte(final String name, final byte value) throws JMSException { } /** - * Set - * - * @param name The name - * @param value The value - * @param offset The offset - * @param length The length - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setBytes(final String name, final byte[] value, final int offset, final int length) throws JMSException { @@ -276,11 +205,7 @@ public void setBytes(final String name, final byte[] value, final int offset, fi } /** - * Set - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setBytes(final String name, final byte[] value) throws JMSException { @@ -292,11 +217,7 @@ public void setBytes(final String name, final byte[] value) throws JMSException } /** - * Set - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setChar(final String name, final char value) throws JMSException { @@ -308,11 +229,7 @@ public void setChar(final String name, final char value) throws JMSException { } /** - * Set - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setDouble(final String name, final double value) throws JMSException { @@ -324,11 +241,7 @@ public void setDouble(final String name, final double value) throws JMSException } /** - * Set - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setFloat(final String name, final float value) throws JMSException { @@ -340,11 +253,7 @@ public void setFloat(final String name, final float value) throws JMSException { } /** - * Set - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setInt(final String name, final int value) throws JMSException { @@ -356,11 +265,7 @@ public void setInt(final String name, final int value) throws JMSException { } /** - * Set - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setLong(final String name, final long value) throws JMSException { @@ -372,11 +277,7 @@ public void setLong(final String name, final long value) throws JMSException { } /** - * Set - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setObject(final String name, final Object value) throws JMSException { @@ -388,11 +289,7 @@ public void setObject(final String name, final Object value) throws JMSException } /** - * Set - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setShort(final String name, final short value) throws JMSException { @@ -404,11 +301,7 @@ public void setShort(final String name, final short value) throws JMSException { } /** - * Set - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setString(final String name, final String value) throws JMSException { 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 ae98071211d..ee1c1b19533 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 @@ -29,28 +29,16 @@ import static org.apache.activemq.artemis.utils.Preconditions.checkNotNull; /** - * A wrapper for a message + * A wrapper for a {@link Message}. */ public class ActiveMQRAMessage implements Message { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * The message - */ protected Message message; - /** - * The session - */ protected ActiveMQRASession session; - /** - * Create a new wrapper - * - * @param message the message - * @param session the session - */ public ActiveMQRAMessage(final Message message, final ActiveMQRASession session) { checkNotNull(message); checkNotNull(session); @@ -62,9 +50,7 @@ public ActiveMQRAMessage(final Message message, final ActiveMQRASession session) } /** - * Acknowledge - * - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void acknowledge() throws JMSException { @@ -75,9 +61,7 @@ public void acknowledge() throws JMSException { } /** - * Clear body - * - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void clearBody() throws JMSException { @@ -87,9 +71,7 @@ public void clearBody() throws JMSException { } /** - * Clear properties - * - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void clearProperties() throws JMSException { @@ -99,11 +81,7 @@ public void clearProperties() throws JMSException { } /** - * Get property - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public boolean getBooleanProperty(final String name) throws JMSException { @@ -113,11 +91,7 @@ public boolean getBooleanProperty(final String name) throws JMSException { } /** - * Get property - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public byte getByteProperty(final String name) throws JMSException { @@ -127,11 +101,7 @@ public byte getByteProperty(final String name) throws JMSException { } /** - * Get property - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public double getDoubleProperty(final String name) throws JMSException { @@ -141,11 +111,7 @@ public double getDoubleProperty(final String name) throws JMSException { } /** - * Get property - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public float getFloatProperty(final String name) throws JMSException { @@ -155,11 +121,7 @@ public float getFloatProperty(final String name) throws JMSException { } /** - * Get property - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int getIntProperty(final String name) throws JMSException { @@ -169,10 +131,7 @@ public int getIntProperty(final String name) throws JMSException { } /** - * Get correlation id - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public String getJMSCorrelationID() throws JMSException { @@ -182,10 +141,7 @@ public String getJMSCorrelationID() throws JMSException { } /** - * Get correlation id - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public byte[] getJMSCorrelationIDAsBytes() throws JMSException { @@ -195,10 +151,7 @@ public byte[] getJMSCorrelationIDAsBytes() throws JMSException { } /** - * Get delivery mode - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int getJMSDeliveryMode() throws JMSException { @@ -208,10 +161,7 @@ public int getJMSDeliveryMode() throws JMSException { } /** - * Get destination - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Destination getJMSDestination() throws JMSException { @@ -221,10 +171,7 @@ public Destination getJMSDestination() throws JMSException { } /** - * Get expiration - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public long getJMSExpiration() throws JMSException { @@ -234,10 +181,7 @@ public long getJMSExpiration() throws JMSException { } /** - * Get message id - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public String getJMSMessageID() throws JMSException { @@ -247,10 +191,7 @@ public String getJMSMessageID() throws JMSException { } /** - * Get priority - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int getJMSPriority() throws JMSException { @@ -260,10 +201,7 @@ public int getJMSPriority() throws JMSException { } /** - * Get redelivered status - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public boolean getJMSRedelivered() throws JMSException { @@ -273,10 +211,7 @@ public boolean getJMSRedelivered() throws JMSException { } /** - * Get reply to destination - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Destination getJMSReplyTo() throws JMSException { @@ -286,10 +221,7 @@ public Destination getJMSReplyTo() throws JMSException { } /** - * Get timestamp - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public long getJMSTimestamp() throws JMSException { @@ -299,10 +231,7 @@ public long getJMSTimestamp() throws JMSException { } /** - * Get type - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public String getJMSType() throws JMSException { @@ -312,11 +241,7 @@ public String getJMSType() throws JMSException { } /** - * Get property - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public long getLongProperty(final String name) throws JMSException { @@ -326,11 +251,7 @@ public long getLongProperty(final String name) throws JMSException { } /** - * Get property - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Object getObjectProperty(final String name) throws JMSException { @@ -340,10 +261,7 @@ public Object getObjectProperty(final String name) throws JMSException { } /** - * Get property names - * - * @return The values - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Enumeration getPropertyNames() throws JMSException { @@ -353,11 +271,7 @@ public Enumeration getPropertyNames() throws JMSException { } /** - * Get property - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public short getShortProperty(final String name) throws JMSException { @@ -367,11 +281,7 @@ public short getShortProperty(final String name) throws JMSException { } /** - * Get property - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public String getStringProperty(final String name) throws JMSException { @@ -381,11 +291,7 @@ public String getStringProperty(final String name) throws JMSException { } /** - * Do property exist - * - * @param name The name - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public boolean propertyExists(final String name) throws JMSException { @@ -395,11 +301,7 @@ public boolean propertyExists(final String name) throws JMSException { } /** - * Set property - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setBooleanProperty(final String name, final boolean value) throws JMSException { @@ -411,11 +313,7 @@ public void setBooleanProperty(final String name, final boolean value) throws JM } /** - * Set property - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setByteProperty(final String name, final byte value) throws JMSException { @@ -427,11 +325,7 @@ public void setByteProperty(final String name, final byte value) throws JMSExcep } /** - * Set property - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setDoubleProperty(final String name, final double value) throws JMSException { @@ -443,11 +337,7 @@ public void setDoubleProperty(final String name, final double value) throws JMSE } /** - * Set property - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setFloatProperty(final String name, final float value) throws JMSException { @@ -459,11 +349,7 @@ public void setFloatProperty(final String name, final float value) throws JMSExc } /** - * Set property - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setIntProperty(final String name, final int value) throws JMSException { @@ -475,10 +361,7 @@ public void setIntProperty(final String name, final int value) throws JMSExcepti } /** - * Set correlation id - * - * @param correlationID The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setJMSCorrelationID(final String correlationID) throws JMSException { @@ -490,10 +373,7 @@ public void setJMSCorrelationID(final String correlationID) throws JMSException } /** - * Set correlation id - * - * @param correlationID The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setJMSCorrelationIDAsBytes(final byte[] correlationID) throws JMSException { @@ -505,10 +385,7 @@ public void setJMSCorrelationIDAsBytes(final byte[] correlationID) throws JMSExc } /** - * Set delivery mode - * - * @param deliveryMode The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setJMSDeliveryMode(final int deliveryMode) throws JMSException { @@ -520,10 +397,7 @@ public void setJMSDeliveryMode(final int deliveryMode) throws JMSException { } /** - * Set destination - * - * @param destination The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setJMSDestination(final Destination destination) throws JMSException { @@ -533,10 +407,7 @@ public void setJMSDestination(final Destination destination) throws JMSException } /** - * Set expiration - * - * @param expiration The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setJMSExpiration(final long expiration) throws JMSException { @@ -548,10 +419,7 @@ public void setJMSExpiration(final long expiration) throws JMSException { } /** - * Set message id - * - * @param id The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setJMSMessageID(final String id) throws JMSException { @@ -561,10 +429,7 @@ public void setJMSMessageID(final String id) throws JMSException { } /** - * Set priority - * - * @param priority The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setJMSPriority(final int priority) throws JMSException { @@ -576,10 +441,7 @@ public void setJMSPriority(final int priority) throws JMSException { } /** - * Set redelivered status - * - * @param redelivered The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setJMSRedelivered(final boolean redelivered) throws JMSException { @@ -591,10 +453,7 @@ public void setJMSRedelivered(final boolean redelivered) throws JMSException { } /** - * Set reply to - * - * @param replyTo The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setJMSReplyTo(final Destination replyTo) throws JMSException { @@ -604,10 +463,7 @@ public void setJMSReplyTo(final Destination replyTo) throws JMSException { } /** - * Set timestamp - * - * @param timestamp The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setJMSTimestamp(final long timestamp) throws JMSException { @@ -619,10 +475,7 @@ public void setJMSTimestamp(final long timestamp) throws JMSException { } /** - * Set type - * - * @param type The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setJMSType(final String type) throws JMSException { @@ -632,11 +485,7 @@ public void setJMSType(final String type) throws JMSException { } /** - * Set property - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setLongProperty(final String name, final long value) throws JMSException { @@ -648,11 +497,7 @@ public void setLongProperty(final String name, final long value) throws JMSExcep } /** - * Set property - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setObjectProperty(final String name, final Object value) throws JMSException { @@ -662,11 +507,7 @@ public void setObjectProperty(final String name, final Object value) throws JMSE } /** - * Set property - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setShortProperty(final String name, final short value) throws JMSException { @@ -678,11 +519,7 @@ public void setShortProperty(final String name, final short value) throws JMSExc } /** - * Set property - * - * @param name The name - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setStringProperty(final String name, final String value) throws JMSException { @@ -693,6 +530,9 @@ public void setStringProperty(final String name, final String value) throws JMSE message.setStringProperty(name, value); } + /** + * {@inheritDoc} + */ @Override public long getJMSDeliveryTime() throws JMSException { logger.trace("getJMSDeliveryTime()"); @@ -700,6 +540,9 @@ public long getJMSDeliveryTime() throws JMSException { return message.getJMSDeliveryTime(); } + /** + * {@inheritDoc} + */ @Override public void setJMSDeliveryTime(long deliveryTime) throws JMSException { if (logger.isTraceEnabled()) { @@ -709,6 +552,9 @@ public void setJMSDeliveryTime(long deliveryTime) throws JMSException { message.setJMSDeliveryTime(deliveryTime); } + /** + * {@inheritDoc} + */ @Override public T getBody(Class c) throws JMSException { logger.trace("getBody({})", c); @@ -716,6 +562,9 @@ public T getBody(Class c) throws JMSException { return message.getBody(c); } + /** + * {@inheritDoc} + */ @Override public boolean isBodyAssignableTo(Class c) throws JMSException { logger.trace("isBodyAssignableTo({})", c); @@ -723,11 +572,6 @@ public boolean isBodyAssignableTo(Class c) throws JMSException { return message.isBodyAssignableTo(c); } - /** - * Return the hash code - * - * @return The hash code - */ @Override public int hashCode() { logger.trace("hashCode()"); @@ -735,12 +579,6 @@ public int hashCode() { return message.hashCode(); } - /** - * Check for equality - * - * @param object The other object - * @return True / false - */ @Override public boolean equals(final Object object) { logger.trace("equals({})", object); @@ -752,11 +590,6 @@ public boolean equals(final Object object) { } } - /** - * Return string representation - * - * @return The string - */ @Override public String toString() { logger.trace("toString()"); 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 4ae85daeee6..e4cdc8c74cc 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 @@ -31,28 +31,16 @@ import java.lang.invoke.MethodHandles; /** - * A wrapper for a message consumer + * A wrapper for a {@link MessageConsumer}. */ public class ActiveMQRAMessageConsumer implements MessageConsumer { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * The wrapped message consumer - */ protected MessageConsumer consumer; - /** - * The session for this consumer - */ protected ActiveMQRASession session; - /** - * Create a new wrapper - * - * @param consumer the consumer - * @param session the session - */ public ActiveMQRAMessageConsumer(final MessageConsumer consumer, final ActiveMQRASession session) { this.consumer = consumer; this.session = session; @@ -63,9 +51,7 @@ public ActiveMQRAMessageConsumer(final MessageConsumer consumer, final ActiveMQR } /** - * Close - * - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void close() throws JMSException { @@ -78,11 +64,6 @@ public void close() throws JMSException { } } - /** - * Check state - * - * @throws JMSException Thrown if an error occurs - */ void checkState() throws JMSException { logger.trace("checkState()"); @@ -90,10 +71,7 @@ void checkState() throws JMSException { } /** - * Get message listener - * - * @return The listener - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public MessageListener getMessageListener() throws JMSException { @@ -104,11 +82,9 @@ public MessageListener getMessageListener() throws JMSException { return consumer.getMessageListener(); } + /** - * Set message listener - * - * @param listener The listener - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setMessageListener(final MessageListener listener) throws JMSException { @@ -126,11 +102,9 @@ public void setMessageListener(final MessageListener listener) throws JMSExcepti } } + /** - * Get message selector - * - * @return The selector - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public String getMessageSelector() throws JMSException { @@ -140,11 +114,9 @@ public String getMessageSelector() throws JMSException { return consumer.getMessageSelector(); } + /** - * Receive - * - * @return The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Message receive() throws JMSException { @@ -167,12 +139,9 @@ public Message receive() throws JMSException { } } + /** - * Receive - * - * @param timeout The timeout value - * @return The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Message receive(final long timeout) throws JMSException { @@ -197,11 +166,9 @@ public Message receive(final long timeout) throws JMSException { } } + /** - * Receive - * - * @return The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Message receiveNoWait() throws JMSException { @@ -224,23 +191,12 @@ public Message receiveNoWait() throws JMSException { } } - /** - * Close consumer - * - * @throws JMSException Thrown if an error occurs - */ void closeConsumer() throws JMSException { logger.trace("closeConsumer()"); consumer.close(); } - /** - * Wrap message - * - * @param message The message to be wrapped - * @return The wrapped message - */ Message wrapMessage(final Message message) { logger.trace("wrapMessage({})", message); @@ -258,12 +214,6 @@ Message wrapMessage(final Message message) { return new ActiveMQRAMessage(message, session); } - /** - * Wrap message listener - * - * @param listener The listener to be wrapped - * @return The wrapped listener - */ MessageListener wrapMessageListener(final MessageListener listener) { logger.trace("getMessageSelector()"); 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 e8d1608a1d7..1e6151d3b48 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 @@ -24,29 +24,16 @@ import java.lang.invoke.MethodHandles; /** - * A wrapper for a message listener + * A wrapper for a {@link MessageListener}. */ public class ActiveMQRAMessageListener implements MessageListener { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - /** - * The message listener - */ private final MessageListener listener; - /** - * The consumer - */ private final ActiveMQRAMessageConsumer consumer; - /** - * Create a new wrapper - * - * @param listener the listener - * @param consumer the consumer - */ public ActiveMQRAMessageListener(final MessageListener listener, final ActiveMQRAMessageConsumer consumer) { logger.trace("constructor({}, {})", listener, consumer); @@ -54,10 +41,9 @@ public ActiveMQRAMessageListener(final MessageListener listener, final ActiveMQR this.consumer = consumer; } + /** - * On message - * - * @param message The message + * {@inheritDoc} */ @Override public void onMessage(Message message) { 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 903b14d4fe3..150b1f1fb4b 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 @@ -27,28 +27,16 @@ import java.lang.invoke.MethodHandles; /** - * ActiveMQMessageProducer. + * A wrapper for a {@link MessageProducer}. */ public class ActiveMQRAMessageProducer implements MessageProducer { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * The wrapped message producer - */ protected MessageProducer producer; - /** - * The session for this consumer - */ protected ActiveMQRASession session; - /** - * Create a new wrapper - * - * @param producer the producer - * @param session the session - */ public ActiveMQRAMessageProducer(final MessageProducer producer, final ActiveMQRASession session) { this.producer = producer; this.session = session; @@ -58,10 +46,9 @@ public ActiveMQRAMessageProducer(final MessageProducer producer, final ActiveMQR } } + /** - * Close - * - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void close() throws JMSException { @@ -74,15 +61,9 @@ public void close() throws JMSException { } } + /** - * Send message - * - * @param destination The destination - * @param message The message - * @param deliveryMode The delivery mode - * @param priority The priority - * @param timeToLive The time to live - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void send(final Destination destination, @@ -107,12 +88,9 @@ public void send(final Destination destination, } } + /** - * Send message - * - * @param destination The destination - * @param message The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void send(final Destination destination, final Message message) throws JMSException { @@ -132,14 +110,9 @@ public void send(final Destination destination, final Message message) throws JM } } + /** - * Send message - * - * @param message The message - * @param deliveryMode The delivery mode - * @param priority The priority - * @param timeToLive The time to live - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void send(final Message message, @@ -163,11 +136,9 @@ public void send(final Message message, } } + /** - * Send message - * - * @param message The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void send(final Message message) throws JMSException { @@ -185,11 +156,9 @@ public void send(final Message message) throws JMSException { } } + /** - * Get the delivery mode - * - * @return The mode - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int getDeliveryMode() throws JMSException { @@ -198,11 +167,9 @@ public int getDeliveryMode() throws JMSException { return producer.getDeliveryMode(); } + /** - * Get the destination - * - * @return The destination - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Destination getDestination() throws JMSException { @@ -211,11 +178,9 @@ public Destination getDestination() throws JMSException { return producer.getDestination(); } + /** - * Disable message id - * - * @return True if disable - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public boolean getDisableMessageID() throws JMSException { @@ -224,11 +189,9 @@ public boolean getDisableMessageID() throws JMSException { return producer.getDisableMessageID(); } + /** - * Disable message timestamp - * - * @return True if disable - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public boolean getDisableMessageTimestamp() throws JMSException { @@ -237,11 +200,9 @@ public boolean getDisableMessageTimestamp() throws JMSException { return producer.getDisableMessageTimestamp(); } + /** - * Get the priority - * - * @return The priority - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int getPriority() throws JMSException { @@ -250,11 +211,9 @@ public int getPriority() throws JMSException { return producer.getPriority(); } + /** - * Get the time to live - * - * @return The ttl - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public long getTimeToLive() throws JMSException { @@ -263,11 +222,9 @@ public long getTimeToLive() throws JMSException { return producer.getTimeToLive(); } + /** - * Set the delivery mode - * - * @param deliveryMode The mode - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setDeliveryMode(final int deliveryMode) throws JMSException { @@ -278,11 +235,9 @@ public void setDeliveryMode(final int deliveryMode) throws JMSException { producer.setDeliveryMode(deliveryMode); } + /** - * Set disable message id - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setDisableMessageID(final boolean value) throws JMSException { @@ -293,11 +248,9 @@ public void setDisableMessageID(final boolean value) throws JMSException { producer.setDisableMessageID(value); } + /** - * Set disable message timestamp - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setDisableMessageTimestamp(final boolean value) throws JMSException { @@ -308,11 +261,9 @@ public void setDisableMessageTimestamp(final boolean value) throws JMSException producer.setDisableMessageTimestamp(value); } + /** - * Set the priority - * - * @param defaultPriority The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setPriority(final int defaultPriority) throws JMSException { @@ -323,11 +274,9 @@ public void setPriority(final int defaultPriority) throws JMSException { producer.setPriority(defaultPriority); } + /** - * Set the ttl - * - * @param timeToLive The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setTimeToLive(final long timeToLive) throws JMSException { @@ -395,20 +344,10 @@ public void send(Destination destination, producer.send(destination, message, deliveryMode, priority, timeToLive, completionListener); } - /** - * Check state - * - * @throws JMSException Thrown if an error occurs - */ void checkState() throws JMSException { session.checkState(); } - /** - * Close producer - * - * @throws JMSException Thrown if an error occurs - */ void closeProducer() throws JMSException { producer.close(); } 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 5fcc904cb85..fe1b77c466b 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 @@ -24,22 +24,14 @@ import java.lang.invoke.MethodHandles; /** - * Managed connection meta data + * {@inheritDoc} */ public class ActiveMQRAMetaData implements ManagedConnectionMetaData { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * The managed connection - */ private final ActiveMQRAManagedConnection mc; - /** - * Constructor - * - * @param mc The managed connection - */ public ActiveMQRAMetaData(final ActiveMQRAManagedConnection mc) { logger.trace("constructor({})", mc); @@ -47,10 +39,7 @@ public ActiveMQRAMetaData(final ActiveMQRAManagedConnection mc) { } /** - * Get the EIS product name - * - * @return The name - * @throws ResourceException Thrown if operation fails + * {@inheritDoc} */ @Override public String getEISProductName() throws ResourceException { @@ -59,11 +48,9 @@ public String getEISProductName() throws ResourceException { return "ActiveMQ Artemis"; } + /** - * Get the EIS product version - * - * @return The version - * @throws ResourceException Thrown if operation fails + * {@inheritDoc} */ @Override public String getEISProductVersion() throws ResourceException { @@ -72,11 +59,9 @@ public String getEISProductVersion() throws ResourceException { return "2.0"; } + /** - * Get the user name - * - * @return The user name - * @throws ResourceException Thrown if operation fails + * {@inheritDoc} */ @Override public String getUserName() throws ResourceException { @@ -85,11 +70,9 @@ public String getUserName() throws ResourceException { return mc.getUserName(); } + /** - * Get the maximum number of connections -- RETURNS 0 - * - * @return The number - * @throws ResourceException Thrown if operation fails + * {@inheritDoc} */ @Override public int getMaxConnections() throws ResourceException { 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 3c4733a6c91..5e7094d5750 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 @@ -25,29 +25,21 @@ import java.lang.invoke.MethodHandles; /** - * A wrapper for a message + * A wrapper for a {@link ObjectMessage}. */ public class ActiveMQRAObjectMessage extends ActiveMQRAMessage implements ObjectMessage { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Create a new wrapper - * - * @param message the message - * @param session the session - */ public ActiveMQRAObjectMessage(final ObjectMessage message, final ActiveMQRASession session) { super(message, session); logger.trace("constructor({}, {})", message, session); } + /** - * Get the object - * - * @return The object - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Serializable getObject() throws JMSException { @@ -56,11 +48,9 @@ public Serializable getObject() throws JMSException { return ((ObjectMessage) message).getObject(); } + /** - * Set the object - * - * @param object The object - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setObject(final Serializable object) throws JMSException { 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 137e41d00f0..52193d8ecd6 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 @@ -33,23 +33,14 @@ public class ActiveMQRAProperties extends ConnectionFactoryProperties implements private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Serial version UID - */ static final long serialVersionUID = -2772367477755473248L; protected boolean allowLocalTransactions; protected boolean useTopologyForLoadBalancing = ActiveMQClient.DEFAULT_USE_TOPOLOGY_FOR_LOADBALANCING; - /** - * The user name - */ private String userName; - /** - * The password - */ private String password = null; /** @@ -85,40 +76,22 @@ public class ActiveMQRAProperties extends ConnectionFactoryProperties implements */ private String jgroupsChannelRefName; - /** - * Constructor - */ public ActiveMQRAProperties() { logger.trace("constructor()"); } - /** - * Get the user name - * - * @return The value - */ public String getUserName() { logger.trace("getUserName()"); return userName; } - /** - * Set the user name - * - * @param userName The value - */ public void setUserName(final String userName) { logger.trace("setUserName({})", userName); this.userName = userName; } - /** - * Get the password - * - * @return The value - */ public String getPassword() { logger.trace("getPassword()"); @@ -126,12 +99,9 @@ public String getPassword() { } /** - * Set the password - * Based on UseMaskedPassword property, the password can be - * plain text or encoded string. However we cannot decide - * which is the case at this moment, because we don't know - * when the UseMaskedPassword and PasswordCodec are loaded. So for the moment - * we just save the password. + * Set the password Based on UseMaskedPassword property, the password can be plain text or encoded string. However we + * cannot decide which is the case at this moment, because we don't know when the UseMaskedPassword and PasswordCodec + * are loaded. So for the moment we just save the password. * * @param password The value */ @@ -141,23 +111,14 @@ public void setPassword(final String password) { this.password = password; } - /** - * @return the useJNDI - */ public boolean isUseJNDI() { return useJNDI; } - /** - * @param value the useJNDI to set - */ public void setUseJNDI(final Boolean value) { useJNDI = value; } - /** - * @return return the jndi params to use - */ public Hashtable getParsedJndiParams() { return jndiParams; } @@ -166,22 +127,12 @@ public void setParsedJndiParams(Hashtable params) { jndiParams = params; } - /** - * Get the use XA flag - * - * @return The value - */ public Boolean getUseLocalTx() { logger.trace("getUseLocalTx()"); return localTx; } - /** - * Set the use XA flag - * - * @param localTx The value - */ public void setUseLocalTx(final Boolean localTx) { logger.trace("setUseLocalTx({})", localTx); 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 fe8a0eb2dcf..cc4ce48f91d 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 @@ -25,18 +25,12 @@ import java.lang.invoke.MethodHandles; /** - * A wrapper for a queue receiver + * A wrapper for a {@link QueueReceiver}. */ public class ActiveMQRAQueueReceiver extends ActiveMQRAMessageConsumer implements QueueReceiver { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Create a new wrapper - * - * @param consumer the queue receiver - * @param session the session - */ public ActiveMQRAQueueReceiver(final QueueReceiver consumer, final ActiveMQRASession session) { super(consumer, session); @@ -44,10 +38,7 @@ public ActiveMQRAQueueReceiver(final QueueReceiver consumer, final ActiveMQRASes } /** - * Get queue - * - * @return The queue - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Queue getQueue() throws JMSException { 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 3783748c408..13edb999e72 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 @@ -26,18 +26,12 @@ import java.lang.invoke.MethodHandles; /** - * ActiveMQQueueSender. + * A wrapper for a {@link QueueSender}. */ public class ActiveMQRAQueueSender extends ActiveMQRAMessageProducer implements QueueSender { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Create a new wrapper - * - * @param producer the producer - * @param session the session - */ public ActiveMQRAQueueSender(final QueueSender producer, final ActiveMQRASession session) { super(producer, session); @@ -47,10 +41,7 @@ public ActiveMQRAQueueSender(final QueueSender producer, final ActiveMQRASession } /** - * Get queue - * - * @return The queue - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Queue getQueue() throws JMSException { @@ -60,14 +51,7 @@ public Queue getQueue() throws JMSException { } /** - * Send message - * - * @param destination The destination - * @param message The message - * @param deliveryMode The delivery mode - * @param priority The priority - * @param timeToLive The time to live - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void send(final Queue destination, @@ -92,11 +76,7 @@ public void send(final Queue destination, } /** - * Send message - * - * @param destination The destination - * @param message The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void send(final Queue destination, final Message message) throws JMSException { diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAService.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAService.java index 9a836b8e4a4..bb76a1fc20d 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAService.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAService.java @@ -22,8 +22,8 @@ import java.util.Set; /** - * An ActiveMQRAService ensures that ActiveMQ Artemis Resource Adapter will be stopped *before* the ActiveMQ Artemis server. - * https://jira.jboss.org/browse/HORNETQ-339 + * An ActiveMQRAService ensures that ActiveMQ Artemis Resource Adapter will be stopped *before* the ActiveMQ Artemis + * server. */ public class ActiveMQRAService { @@ -31,14 +31,11 @@ public class ActiveMQRAService { private final String resourceAdapterObjectName; - - public ActiveMQRAService(final MBeanServer mBeanServer, final String resourceAdapterObjectName) { this.mBeanServer = mBeanServer; this.resourceAdapterObjectName = resourceAdapterObjectName; } - public void stop() { try { ObjectName objectName = new ObjectName(resourceAdapterObjectName); @@ -55,5 +52,4 @@ public void stop() { ActiveMQRALogger.LOGGER.errorStoppingRA(e); } } - } 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 95c889f0837..68bd7fe42e9 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 @@ -60,43 +60,22 @@ import java.lang.invoke.MethodHandles; /** - * A joint interface for JMS sessions + * A joint interface for {@link QueueSession}, {@link TopicSession}, {@link XAQueueSession}, and {@link XATopicSession}. */ public class ActiveMQRASession implements QueueSession, TopicSession, XAQueueSession, XATopicSession { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * The managed connection - */ private ActiveMQRAManagedConnection mc; - /** - * The connection request info - */ private final ActiveMQRAConnectionRequestInfo cri; - /** - * The session factory - */ private ActiveMQRASessionFactory sf; - /** - * The message consumers - */ private final Set consumers; - /** - * The message producers - */ private final Set producers; - /** - * Constructor - * - * @param mc The managed connection - * @param cri The connection request info - */ public ActiveMQRASession(final ActiveMQRAManagedConnection mc, final ActiveMQRAConnectionRequestInfo cri) { logger.trace("constructor({}, {})", mc, cri); @@ -107,11 +86,6 @@ public ActiveMQRASession(final ActiveMQRAManagedConnection mc, final ActiveMQRAC producers = new HashSet<>(); } - /** - * Set the session factory - * - * @param sf The session factory - */ public void setActiveMQSessionFactory(final ActiveMQRASessionFactory sf) { logger.trace("setActiveMQSessionFactory({})", sf); @@ -151,10 +125,7 @@ protected void unlock() { } /** - * Create a bytes message - * - * @return The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public BytesMessage createBytesMessage() throws JMSException { @@ -166,10 +137,7 @@ public BytesMessage createBytesMessage() throws JMSException { } /** - * Create a map message - * - * @return The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public MapMessage createMapMessage() throws JMSException { @@ -181,10 +149,7 @@ public MapMessage createMapMessage() throws JMSException { } /** - * Create a message - * - * @return The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Message createMessage() throws JMSException { @@ -196,10 +161,7 @@ public Message createMessage() throws JMSException { } /** - * Create an object message - * - * @return The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public ObjectMessage createObjectMessage() throws JMSException { @@ -211,11 +173,7 @@ public ObjectMessage createObjectMessage() throws JMSException { } /** - * Create an object message - * - * @param object The object - * @return The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public ObjectMessage createObjectMessage(final Serializable object) throws JMSException { @@ -227,10 +185,7 @@ public ObjectMessage createObjectMessage(final Serializable object) throws JMSEx } /** - * Create a stream message - * - * @return The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public StreamMessage createStreamMessage() throws JMSException { @@ -242,10 +197,7 @@ public StreamMessage createStreamMessage() throws JMSException { } /** - * Create a text message - * - * @return The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public TextMessage createTextMessage() throws JMSException { @@ -257,11 +209,7 @@ public TextMessage createTextMessage() throws JMSException { } /** - * Create a text message - * - * @param string The text - * @return The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public TextMessage createTextMessage(final String string) throws JMSException { @@ -273,10 +221,7 @@ public TextMessage createTextMessage(final String string) throws JMSException { } /** - * Get transacted - * - * @return True if transacted; otherwise false - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public boolean getTransacted() throws JMSException { @@ -287,10 +232,7 @@ public boolean getTransacted() throws JMSException { } /** - * Get the message listener -- throws IllegalStateException - * - * @return The message listener - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public MessageListener getMessageListener() throws JMSException { @@ -300,10 +242,7 @@ public MessageListener getMessageListener() throws JMSException { } /** - * Set the message listener -- Throws IllegalStateException - * - * @param listener The message listener - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setMessageListener(final MessageListener listener) throws JMSException { @@ -313,9 +252,7 @@ public void setMessageListener(final MessageListener listener) throws JMSExcepti } /** - * Always throws an Error. - * - * @throws Error Method not allowed. + * {@inheritDoc} */ @Override public void run() { @@ -325,10 +262,7 @@ public void run() { } /** - * Closes the session. Sends a ConnectionEvent.CONNECTION_CLOSED to the - * managed connection. - * - * @throws JMSException Failed to close session. + * {@inheritDoc} */ @Override public void close() throws JMSException { @@ -339,9 +273,7 @@ public void close() throws JMSException { } /** - * Commit - * - * @throws JMSException Failed to close session. + * {@inheritDoc} */ @Override public void commit() throws JMSException { @@ -367,9 +299,7 @@ public void commit() throws JMSException { } /** - * Rollback - * - * @throws JMSException Failed to close session. + * {@inheritDoc} */ @Override public void rollback() throws JMSException { @@ -395,9 +325,7 @@ public void rollback() throws JMSException { } /** - * Recover - * - * @throws JMSException Failed to close session. + * {@inheritDoc} */ @Override public void recover() throws JMSException { @@ -418,11 +346,7 @@ public void recover() throws JMSException { } /** - * Create a topic - * - * @param topicName The topic name - * @return The topic - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Topic createTopic(final String topicName) throws JMSException { @@ -446,11 +370,7 @@ public Topic createTopic(final String topicName) throws JMSException { } /** - * Create a topic subscriber - * - * @param topic The topic - * @return The subscriber - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public TopicSubscriber createSubscriber(final Topic topic) throws JMSException { @@ -474,13 +394,7 @@ public TopicSubscriber createSubscriber(final Topic topic) throws JMSException { } /** - * Create a topic subscriber - * - * @param topic The topic - * @param messageSelector The message selector - * @param noLocal If true inhibits the delivery of messages published by its own connection - * @return The subscriber - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public TopicSubscriber createSubscriber(final Topic topic, @@ -508,12 +422,7 @@ public TopicSubscriber createSubscriber(final Topic topic, } /** - * Create a durable topic subscriber - * - * @param topic The topic - * @param name The name - * @return The subscriber - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public TopicSubscriber createDurableSubscriber(final Topic topic, final String name) throws JMSException { @@ -543,14 +452,7 @@ public TopicSubscriber createDurableSubscriber(final Topic topic, final String n } /** - * Create a topic subscriber - * - * @param topic The topic - * @param name The name - * @param messageSelector The message selector - * @param noLocal If true inhibits the delivery of messages published by its own connection - * @return The subscriber - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public TopicSubscriber createDurableSubscriber(final Topic topic, @@ -580,11 +482,7 @@ public TopicSubscriber createDurableSubscriber(final Topic topic, } /** - * Create a topic publisher - * - * @param topic The topic - * @return The publisher - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public TopicPublisher createPublisher(final Topic topic) throws JMSException { @@ -608,10 +506,7 @@ public TopicPublisher createPublisher(final Topic topic) throws JMSException { } /** - * Create a temporary topic - * - * @return The temporary topic - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public TemporaryTopic createTemporaryTopic() throws JMSException { @@ -638,10 +533,7 @@ public TemporaryTopic createTemporaryTopic() throws JMSException { } /** - * Unsubscribe - * - * @param name The name - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void unsubscribe(final String name) throws JMSException { @@ -662,11 +554,7 @@ public void unsubscribe(final String name) throws JMSException { } /** - * Create a browser - * - * @param queue The queue - * @return The browser - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public QueueBrowser createBrowser(final Queue queue) throws JMSException { @@ -686,12 +574,7 @@ public QueueBrowser createBrowser(final Queue queue) throws JMSException { } /** - * Create a browser - * - * @param queue The queue - * @param messageSelector The message selector - * @return The browser - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public QueueBrowser createBrowser(final Queue queue, final String messageSelector) throws JMSException { @@ -713,11 +596,7 @@ public QueueBrowser createBrowser(final Queue queue, final String messageSelecto } /** - * Create a queue - * - * @param queueName The queue name - * @return The queue - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Queue createQueue(final String queueName) throws JMSException { @@ -737,11 +616,7 @@ public Queue createQueue(final String queueName) throws JMSException { } /** - * Create a queue receiver - * - * @param queue The queue - * @return The queue receiver - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public QueueReceiver createReceiver(final Queue queue) throws JMSException { @@ -765,12 +640,7 @@ public QueueReceiver createReceiver(final Queue queue) throws JMSException { } /** - * Create a queue receiver - * - * @param queue The queue - * @param messageSelector - * @return The queue receiver - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public QueueReceiver createReceiver(final Queue queue, final String messageSelector) throws JMSException { @@ -796,11 +666,7 @@ public QueueReceiver createReceiver(final Queue queue, final String messageSelec } /** - * Create a queue sender - * - * @param queue The queue - * @return The queue sender - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public QueueSender createSender(final Queue queue) throws JMSException { @@ -824,10 +690,7 @@ public QueueSender createSender(final Queue queue) throws JMSException { } /** - * Create a temporary queue - * - * @return The temporary queue - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public TemporaryQueue createTemporaryQueue() throws JMSException { @@ -854,11 +717,7 @@ public TemporaryQueue createTemporaryQueue() throws JMSException { } /** - * Create a message consumer - * - * @param destination The destination - * @return The message consumer - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public MessageConsumer createConsumer(final Destination destination) throws JMSException { @@ -882,12 +741,7 @@ public MessageConsumer createConsumer(final Destination destination) throws JMSE } /** - * Create a message consumer - * - * @param destination The destination - * @param messageSelector The message selector - * @return The message consumer - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public MessageConsumer createConsumer(final Destination destination, @@ -914,13 +768,7 @@ public MessageConsumer createConsumer(final Destination destination, } /** - * Create a message consumer - * - * @param destination The destination - * @param messageSelector The message selector - * @param noLocal If true inhibits the delivery of messages published by its own connection - * @return The message consumer - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public MessageConsumer createConsumer(final Destination destination, @@ -949,11 +797,7 @@ public MessageConsumer createConsumer(final Destination destination, } /** - * Create a message producer - * - * @param destination The destination - * @return The message producer - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public MessageProducer createProducer(final Destination destination) throws JMSException { @@ -977,10 +821,7 @@ public MessageProducer createProducer(final Destination destination) throws JMSE } /** - * Get the acknowledge mode - * - * @return The mode - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int getAcknowledgeMode() throws JMSException { @@ -991,7 +832,7 @@ public int getAcknowledgeMode() throws JMSException { } /** - * Get the XA resource + * {@inheritDoc} */ @Override public XAResource getXAResource() { @@ -1014,9 +855,7 @@ public XAResource getXAResource() { } /** - * Returns the ID of the Node that this session is associated with. - * - * @return Node ID + * {@return the ID of the Node that this session is associated with.} */ public String getNodeId() throws JMSException { ActiveMQSession session = (ActiveMQSession) getSessionInternal(); @@ -1025,10 +864,7 @@ public String getNodeId() throws JMSException { } /** - * Get the session - * - * @return The session - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Session getSession() throws JMSException { @@ -1048,10 +884,7 @@ public Session getSession() throws JMSException { } /** - * Get the queue session - * - * @return The queue session - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public QueueSession getQueueSession() throws JMSException { @@ -1071,10 +904,7 @@ public QueueSession getQueueSession() throws JMSException { } /** - * Get the topic session - * - * @return The topic session - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public TopicSession getTopicSession() throws JMSException { @@ -1242,11 +1072,6 @@ public MessageConsumer createSharedDurableConsumer(Topic topic, } } - /** - * Set the managed connection - * - * @param managedConnection The managed connection - */ void setManagedConnection(final ActiveMQRAManagedConnection managedConnection) { logger.trace("setManagedConnection({})", managedConnection); @@ -1264,20 +1089,12 @@ public ManagedConnection getManagedConnection() { return mc; } - /** - * Destroy - */ void destroy() { logger.trace("destroy()"); mc = null; } - /** - * Start - * - * @throws JMSException Thrown if an error occurs - */ void start() throws JMSException { logger.trace("start()"); @@ -1286,11 +1103,6 @@ void start() throws JMSException { } } - /** - * Stop - * - * @throws JMSException Thrown if an error occurs - */ void stop() throws JMSException { logger.trace("stop()"); @@ -1299,11 +1111,6 @@ void stop() throws JMSException { } } - /** - * Check strict - * - * @throws JMSException Thrown if an error occurs - */ void checkStrict() throws JMSException { logger.trace("checkStrict()"); @@ -1312,11 +1119,6 @@ void checkStrict() throws JMSException { } } - /** - * Close session - * - * @throws JMSException Thrown if an error occurs - */ void closeSession() throws JMSException { if (mc != null) { logger.trace("Closing session"); @@ -1359,11 +1161,6 @@ void closeSession() throws JMSException { } } - /** - * Add consumer - * - * @param consumer The consumer - */ void addConsumer(final MessageConsumer consumer) { logger.trace("addConsumer({})", consumer); @@ -1372,11 +1169,6 @@ void addConsumer(final MessageConsumer consumer) { } } - /** - * Remove consumer - * - * @param consumer The consumer - */ void removeConsumer(final MessageConsumer consumer) { logger.trace("removeConsumer({})", consumer); @@ -1385,11 +1177,6 @@ void removeConsumer(final MessageConsumer consumer) { } } - /** - * Add producer - * - * @param producer The producer - */ void addProducer(final MessageProducer producer) { logger.trace("addProducer({})", producer); @@ -1398,11 +1185,6 @@ void addProducer(final MessageProducer producer) { } } - /** - * Remove producer - * - * @param producer The producer - */ void removeProducer(final MessageProducer producer) { logger.trace("removeProducer({})", producer); @@ -1457,13 +1239,6 @@ XAResource getXAResourceInternal() throws JMSException { } } - /** - * Get the queue session - * - * @return The queue session - * @throws JMSException Thrown if an error occurs - * @throws IllegalStateException The session is closed - */ QueueSession getQueueSessionInternal() throws JMSException { Session s = getSessionInternal(); if (!(s instanceof QueueSession)) { @@ -1472,13 +1247,6 @@ QueueSession getQueueSessionInternal() throws JMSException { return (QueueSession) s; } - /** - * Get the topic session - * - * @return The topic session - * @throws JMSException Thrown if an error occurs - * @throws IllegalStateException The session is closed - */ TopicSession getTopicSessionInternal() throws JMSException { Session s = getSessionInternal(); if (!(s instanceof TopicSession)) { diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactory.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactory.java index b7b9308b688..bd697b51cb8 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactory.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactory.java @@ -23,7 +23,7 @@ import javax.jms.XATopicConnection; /** - * A joint interface for all connection types + * A joint interface for {@link XATopicConnection} and {@link XAQueueConnection}. */ public interface ActiveMQRASessionFactory extends XATopicConnection, XAQueueConnection { @@ -32,25 +32,9 @@ public interface ActiveMQRASessionFactory extends XATopicConnection, XAQueueConn */ String ISE = "This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6"; - /** - * Add a temporary queue - * - * @param temp The temporary queue - */ void addTemporaryQueue(TemporaryQueue temp); - /** - * Add a temporary topic - * - * @param temp The temporary topic - */ void addTemporaryTopic(TemporaryTopic temp); - /** - * Notification that a session is closed - * - * @param session The session - * @throws JMSException for any error - */ void closeSession(ActiveMQRASession session) throws JMSException; } 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 41ec7246ed0..26485ac81bc 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 @@ -59,75 +59,31 @@ public final class ActiveMQRASessionFactoryImpl extends ActiveMQConnectionForCon private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - /** - * Are we closed? - */ private boolean closed = false; - /** - * The naming reference - */ private Reference reference; - /** - * The user name - */ private String userName; - /** - * The password - */ private String password; - /** - * The client ID - */ private String clientID; - /** - * The connection type - */ private final int type; - /** - * Whether we are started - */ private boolean started = false; - /** - * The managed connection factory - */ private final ActiveMQRAManagedConnectionFactory mcf; private final TransactionSynchronizationRegistry tsr; - /** - * The connection manager - */ private ConnectionManager cm; - /** - * The sessions - */ private final Set sessions = new HashSet<>(); - /** - * The temporary queues - */ private final Set tempQueues = new HashSet<>(); - /** - * The temporary topics - */ private final Set tempTopics = new HashSet<>(); - /** - * Constructor - * - * @param mcf The managed connection factory - * @param cm The connection manager - * @param type The connection type - */ public ActiveMQRASessionFactoryImpl(final ActiveMQRAManagedConnectionFactory mcf, final ConnectionManager cm, final TransactionSynchronizationRegistry tsr, @@ -149,6 +105,9 @@ public ActiveMQRASessionFactoryImpl(final ActiveMQRAManagedConnectionFactory mcf } } + /** + * {@inheritDoc} + */ @Override public JMSContext createContext(int sessionMode) { boolean inJtaTx = inJtaTransaction(); @@ -176,6 +135,9 @@ public JMSContext createContext(int sessionMode) { return new ActiveMQRAJMSContext(this, sessionModeToUse, threadAwareContext); } + /** + * {@inheritDoc} + */ @Override public XAJMSContext createXAContext() { incrementRefCounter(); @@ -184,9 +146,7 @@ public XAJMSContext createXAContext() { } /** - * Set the naming reference - * - * @param reference The reference + * {@inheritDoc} */ @Override public void setReference(final Reference reference) { @@ -196,9 +156,7 @@ public void setReference(final Reference reference) { } /** - * Get the naming reference - * - * @return The reference + * {@inheritDoc} */ @Override public Reference getReference() { @@ -207,22 +165,12 @@ public Reference getReference() { return reference; } - /** - * Set the user name - * - * @param name The user name - */ public void setUserName(final String name) { logger.trace("setUserName({})", name); userName = name; } - /** - * Set the password - * - * @param password The password - */ public void setPassword(final String password) { logger.trace("setPassword(****)"); @@ -230,10 +178,7 @@ public void setPassword(final String password) { } /** - * Get the client ID - * - * @return The client ID - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public String getClientID() throws JMSException { @@ -249,10 +194,7 @@ public String getClientID() throws JMSException { } /** - * Set the client ID -- throws IllegalStateException - * - * @param cID The client ID - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setClientID(final String cID) throws JMSException { @@ -262,12 +204,7 @@ public void setClientID(final String cID) throws JMSException { } /** - * Create a queue session - * - * @param transacted Use transactions - * @param acknowledgeMode The acknowledge mode - * @return The queue session - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public QueueSession createQueueSession(final boolean transacted, final int acknowledgeMode) throws JMSException { @@ -285,10 +222,7 @@ public QueueSession createQueueSession(final boolean transacted, final int ackno } /** - * Create a XA queue session - * - * @return The XA queue session - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public XAQueueSession createXAQueueSession() throws JMSException { @@ -305,14 +239,7 @@ public XAQueueSession createXAQueueSession() throws JMSException { } /** - * Create a connection consumer -- throws IllegalStateException - * - * @param queue The queue - * @param messageSelector The message selector - * @param sessionPool The session pool - * @param maxMessages The number of max messages - * @return The connection consumer - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public ConnectionConsumer createConnectionConsumer(final Queue queue, @@ -327,12 +254,7 @@ public ConnectionConsumer createConnectionConsumer(final Queue queue, } /** - * Create a topic session - * - * @param transacted Use transactions - * @param acknowledgeMode The acknowledge mode - * @return The topic session - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public TopicSession createTopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException { @@ -350,10 +272,7 @@ public TopicSession createTopicSession(final boolean transacted, final int ackno } /** - * Create a XA topic session - * - * @return The XA topic session - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public XATopicSession createXATopicSession() throws JMSException { @@ -370,14 +289,7 @@ public XATopicSession createXATopicSession() throws JMSException { } /** - * Create a connection consumer -- throws IllegalStateException - * - * @param topic The topic - * @param messageSelector The message selector - * @param sessionPool The session pool - * @param maxMessages The number of max messages - * @return The connection consumer - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public ConnectionConsumer createConnectionConsumer(final Topic topic, @@ -392,15 +304,7 @@ public ConnectionConsumer createConnectionConsumer(final Topic topic, } /** - * Create a durable connection consumer -- throws IllegalStateException - * - * @param topic The topic - * @param subscriptionName The subscription name - * @param messageSelector The message selector - * @param sessionPool The session pool - * @param maxMessages The number of max messages - * @return The connection consumer - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public ConnectionConsumer createDurableConnectionConsumer(final Topic topic, @@ -416,15 +320,6 @@ public ConnectionConsumer createDurableConnectionConsumer(final Topic topic, throw new IllegalStateException(ISE); } - /** - * Create a connection consumer -- throws IllegalStateException - * - * @param destination The destination - * @param pool The session pool - * @param maxMessages The number of max messages - * @return The connection consumer - * @throws JMSException Thrown if an error occurs - */ public ConnectionConsumer createConnectionConsumer(final Destination destination, final ServerSessionPool pool, final int maxMessages) throws JMSException { @@ -436,14 +331,7 @@ public ConnectionConsumer createConnectionConsumer(final Destination destination } /** - * Create a connection consumer -- throws IllegalStateException - * - * @param destination The destination - * @param name The name - * @param pool The session pool - * @param maxMessages The number of max messages - * @return The connection consumer - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public ConnectionConsumer createConnectionConsumer(final Destination destination, @@ -458,12 +346,7 @@ public ConnectionConsumer createConnectionConsumer(final Destination destination } /** - * Create a session - * - * @param transacted Use transactions - * @param acknowledgeMode The acknowledge mode - * @return The session - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Session createSession(final boolean transacted, final int acknowledgeMode) throws JMSException { @@ -476,10 +359,7 @@ public Session createSession(final boolean transacted, final int acknowledgeMode } /** - * Create a XA session - * - * @return The XA session - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public XASession createXASession() throws JMSException { @@ -490,10 +370,7 @@ public XASession createXASession() throws JMSException { } /** - * Get the connection metadata - * - * @return The connection metadata - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public ConnectionMetaData getMetaData() throws JMSException { @@ -504,10 +381,7 @@ public ConnectionMetaData getMetaData() throws JMSException { } /** - * Get the exception listener -- throws IllegalStateException - * - * @return The exception listener - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public ExceptionListener getExceptionListener() throws JMSException { @@ -517,10 +391,7 @@ public ExceptionListener getExceptionListener() throws JMSException { } /** - * Set the exception listener -- throws IllegalStateException - * - * @param listener The exception listener - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setExceptionListener(final ExceptionListener listener) throws JMSException { @@ -530,9 +401,7 @@ public void setExceptionListener(final ExceptionListener listener) throws JMSExc } /** - * Start - * - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void start() throws JMSException { @@ -552,10 +421,7 @@ public void start() throws JMSException { } /** - * Stop - * - * @throws IllegalStateException - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void stop() throws JMSException { @@ -565,9 +431,7 @@ public void stop() throws JMSException { } /** - * Close - * - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void close() throws JMSException { @@ -619,10 +483,7 @@ public void close() throws JMSException { } /** - * Close session - * - * @param session The session - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void closeSession(final ActiveMQRASession session) throws JMSException { @@ -634,9 +495,7 @@ public void closeSession(final ActiveMQRASession session) throws JMSException { } /** - * Add temporary queue - * - * @param temp The temporary queue + * {@inheritDoc} */ @Override public void addTemporaryQueue(final TemporaryQueue temp) { @@ -648,9 +507,7 @@ public void addTemporaryQueue(final TemporaryQueue temp) { } /** - * Add temporary topic - * - * @param temp The temporary topic + * {@inheritDoc} */ @Override public void addTemporaryTopic(final TemporaryTopic temp) { @@ -699,26 +556,10 @@ public ConnectionConsumer createSharedDurableConnectionConsumer(Topic topic, throw new IllegalStateException(ISE); } - /** - * Allocation a connection - * - * @param sessionType The session type - * @return The session - * @throws JMSException Thrown if an error occurs - */ protected ActiveMQRASession allocateConnection(final int sessionType) throws JMSException { return allocateConnection(false, Session.AUTO_ACKNOWLEDGE, sessionType); } - /** - * Allocate a connection - * - * @param transacted Use transactions - * @param acknowledgeMode The acknowledge mode - * @param sessionType The session type - * @return The session - * @throws JMSException Thrown if an error occurs - */ protected ActiveMQRASession allocateConnection(boolean transacted, int acknowledgeMode, final int sessionType) throws JMSException { 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 f7f04925c43..8ddcfce7331 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 @@ -25,18 +25,12 @@ import java.lang.invoke.MethodHandles; /** - * A wrapper for a message + * A wrapper for a {@link StreamMessage}. */ public class ActiveMQRAStreamMessage extends ActiveMQRAMessage implements StreamMessage { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Create a new wrapper - * - * @param message the message - * @param session the session - */ public ActiveMQRAStreamMessage(final StreamMessage message, final ActiveMQRASession session) { super(message, session); @@ -44,10 +38,7 @@ public ActiveMQRAStreamMessage(final StreamMessage message, final ActiveMQRASess } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public boolean readBoolean() throws JMSException { @@ -57,10 +48,7 @@ public boolean readBoolean() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public byte readByte() throws JMSException { @@ -70,11 +58,7 @@ public byte readByte() throws JMSException { } /** - * Read - * - * @param value The value - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int readBytes(final byte[] value) throws JMSException { @@ -86,10 +70,7 @@ public int readBytes(final byte[] value) throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public char readChar() throws JMSException { @@ -99,10 +80,7 @@ public char readChar() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public double readDouble() throws JMSException { @@ -112,10 +90,7 @@ public double readDouble() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public float readFloat() throws JMSException { @@ -125,10 +100,7 @@ public float readFloat() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public int readInt() throws JMSException { @@ -138,10 +110,7 @@ public int readInt() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public long readLong() throws JMSException { @@ -151,10 +120,7 @@ public long readLong() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Object readObject() throws JMSException { @@ -164,10 +130,7 @@ public Object readObject() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public short readShort() throws JMSException { @@ -177,10 +140,7 @@ public short readShort() throws JMSException { } /** - * Read - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public String readString() throws JMSException { @@ -190,9 +150,7 @@ public String readString() throws JMSException { } /** - * Reset - * - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void reset() throws JMSException { @@ -202,10 +160,7 @@ public void reset() throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeBoolean(final boolean value) throws JMSException { @@ -217,10 +172,7 @@ public void writeBoolean(final boolean value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeByte(final byte value) throws JMSException { @@ -232,12 +184,7 @@ public void writeByte(final byte value) throws JMSException { } /** - * Write - * - * @param value The value - * @param offset The offset - * @param length The length - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeBytes(final byte[] value, final int offset, final int length) throws JMSException { @@ -249,10 +196,7 @@ public void writeBytes(final byte[] value, final int offset, final int length) t } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeBytes(final byte[] value) throws JMSException { @@ -264,10 +208,7 @@ public void writeBytes(final byte[] value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeChar(final char value) throws JMSException { @@ -279,10 +220,7 @@ public void writeChar(final char value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeDouble(final double value) throws JMSException { @@ -294,10 +232,7 @@ public void writeDouble(final double value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeFloat(final float value) throws JMSException { @@ -309,10 +244,7 @@ public void writeFloat(final float value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeInt(final int value) throws JMSException { @@ -324,10 +256,7 @@ public void writeInt(final int value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeLong(final long value) throws JMSException { @@ -339,10 +268,7 @@ public void writeLong(final long value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeObject(final Object value) throws JMSException { @@ -352,10 +278,7 @@ public void writeObject(final Object value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeShort(final short value) throws JMSException { @@ -367,10 +290,7 @@ public void writeShort(final short value) throws JMSException { } /** - * Write - * - * @param value The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void writeString(final String value) throws JMSException { 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 c049c2de4a5..a3b4b0171a4 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 @@ -24,18 +24,12 @@ import java.lang.invoke.MethodHandles; /** - * A wrapper for a message + * A wrapper for a {@link TextMessage}. */ public class ActiveMQRATextMessage extends ActiveMQRAMessage implements TextMessage { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Create a new wrapper - * - * @param message the message - * @param session the session - */ public ActiveMQRATextMessage(final TextMessage message, final ActiveMQRASession session) { super(message, session); @@ -43,10 +37,7 @@ public ActiveMQRATextMessage(final TextMessage message, final ActiveMQRASession } /** - * Get text - * - * @return The text - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public String getText() throws JMSException { @@ -56,10 +47,7 @@ public String getText() throws JMSException { } /** - * Set text - * - * @param string The text - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void setText(final String string) throws JMSException { 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 3f0eecdeb17..2867a9e1cf4 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 @@ -26,18 +26,12 @@ import java.lang.invoke.MethodHandles; /** - * ActiveMQQueueSender. + * A wrapper for a {@link TopicPublisher}. */ public class ActiveMQRATopicPublisher extends ActiveMQRAMessageProducer implements TopicPublisher { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Create a new wrapper - * - * @param producer the producer - * @param session the session - */ public ActiveMQRATopicPublisher(final TopicPublisher producer, final ActiveMQRASession session) { super(producer, session); @@ -45,10 +39,7 @@ public ActiveMQRATopicPublisher(final TopicPublisher producer, final ActiveMQRAS } /** - * Get the topic - * - * @return The topic - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Topic getTopic() throws JMSException { @@ -58,13 +49,7 @@ public Topic getTopic() throws JMSException { } /** - * Publish message - * - * @param message The message - * @param deliveryMode The delivery mode - * @param priority The priority - * @param timeToLive The time to live - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void publish(final Message message, @@ -89,10 +74,7 @@ public void publish(final Message message, } /** - * Publish message - * - * @param message The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void publish(final Message message) throws JMSException { @@ -111,14 +93,7 @@ public void publish(final Message message) throws JMSException { } /** - * Publish message - * - * @param destination The destination - * @param message The message - * @param deliveryMode The delivery mode - * @param priority The priority - * @param timeToLive The time to live - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void publish(final Topic destination, @@ -144,11 +119,7 @@ public void publish(final Topic destination, } /** - * Publish message - * - * @param destination The destination - * @param message The message - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public void publish(final Topic destination, final Message message) throws JMSException { 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 56418801c6b..05602e56449 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 @@ -25,18 +25,12 @@ import java.lang.invoke.MethodHandles; /** - * A wrapper for a topic subscriber + * A wrapper for a {@link TopicSubscriber}. */ public class ActiveMQRATopicSubscriber extends ActiveMQRAMessageConsumer implements TopicSubscriber { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Create a new wrapper - * - * @param consumer the topic subscriber - * @param session the session - */ public ActiveMQRATopicSubscriber(final TopicSubscriber consumer, final ActiveMQRASession session) { super(consumer, session); @@ -44,10 +38,7 @@ public ActiveMQRATopicSubscriber(final TopicSubscriber consumer, final ActiveMQR } /** - * Get the no local value - * - * @return The value - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public boolean getNoLocal() throws JMSException { @@ -58,10 +49,7 @@ public boolean getNoLocal() throws JMSException { } /** - * Get the topic - * - * @return The topic - * @throws JMSException Thrown if an error occurs + * {@inheritDoc} */ @Override public Topic getTopic() throws JMSException { 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 339bcca733d..dac5c074b36 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 @@ -34,22 +34,10 @@ public class ActiveMQRAXAResource implements ActiveMQXAResource { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * The managed connection - */ private final ActiveMQRAManagedConnection managedConnection; - /** - * The resource - */ private final XAResource xaResource; - /** - * Create a new ActiveMQXAResource. - * - * @param managedConnection the managed connection - * @param xaResource the xa resource - */ public ActiveMQRAXAResource(final ActiveMQRAManagedConnection managedConnection, final XAResource xaResource) { logger.trace("constructor({} ,{})", managedConnection, xaResource); @@ -132,7 +120,8 @@ public int prepare(final Xid xid) throws XAException { * Commit * * @param xid A global transaction identifier - * @param onePhase If true, the resource manager should use a one-phase commit protocol to commit the work done on behalf of xid. + * @param onePhase If {@code true}, the resource manager should use a one-phase commit protocol to commit the work + * done on behalf of xid. * @throws XAException An error has occurred */ @Override @@ -180,8 +169,9 @@ public void forget(final Xid xid) throws XAException { /** * IsSameRM * - * @param xaRes An XAResource object whose resource manager instance is to be compared with the resource manager instance of the target object. - * @return True if its the same RM instance; otherwise false. + * @param xaRes An XAResource object whose resource manager instance is to be compared with the resource manager + * instance of the target object. + * @return {@code true} if its the same RM instance; otherwise false * @throws XAException An error has occurred */ @Override @@ -224,7 +214,7 @@ public int getTransactionTimeout() throws XAException { * Set the transaction timeout * * @param seconds The number of seconds - * @return True if the transaction timeout value is set successfully; otherwise false. + * @return {@code true} if the transaction timeout value is set successfully; otherwise false * @throws XAException An error has occurred */ @Override 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 7ed284db043..e1bf0ad9621 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 @@ -39,9 +39,6 @@ public final class ActiveMQRaUtils { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * Private constructor - */ private ActiveMQRaUtils() { } @@ -50,7 +47,7 @@ private ActiveMQRaUtils() { * * @param me First value * @param you Second value - * @return True if object equals else false. + * @return {@code true} if object equals else false */ public static boolean compare(final String me, final String you) { return Objects.equals(me, you); @@ -61,7 +58,7 @@ public static boolean compare(final String me, final String you) { * * @param me First value * @param you Second value - * @return True if object equals else false. + * @return {@code true} if object equals else false */ public static boolean compare(final Integer me, final Integer you) { return Objects.equals(me, you); @@ -72,7 +69,7 @@ public static boolean compare(final Integer me, final Integer you) { * * @param me First value * @param you Second value - * @return True if object equals else false. + * @return {@code true} if object equals else false */ public static boolean compare(final Long me, final Long you) { return Objects.equals(me, you); @@ -83,7 +80,7 @@ public static boolean compare(final Long me, final Long you) { * * @param me First value * @param you Second value - * @return True if object equals else false. + * @return {@code true} if object equals else false */ public static boolean compare(final Double me, final Double you) { return Objects.equals(me, you); @@ -94,7 +91,7 @@ public static boolean compare(final Double me, final Double you) { * * @param me First value * @param you Second value - * @return True if object equals else false. + * @return {@code true} if object equals else false */ public static boolean compare(final Boolean me, final Boolean you) { return Objects.equals(me, you); @@ -116,7 +113,6 @@ public static Object lookup(final Context context, final String name, final Clas /** * Used on parsing JNDI Configuration * - * @param config * @return hash-table with configuration option pairs */ public static Hashtable parseHashtableConfig(final String config) { @@ -140,10 +136,10 @@ public static Hashtable parseHashtableConfig(final String config public static List> parseConfig(final String config) { List> result = new ArrayList<>(); - /** - * Some configuration values can contain commas (e.g. enabledProtocols, enabledCipherSuites, etc.). - * To support config values with commas, the commas in the values must be escaped (e.g. "\\,") so that - * the commas used to separate configs for different connectors can still function as designed. + /* + * Some configuration values can contain commas (e.g. enabledProtocols, enabledCipherSuites, etc.). To support + * config values with commas, the commas in the values must be escaped (e.g. "\\,") so that the commas used to + * separate configs for different connectors can still function as designed. */ String commaPlaceHolder = UUID.randomUUID().toString(); String replaced = config.replace("\\,", commaPlaceHolder); @@ -184,9 +180,9 @@ public static List parseConnectorConnectorConfig(String config) { } /** - * Within AS7 the RA is loaded by JCA. properties can only be passed in String form. However if - * RA is configured using jgroups stack, we need to pass a Channel object. As is impossible with - * JCA, we use this method to allow a JChannel object to be located. + * Within AS7 the RA is loaded by JCA. properties can only be passed in String form. However if RA is configured + * using jgroups stack, we need to pass a Channel object. As is impossible with JCA, we use this method to allow a + * JChannel object to be located. */ public static JChannel locateJGroupsChannel(final String locatorClass, final String name) { return AccessController.doPrivileged((PrivilegedAction) () -> { @@ -204,9 +200,9 @@ public static JChannel locateJGroupsChannel(final String locatorClass, final Str } /** - * This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a - * utility class, as it would be a door to load anything you like in a safe VM. - * For that reason any class trying to do a privileged block should do with the AccessController directly. + * This seems duplicate code all over the place, but for security reasons we can't let something like this to be open + * in a utility class, as it would be a door to load anything you like in a safe VM. For that reason any class trying + * to do a privileged block should do with the AccessController directly. */ private static Object safeInitNewInstance(final String className) { return AccessController.doPrivileged(new PrivilegedAction<>() { 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 c7887af4085..9535977e359 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 @@ -72,19 +72,10 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { private static final long serialVersionUID = 4756893709825838770L; - /** - * The Name of the product that this resource adapter represents. - */ public static final String PRODUCT_NAME = "ActiveMQ Artemis"; - /** - * The bootstrap context - */ private BootstrapContext ctx; - /** - * The resource adapter properties - */ private final ActiveMQRAProperties raProperties; /** @@ -97,14 +88,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { */ private String unparsedConnectors; - /** - * Have the factory been configured - */ private final AtomicBoolean configured; - /** - * The activations by activation spec - */ private final Map activations; private ActiveMQConnectionFactory defaultActiveMQConnectionFactory; @@ -134,9 +119,6 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable { */ private final Map> knownConnectionFactories = new HashMap<>(); - /** - * Constructor - */ public ActiveMQResourceAdapter() { logger.trace("constructor()"); @@ -151,11 +133,7 @@ public TransactionSynchronizationRegistry getTSR() { } /** - * Endpoint activation - * - * @param endpointFactory The endpoint factory - * @param spec The activation spec - * @throws ResourceException Thrown if an error occurs + * {@inheritDoc} */ @Override public void endpointActivation(final MessageEndpointFactory endpointFactory, @@ -179,10 +157,7 @@ public void endpointActivation(final MessageEndpointFactory endpointFactory, } /** - * Endpoint deactivation - * - * @param endpointFactory The endpoint factory - * @param spec The activation spec + * {@inheritDoc} */ @Override public void endpointDeactivation(final MessageEndpointFactory endpointFactory, final ActivationSpec spec) { @@ -195,11 +170,7 @@ public void endpointDeactivation(final MessageEndpointFactory endpointFactory, f } /** - * Get XA resources - * - * @param specs The activation specs - * @return The XA resources - * @throws ResourceException Thrown if an error occurs or unsupported + * {@inheritDoc} */ @Override public XAResource[] getXAResources(final ActivationSpec[] specs) throws ResourceException { @@ -223,10 +194,7 @@ public XAResource[] getXAResources(final ActivationSpec[] specs) throws Resource } /** - * Start - * - * @param ctx The bootstrap context - * @throws ResourceAdapterInternalException Thrown if an error occurs + * {@inheritDoc} */ @Override public void start(final BootstrapContext ctx) throws ResourceAdapterInternalException { @@ -250,7 +218,7 @@ public void start(final BootstrapContext ctx) throws ResourceAdapterInternalExce } /** - * Stop + * {@inheritDoc} */ @Override public void stop() { @@ -363,11 +331,6 @@ public void setEntries(String entries) { this.entries = entries; } - /** - * Get the discovery group name - * - * @return The value - */ public String getDiscoveryAddress() { logger.trace("getDiscoveryGroupAddress()"); @@ -390,261 +353,141 @@ public void setJgroupsChannelName(String jgroupsChannelName) { raProperties.setJgroupsChannelName(jgroupsChannelName); } - /** - * Set the discovery group name - * - * @param dgn The value - */ public void setDiscoveryAddress(final String dgn) { logger.trace("setDiscoveryGroupAddress({})", dgn); raProperties.setDiscoveryAddress(dgn); } - /** - * Get the discovery group port - * - * @return The value - */ public Integer getDiscoveryPort() { logger.trace("getDiscoveryGroupPort()"); return raProperties.getDiscoveryPort(); } - /** - * set the discovery local bind address - * - * @param discoveryLocalBindAddress the address value - */ public void setDiscoveryLocalBindAddress(final String discoveryLocalBindAddress) { logger.trace("setDiscoveryLocalBindAddress({})", discoveryLocalBindAddress); raProperties.setDiscoveryLocalBindAddress(discoveryLocalBindAddress); } - /** - * get the discovery local bind address - * - * @return the address value - */ public String getDiscoveryLocalBindAddress() { logger.trace("getDiscoveryLocalBindAddress()"); return raProperties.getDiscoveryLocalBindAddress(); } - /** - * Set the discovery group port - * - * @param dgp The value - */ public void setDiscoveryPort(final Integer dgp) { logger.trace("setDiscoveryGroupPort({})", dgp); raProperties.setDiscoveryPort(dgp); } - /** - * Get discovery refresh timeout - * - * @return The value - */ public Long getDiscoveryRefreshTimeout() { logger.trace("getDiscoveryRefreshTimeout()"); return raProperties.getDiscoveryRefreshTimeout(); } - /** - * Set discovery refresh timeout - * - * @param discoveryRefreshTimeout The value - */ public void setDiscoveryRefreshTimeout(final Long discoveryRefreshTimeout) { logger.trace("setDiscoveryRefreshTimeout({})", discoveryRefreshTimeout); raProperties.setDiscoveryRefreshTimeout(discoveryRefreshTimeout); } - /** - * Get discovery initial wait timeout - * - * @return The value - */ public Long getDiscoveryInitialWaitTimeout() { logger.trace("getDiscoveryInitialWaitTimeout()"); return raProperties.getDiscoveryInitialWaitTimeout(); } - /** - * Set discovery initial wait timeout - * - * @param discoveryInitialWaitTimeout The value - */ public void setDiscoveryInitialWaitTimeout(final Long discoveryInitialWaitTimeout) { logger.trace("setDiscoveryInitialWaitTimeout({})", discoveryInitialWaitTimeout); raProperties.setDiscoveryInitialWaitTimeout(discoveryInitialWaitTimeout); } - /** - * Get client failure check period - * - * @return The value - */ public Long getClientFailureCheckPeriod() { logger.trace("getClientFailureCheckPeriod()"); return raProperties.getClientFailureCheckPeriod(); } - /** - * Set client failure check period - * - * @param clientFailureCheckPeriod The value - */ public void setClientFailureCheckPeriod(final Long clientFailureCheckPeriod) { logger.trace("setClientFailureCheckPeriod({})", clientFailureCheckPeriod); raProperties.setClientFailureCheckPeriod(clientFailureCheckPeriod); } - /** - * Get connection TTL - * - * @return The value - */ public Long getConnectionTTL() { logger.trace("getConnectionTTL()"); return raProperties.getConnectionTTL(); } - /** - * Set connection TTL - * - * @param connectionTTL The value - */ public void setConnectionTTL(final Long connectionTTL) { logger.trace("setConnectionTTL({})", connectionTTL); raProperties.setConnectionTTL(connectionTTL); } - /** - * Get cacheLargeMessagesClient - * - * @return The value - */ public Boolean isCacheLargeMessagesClient() { logger.trace("isCacheLargeMessagesClient()"); return raProperties.isCacheLargeMessagesClient(); } - /** - * Set cacheLargeMessagesClient - * - * @param cacheLargeMessagesClient The value - */ public void setCacheLargeMessagesClient(final Boolean cacheLargeMessagesClient) { logger.trace("setCacheLargeMessagesClient({})", cacheLargeMessagesClient); raProperties.setCacheLargeMessagesClient(cacheLargeMessagesClient); } - /** - * Get compressLargeMessage - * - * @return The value - */ public Boolean isCompressLargeMessage() { logger.trace("isCompressLargeMessage()"); return raProperties.isCompressLargeMessage(); } - /** - * Set failoverOnInitialConnection - * - * @param failoverOnInitialConnection The value - */ @Deprecated public void setFailoverOnInitialConnection(final Boolean failoverOnInitialConnection) { } - /** - * Get isFailoverOnInitialConnection - * - * @return The value - */ @Deprecated public Boolean isFailoverOnInitialConnection() { return false; } - /** - * Set cacheDestinations - * - * @param cacheDestinations The value - */ public void setCacheDestinations(final Boolean cacheDestinations) { logger.trace("setCacheDestinations({})", cacheDestinations); raProperties.setCacheDestinations(cacheDestinations); } - /** - * Get isCacheDestinations - * - * @return The value - */ public Boolean isCacheDestinations() { logger.trace("isCacheDestinations()"); return raProperties.isCacheDestinations(); } - /** - * Set enable1xPrefixes - * - * @param enable1xPrefixes The value - */ public void setEnable1xPrefixes(final Boolean enable1xPrefixes) { logger.trace("setEnable1xPrefixes({})", enable1xPrefixes); raProperties.setEnable1xPrefixes(enable1xPrefixes); } - /** - * Get isCacheDestinations - * - * @return The value - */ public Boolean isEnable1xPrefixes() { logger.trace("isEnable1xPrefixes()"); return raProperties.isEnable1xPrefixes(); } - /** - * Set compressLargeMessage - * - * @param compressLargeMessage The value - */ public void setCompressLargeMessage(final Boolean compressLargeMessage) { logger.trace("setCompressLargeMessage({})", compressLargeMessage); raProperties.setCompressLargeMessage(compressLargeMessage); } - /** - * Get compressionLevel - * - * @return The value - */ public Integer getCompressionLevel() { logger.trace("getCompressionLevel()"); @@ -653,9 +496,8 @@ public Integer getCompressionLevel() { /** * Sets what compressionLevel to use when compressing messages - * Value must be -1 (default) or 0-9 * - * @param compressionLevel The value + * @param compressionLevel must be -1 (default) or 0-9 */ public void setCompressionLevel(final Integer compressionLevel) { logger.trace("setCompressionLevel({})", compressionLevel); @@ -663,176 +505,96 @@ public void setCompressionLevel(final Integer compressionLevel) { raProperties.setCompressionLevel(compressionLevel); } - /** - * Get call timeout - * - * @return The value - */ public Long getCallTimeout() { logger.trace("getCallTimeout()"); return raProperties.getCallTimeout(); } - /** - * Set call timeout - * - * @param callTimeout The value - */ public void setCallTimeout(final Long callTimeout) { logger.trace("setCallTimeout({})", callTimeout); raProperties.setCallTimeout(callTimeout); } - /** - * Get call failover timeout - * - * @return The value - */ public Long getCallFailoverTimeout() { logger.trace("getCallFailoverTimeout()"); return raProperties.getCallFailoverTimeout(); } - /** - * Set call failover timeout - * - * @param callFailoverTimeout The value - */ public void setCallFailoverTimeout(final Long callFailoverTimeout) { logger.trace("setCallFailoverTimeout({})", callFailoverTimeout); raProperties.setCallFailoverTimeout(callFailoverTimeout); } - /** - * Get dups ok batch size - * - * @return The value - */ public Integer getDupsOKBatchSize() { logger.trace("getDupsOKBatchSize()"); return raProperties.getDupsOKBatchSize(); } - /** - * Set dups ok batch size - * - * @param dupsOKBatchSize The value - */ public void setDupsOKBatchSize(final Integer dupsOKBatchSize) { logger.trace("setDupsOKBatchSize({})", dupsOKBatchSize); raProperties.setDupsOKBatchSize(dupsOKBatchSize); } - /** - * Get transaction batch size - * - * @return The value - */ public Integer getTransactionBatchSize() { logger.trace("getTransactionBatchSize()"); return raProperties.getTransactionBatchSize(); } - /** - * Set transaction batch size - * - * @param transactionBatchSize The value - */ public void setTransactionBatchSize(final Integer transactionBatchSize) { logger.trace("setTransactionBatchSize({})", transactionBatchSize); raProperties.setTransactionBatchSize(transactionBatchSize); } - /** - * Get consumer window size - * - * @return The value - */ public Integer getConsumerWindowSize() { logger.trace("getConsumerWindowSize()"); return raProperties.getConsumerWindowSize(); } - /** - * Set consumer window size - * - * @param consumerWindowSize The value - */ public void setConsumerWindowSize(final Integer consumerWindowSize) { logger.trace("setConsumerWindowSize({})", consumerWindowSize); raProperties.setConsumerWindowSize(consumerWindowSize); } - /** - * Get consumer max rate - * - * @return The value - */ public Integer getConsumerMaxRate() { logger.trace("getConsumerMaxRate()"); return raProperties.getConsumerMaxRate(); } - /** - * Set consumer max rate - * - * @param consumerMaxRate The value - */ public void setConsumerMaxRate(final Integer consumerMaxRate) { logger.trace("setConsumerMaxRate({})", consumerMaxRate); raProperties.setConsumerMaxRate(consumerMaxRate); } - /** - * Get confirmation window size - * - * @return The value - */ public Integer getConfirmationWindowSize() { logger.trace("getConfirmationWindowSize()"); return raProperties.getConfirmationWindowSize(); } - /** - * Set confirmation window size - * - * @param confirmationWindowSize The value - */ public void setConfirmationWindowSize(final Integer confirmationWindowSize) { logger.trace("setConfirmationWindowSize({})", confirmationWindowSize); raProperties.setConfirmationWindowSize(confirmationWindowSize); } - /** - * Get producer max rate - * - * @return The value - */ public Integer getProducerMaxRate() { logger.trace("getProducerMaxRate()"); return raProperties.getProducerMaxRate(); } - /** - * Set producer max rate - * - * @param producerMaxRate The value - */ public void setProducerMaxRate(final Integer producerMaxRate) { logger.trace("setProducerMaxRate({})", producerMaxRate); @@ -851,22 +613,12 @@ public Boolean isUseTopologyForLoadBalancing() { return raProperties.isUseTopologyForLoadBalancing(); } - /** - * Get producer window size - * - * @return The value - */ public Integer getProducerWindowSize() { logger.trace("getProducerWindowSize()"); return raProperties.getProducerWindowSize(); } - /** - * Set producer window size - * - * @param producerWindowSize The value - */ public void setProducerWindowSize(final Integer producerWindowSize) { logger.trace("setProducerWindowSize({})", producerWindowSize); @@ -937,264 +689,144 @@ public void setDeserializationAllowList(String deserializationAllowList) { raProperties.setDeserializationAllowList(deserializationAllowList); } - /** - * Get min large message size - * - * @return The value - */ public Integer getMinLargeMessageSize() { logger.trace("getMinLargeMessageSize()"); return raProperties.getMinLargeMessageSize(); } - /** - * Set min large message size - * - * @param minLargeMessageSize The value - */ public void setMinLargeMessageSize(final Integer minLargeMessageSize) { logger.trace("setMinLargeMessageSize({})", minLargeMessageSize); raProperties.setMinLargeMessageSize(minLargeMessageSize); } - /** - * Get block on acknowledge - * - * @return The value - */ public Boolean getBlockOnAcknowledge() { logger.trace("getBlockOnAcknowledge()"); return raProperties.isBlockOnAcknowledge(); } - /** - * Set block on acknowledge - * - * @param blockOnAcknowledge The value - */ public void setBlockOnAcknowledge(final Boolean blockOnAcknowledge) { logger.trace("setBlockOnAcknowledge({})", blockOnAcknowledge); raProperties.setBlockOnAcknowledge(blockOnAcknowledge); } - /** - * Get block on non durable send - * - * @return The value - */ public Boolean getBlockOnNonDurableSend() { logger.trace("getBlockOnNonDurableSend()"); return raProperties.isBlockOnNonDurableSend(); } - /** - * Set block on non durable send - * - * @param blockOnNonDurableSend The value - */ public void setBlockOnNonDurableSend(final Boolean blockOnNonDurableSend) { logger.trace("setBlockOnNonDurableSend({})", blockOnNonDurableSend); raProperties.setBlockOnNonDurableSend(blockOnNonDurableSend); } - /** - * Get block on durable send - * - * @return The value - */ public Boolean getBlockOnDurableSend() { logger.trace("getBlockOnDurableSend()"); return raProperties.isBlockOnDurableSend(); } - /** - * Set block on durable send - * - * @param blockOnDurableSend The value - */ public void setBlockOnDurableSend(final Boolean blockOnDurableSend) { logger.trace("setBlockOnDurableSend({})", blockOnDurableSend); raProperties.setBlockOnDurableSend(blockOnDurableSend); } - /** - * Get auto group - * - * @return The value - */ public Boolean getAutoGroup() { logger.trace("getAutoGroup()"); return raProperties.isAutoGroup(); } - /** - * Set auto group - * - * @param autoGroup The value - */ public void setAutoGroup(final Boolean autoGroup) { logger.trace("setAutoGroup({})", autoGroup); raProperties.setAutoGroup(autoGroup); } - /** - * Get pre acknowledge - * - * @return The value - */ public Boolean getPreAcknowledge() { logger.trace("getPreAcknowledge()"); return raProperties.isPreAcknowledge(); } - /** - * Set pre acknowledge - * - * @param preAcknowledge The value - */ public void setPreAcknowledge(final Boolean preAcknowledge) { logger.trace("setPreAcknowledge({})", preAcknowledge); raProperties.setPreAcknowledge(preAcknowledge); } - /** - * Get number of initial connect attempts - * - * @return The value - */ public Integer getInitialConnectAttempts() { logger.trace("getInitialConnectAttempts()"); return raProperties.getInitialConnectAttempts(); } - /** - * Set number of initial connect attempts - * - * @param initialConnectAttempts The value - */ public void setInitialConnectAttempts(final Integer initialConnectAttempts) { logger.trace("setInitialConnectionAttempts({})", initialConnectAttempts); raProperties.setInitialConnectAttempts(initialConnectAttempts); } - /** - * Get initial message packet size - * - * @return The value - */ public Integer getInitialMessagePacketSize() { logger.trace("getInitialMessagePacketSize()"); return raProperties.getInitialMessagePacketSize(); } - /** - * Set initial message packet size - * - * @param initialMessagePacketSize The value - */ public void setInitialMessagePacketSize(final Integer initialMessagePacketSize) { logger.trace("setInitialMessagePacketSize({})", initialMessagePacketSize); raProperties.setInitialMessagePacketSize(initialMessagePacketSize); } - /** - * Get retry interval - * - * @return The value - */ public Long getRetryInterval() { logger.trace("getRetryInterval()"); return raProperties.getRetryInterval(); } - /** - * Set retry interval - * - * @param retryInterval The value - */ public void setRetryInterval(final Long retryInterval) { logger.trace("setRetryInterval({})", retryInterval); raProperties.setRetryInterval(retryInterval); } - /** - * Get retry interval multiplier - * - * @return The value - */ public Double getRetryIntervalMultiplier() { logger.trace("getRetryIntervalMultiplier()"); return raProperties.getRetryIntervalMultiplier(); } - /** - * Set retry interval multiplier - * - * @param retryIntervalMultiplier The value - */ public void setRetryIntervalMultiplier(final Double retryIntervalMultiplier) { logger.trace("setRetryIntervalMultiplier({})", retryIntervalMultiplier); raProperties.setRetryIntervalMultiplier(retryIntervalMultiplier); } - /** - * Get maximum time for retry interval - * - * @return The value - */ public Long getMaxRetryInterval() { logger.trace("getMaxRetryInterval()"); return raProperties.getMaxRetryInterval(); } - /** - * Set maximum time for retry interval - * - * @param maxRetryInterval The value - */ public void setMaxRetryInterval(final Long maxRetryInterval) { logger.trace("setMaxRetryInterval({})", maxRetryInterval); raProperties.setMaxRetryInterval(maxRetryInterval); } - /** - * Get number of reconnect attempts - * - * @return The value - */ public Integer getReconnectAttempts() { logger.trace("getReconnectAttempts()"); return raProperties.getReconnectAttempts(); } - /** - * Set number of reconnect attempts - * - * @param reconnectAttempts The value - */ public void setReconnectAttempts(final Integer reconnectAttempts) { logger.trace("setReconnectAttempts({})", reconnectAttempts); @@ -1241,44 +873,24 @@ public void setUseGlobalPools(final Boolean useGlobalPools) { raProperties.setUseGlobalPools(useGlobalPools); } - /** - * Get the user name - * - * @return The value - */ public String getUserName() { logger.trace("getUserName()"); return raProperties.getUserName(); } - /** - * Set the user name - * - * @param userName The value - */ public void setUserName(final String userName) { logger.trace("setUserName({})", userName); raProperties.setUserName(userName); } - /** - * Get the password - * - * @return The value - */ public String getPassword() { logger.trace("getPassword()"); return raProperties.getPassword(); } - /** - * Set the password - * - * @param password The value - */ public void setPassword(final String password) { if (logger.isTraceEnabled()) { logger.trace("setPassword(****)"); @@ -1287,23 +899,14 @@ public void setPassword(final String password) { raProperties.setPassword(password); } - /** - * @return the useJNDI - */ public boolean isUseJNDI() { return raProperties.isUseJNDI(); } - /** - * @param value the useJNDI to set - */ public void setUseJNDI(final Boolean value) { raProperties.setUseJNDI(value); } - /** - * @return return the jndi params to use - */ public String getJndiParams() { return unparsedJndiParams; } @@ -1317,66 +920,36 @@ public void setJndiParams(String jndiParams) { return raProperties.getParsedJndiParams(); } - /** - * Get the client ID - * - * @return The value - */ public String getClientID() { logger.trace("getClientID()"); return raProperties.getClientID(); } - /** - * Set the client ID - * - * @param clientID The client id - */ public void setClientID(final String clientID) { logger.trace("setClientID({})", clientID); raProperties.setClientID(clientID); } - /** - * Get the group ID - * - * @return The value - */ public String getGroupID() { logger.trace("getGroupID()"); return raProperties.getGroupID(); } - /** - * Set the group ID - * - * @param groupID The group id - */ public void setGroupID(final String groupID) { logger.trace("setGroupID({})", groupID); raProperties.setGroupID(groupID); } - /** - * Get the use XA flag - * - * @return The value - */ public Boolean getUseLocalTx() { logger.trace("getUseLocalTx()"); return raProperties.getUseLocalTx(); } - /** - * Set the use XA flag - * - * @param localTx The value - */ public void setUseLocalTx(final Boolean localTx) { logger.trace("setUseXA({})", localTx); @@ -1407,12 +980,6 @@ public void setSetupInterval(Long interval) { raProperties.setSetupInterval(interval); } - /** - * Indicates whether some other object is "equal to" this one. - * - * @param obj Object with which to compare - * @return True if this object is the same as the obj argument; false otherwise. - */ @Override public boolean equals(final Object obj) { logger.trace("equals({})", obj); @@ -1427,11 +994,6 @@ public boolean equals(final Object obj) { return false; } - /** - * Return the hash code for the object - * - * @return The hash code - */ @Override public int hashCode() { logger.trace("hashCode()"); @@ -1439,11 +1001,6 @@ public int hashCode() { return raProperties.hashCode(); } - /** - * Get the work manager - * - * @return The manager - */ public WorkManager getWorkManager() { logger.trace("getWorkManager()"); @@ -1469,9 +1026,8 @@ public ClientSession createSession(final ClientSessionFactory parameterFactory, // if we are CMP or BMP using local tx we ignore the ack mode as we are transactional if (deliveryTransacted || useLocalTx) { - // JBPAPP-8845 - // If transacted we need to send the ack flush as soon as possible - // as if any transaction times out, we need the ack on the server already + // If transacted we need to send the ack flush as soon as possible as if any transaction times out, we need + // the ack on the server already if (useLocalTx) { result = parameterFactory.createSession(user, pass, false, false, false, false, 0); } else { @@ -1503,20 +1059,12 @@ public RecoveryManager getRecoveryManager() { return recoveryManager; } - /** - * Get the resource adapter properties - * - * @return The properties - */ public ActiveMQRAProperties getProperties() { logger.trace("getProperties()"); return raProperties; } - /** - * Setup the factory - */ protected void setup() throws ActiveMQException { raProperties.init(); defaultActiveMQConnectionFactory = newConnectionFactory(raProperties); @@ -1542,31 +1090,18 @@ public ActiveMQConnectionFactory getDefaultActiveMQConnectionFactory() throws Re return defaultActiveMQConnectionFactory; } - /** - * @see ActiveMQRAProperties#getJgroupsChannelLocatorClass() - */ public String getJgroupsChannelLocatorClass() { return raProperties.getJgroupsChannelLocatorClass(); } - /** - * @see ActiveMQRAProperties#setJgroupsChannelLocatorClass(String) - */ public void setJgroupsChannelLocatorClass(String jgroupsChannelLocatorClass) { raProperties.setJgroupsChannelLocatorClass(jgroupsChannelLocatorClass); } - /** - * @return - * @see ActiveMQRAProperties#getJgroupsChannelRefName() - */ public String getJgroupsChannelRefName() { return raProperties.getJgroupsChannelRefName(); } - /** - * @see ActiveMQRAProperties#setJgroupsChannelRefName(java.lang.String) - */ public void setJgroupsChannelRefName(String jgroupsChannelRefName) { raProperties.setJgroupsChannelRefName(jgroupsChannelRefName); } 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 61f9f4a9fe9..aa2ec98a2fa 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 @@ -132,9 +132,6 @@ public class ConnectionFactoryProperties implements ConnectionFactoryOptions { private Boolean enableSharedClientID; - /** - * @return the transportType - */ public List getParsedConnectorClassNames() { return connectorClassName; } @@ -728,9 +725,7 @@ public boolean isHasBeenUpdated() { return hasBeenUpdated; } - /* - * This is here just for backward compatibility and not used - * */ + // This is here just for backward compatibility and not used public void setEnableSharedClientID(boolean enable) { this.enableSharedClientID = enable; } 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 774a6761e3b..f1ff7f37e4c 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 @@ -68,46 +68,22 @@ import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; -/** - * The activation. - */ public class ActiveMQActivation { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * The onMessage method - */ public static final Method ONMESSAGE; - /** - * The resource adapter - */ private final ActiveMQResourceAdapter ra; - /** - * The activation spec - */ private final ActiveMQActivationSpec spec; - /** - * The message endpoint factory - */ private final MessageEndpointFactory endpointFactory; - /** - * Whether delivery is active - */ private final AtomicBoolean deliveryActive = new AtomicBoolean(false); - /** - * The destination type - */ private boolean isTopic = false; - /** - * Is the delivery transacted - */ private boolean isDeliveryTransacted; private ActiveMQDestination destination; @@ -177,55 +153,30 @@ public ActiveMQActivation(final ActiveMQResourceAdapter ra, } } - /** - * Get the activation spec - * - * @return The value - */ public ActiveMQActivationSpec getActivationSpec() { logger.trace("getActivationSpec()"); return spec; } - /** - * Get the message endpoint factory - * - * @return The value - */ public MessageEndpointFactory getMessageEndpointFactory() { logger.trace("getMessageEndpointFactory()"); return endpointFactory; } - /** - * Get whether delivery is transacted - * - * @return The value - */ public boolean isDeliveryTransacted() { logger.trace("isDeliveryTransacted()"); return isDeliveryTransacted; } - /** - * Get the work manager - * - * @return The value - */ public WorkManager getWorkManager() { logger.trace("getWorkManager()"); return ra.getWorkManager(); } - /** - * Is the destination a topic - * - * @return The value - */ public boolean isTopic() { logger.trace("isTopic()"); @@ -244,22 +195,16 @@ public void start() throws ResourceException { scheduleWork(new SetupActivation()); } - /** - * @return the topicTemporaryQueue - */ public SimpleString getTopicTemporaryQueue() { return topicTemporaryQueue; } - /** - * @param topicTemporaryQueue the topicTemporaryQueue to set - */ public void setTopicTemporaryQueue(SimpleString topicTemporaryQueue) { this.topicTemporaryQueue = topicTemporaryQueue; } /** - * @return the list of XAResources for this activation endpoint + * {@return the list of XAResources for this activation endpoint} */ public List getXAResources() { List xaresources = new ArrayList<>(); @@ -351,9 +296,6 @@ protected synchronized void setup() throws Exception { logger.debug("Setup complete {}", this); } - /** - * Teardown the activation - */ protected void teardown(boolean useInterrupt) { synchronized (teardownLock) { @@ -475,7 +417,6 @@ protected void setupCF() throws Exception { /** * Setup a session * - * @param cf * @return The connection * @throws Exception Thrown if an error occurs */ @@ -614,11 +555,6 @@ private String getQueueWithPrefix(String queue) { return spec.getQueuePrefix() + queue; } - /** - * Get a string representation - * - * @return The value - */ @Override public String toString() { StringBuilder buffer = new StringBuilder(); 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 e9cf16c395d..e9fa7fe6ac7 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 @@ -33,7 +33,6 @@ import org.slf4j.LoggerFactory; /** - * The activation spec * These properties are set on the MDB ActivationProperties */ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implements ActivationSpec, Serializable { @@ -52,44 +51,20 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen protected Boolean allowLocalTransactions; - /** - * The resource adapter - */ private ActiveMQResourceAdapter ra; - /** - * The connection factory lookup - */ private String connectionFactoryLookup; - /** - * The destination - */ private String destination; - /** - * The destination type - */ private String destinationType; - /** - * The message selector - */ private String messageSelector; - /** - * The acknowledgement mode - */ private Integer acknowledgeMode; - /** - * The subscription durability - */ private Boolean subscriptionDurability; - /** - * The subscription name - */ private String subscriptionName; /** @@ -97,29 +72,14 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen */ private Boolean shareSubscriptions = false; - /** - * The user - */ private String user; - /** - * The password - */ private String password; - /** - * The maximum number of sessions - */ private Integer maxSession; - /* - * Should we use a single connection for inbound - * */ private Boolean singleConnection = false; - /** - * Transaction timeout - */ @Deprecated(forRemoval = true) private Integer transactionTimeout; @@ -129,25 +89,30 @@ public class ActiveMQActivationSpec extends ConnectionFactoryProperties implemen private Hashtable parsedJndiParams; - /* use local tx instead of XA*/ + /** + * use local tx instead of XA + */ private Boolean localTx; - // undefined by default, default is specified at the RA level in ActiveMQRAProperties + /** + * undefined by default, default is specified at the RA level in ActiveMQRAProperties + */ private Integer setupAttempts; - // undefined by default, default is specified at the RA level in ActiveMQRAProperties + /** + * undefined by default, default is specified at the RA level in ActiveMQRAProperties + */ private Long setupInterval; private Boolean rebalanceConnections = false; - // Enables backwards compatibility of the pre 2.x addressing model + /** + * Enables backwards compatibility of the pre 2.x addressing model + */ private String topicPrefix; private String queuePrefix; - /** - * Constructor - */ public ActiveMQActivationSpec() { logger.trace("constructor()"); @@ -165,11 +130,6 @@ public ActiveMQActivationSpec() { transactionTimeout = 0; } - /** - * Get the resource adapter - * - * @return The resource adapter - */ @Override public ResourceAdapter getResourceAdapter() { logger.trace("getResourceAdapter()"); @@ -177,9 +137,6 @@ public ResourceAdapter getResourceAdapter() { return ra; } - /** - * @return the useJNDI - */ public Boolean isUseJNDI() { if (useJNDI == null) { return ra.isUseJNDI(); @@ -187,16 +144,10 @@ public Boolean isUseJNDI() { return useJNDI; } - /** - * @param value the useJNDI to set - */ public void setUseJNDI(final Boolean value) { useJNDI = value; } - /** - * @return return the jndi params to use - */ public String getJndiParams() { if (jndiParams == null) { return ra.getJndiParams(); @@ -216,12 +167,6 @@ public void setJndiParams(String jndiParams) { return parsedJndiParams; } - /** - * Set the resource adapter - * - * @param ra The resource adapter - * @throws ResourceException Thrown if incorrect resource adapter - */ @Override public void setResourceAdapter(final ResourceAdapter ra) throws ResourceException { logger.trace("setResourceAdapter({})", ra); @@ -233,118 +178,63 @@ public void setResourceAdapter(final ResourceAdapter ra) throws ResourceExceptio this.ra = (ActiveMQResourceAdapter) ra; } - /** - * Get the connection factory lookup - * - * @return The value - */ public String getConnectionFactoryLookup() { logger.trace("getConnectionFactoryLookup() ->{}", connectionFactoryLookup); return connectionFactoryLookup; } - /** - * Set the connection factory lookup - * - * @param value The value - */ public void setConnectionFactoryLookup(final String value) { logger.trace("setConnectionFactoryLookup({})", value); connectionFactoryLookup = value; } - /** - * Get the destination - * - * @return The value - */ public String getDestination() { logger.trace("getDestination()"); return destination; } - /** - * Set the destination - * - * @param value The value - */ public void setDestination(final String value) { logger.trace("setDestination({})", value); destination = value; } - /** - * Get the destination lookup - * - * @return The value - */ public String getDestinationLookup() { return getDestination(); } - /** - * Set the destination - * - * @param value The value - */ public void setDestinationLookup(final String value) { setDestination(value); setUseJNDI(true); } - /** - * Get the destination type - * - * @return The value - */ public String getDestinationType() { logger.trace("getDestinationType()"); return destinationType; } - /** - * Set the destination type - * - * @param value The value - */ public void setDestinationType(final String value) { logger.trace("setDestinationType({})", value); destinationType = value; } - /** - * Get the message selector - * - * @return The value - */ public String getMessageSelector() { logger.trace("getMessageSelector()"); return messageSelector; } - /** - * Set the message selector - * - * @param value The value - */ public void setMessageSelector(final String value) { logger.trace("setMessageSelector({})", value); messageSelector = value; } - /** - * Get the acknowledge mode - * - * @return The value - */ public String getAcknowledgeMode() { logger.trace("getAcknowledgeMode()"); @@ -355,7 +245,6 @@ public String getAcknowledgeMode() { } } - public void setQueuePrefix(String prefix) { this.queuePrefix = prefix; } @@ -372,11 +261,6 @@ public String getTopicPrefix() { return topicPrefix; } - /** - * Set the acknowledge mode - * - * @param value The value - */ public void setAcknowledgeMode(final String value) { logger.trace("setAcknowledgeMode({})", value); @@ -388,20 +272,12 @@ public void setAcknowledgeMode(final String value) { } } - /** - * @return the acknowledgement mode - */ public Integer getAcknowledgeModeInt() { logger.trace("getAcknowledgeMode()"); return acknowledgeMode; } - /** - * Get the subscription durability - * - * @return The value - */ public String getSubscriptionDurability() { logger.trace("getSubscriptionDurability()"); @@ -412,73 +288,42 @@ public String getSubscriptionDurability() { } } - /** - * Set the subscription durability - * - * @param value The value - */ public void setSubscriptionDurability(final String value) { logger.trace("setSubscriptionDurability({})", value); subscriptionDurability = "Durable".equals(value); } - /** - * Get the status of subscription durability - * - * @return The value - */ public Boolean isSubscriptionDurable() { logger.trace("isSubscriptionDurable()"); return subscriptionDurability; } - /** - * Get the subscription name - * - * @return The value - */ public String getSubscriptionName() { logger.trace("getSubscriptionName()"); return subscriptionName; } - /** - * Set the subscription name - * - * @param value The value - */ public void setSubscriptionName(final String value) { logger.trace("setSubscriptionName({})", value); subscriptionName = value; } - /** - * @return the shareDurableSubscriptions - */ public Boolean isShareSubscriptions() { logger.trace("isShareSubscriptions() = {}", shareSubscriptions); return shareSubscriptions; } - /** - * @param shareSubscriptions the shareDurableSubscriptions to set - */ public void setShareSubscriptions(final Boolean shareSubscriptions) { logger.trace("setShareSubscriptions({})", shareSubscriptions); this.shareSubscriptions = shareSubscriptions; } - /** - * Get the user - * - * @return The value - */ public String getUser() { logger.trace("getUser()"); @@ -489,22 +334,12 @@ public String getUser() { } } - /** - * Set the user - * - * @param value The value - */ public void setUser(final String value) { logger.trace("setUser()", value); user = value; } - /** - * Get the userName - * - * @return The value - */ public String getUserName() { if (logger.isTraceEnabled()) { logger.trace("getUserName()"); @@ -517,11 +352,6 @@ public String getUserName() { } } - /** - * Set the user - * - * @param value The value - */ public void setUserName(final String value) { if (logger.isTraceEnabled()) { logger.trace("setUserName(" + value + ")"); @@ -530,11 +360,6 @@ public void setUserName(final String value) { user = value; } - /** - * Get the password - * - * @return The value - */ public String getPassword() { logger.trace("getPassword()"); @@ -549,22 +374,12 @@ public String getOwnPassword() { return password; } - /** - * Set the password - * - * @param value The value - */ public void setPassword(final String value) throws Exception { logger.trace("setPassword(****)"); password = value; } - /** - * Get the number of max session - * - * @return The value - */ public Integer getMaxSession() { logger.trace("getMaxSession()"); @@ -575,11 +390,6 @@ public Integer getMaxSession() { return maxSession; } - /** - * Set the number of max session - * - * @param value The value - */ public void setMaxSession(final Integer value) { logger.trace("setMaxSession({})", value); @@ -590,11 +400,6 @@ public void setMaxSession(final Integer value) { maxSession = value; } - /** - * Get the number of max session - * - * @return The value - */ public Boolean isSingleConnection() { logger.trace("getSingleConnection()"); @@ -605,22 +410,12 @@ public Boolean isSingleConnection() { return singleConnection; } - /** - * Set the number of max session - * - * @param value The value - */ public void setSingleConnection(final Boolean value) { logger.trace("setSingleConnection({})", value); singleConnection = value; } - /** - * Get the transaction timeout - * - * @return The value - */ @Deprecated(forRemoval = true) public Integer getTransactionTimeout() { logger.trace("getTransactionTimeout()"); @@ -628,11 +423,6 @@ public Integer getTransactionTimeout() { return transactionTimeout; } - /** - * Set the transaction timeout - * - * @param value The value - */ @Deprecated(forRemoval = true) public void setTransactionTimeout(final Integer value) { logger.trace("setTransactionTimeout({})", value); @@ -725,9 +515,6 @@ public void setConnectorClassName(final String connectorClassName) { setParsedConnectorClassNames(ActiveMQRaUtils.parseConnectorConnectorConfig(connectorClassName)); } - /** - * @return the connectionParameters - */ public String getConnectionParameters() { return strConnectionParameters; } @@ -737,11 +524,6 @@ public void setConnectionParameters(final String configuration) { setParsedConnectionParameters(ActiveMQRaUtils.parseConfig(configuration)); } - /** - * Get a string representation - * - * @return The value - */ @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -786,15 +568,9 @@ public void setDLQMaxResent(final Integer maxResent) { public void setProviderAdapterJNDI(final String jndi) { } - /** - * @param keepAlive the keepAlive to set - */ public void setKeepAlive(Boolean keepAlive) { } - /** - * @param keepAliveMillis the keepAliveMillis to set - */ public void setKeepAliveMillis(Long keepAliveMillis) { } 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 408c90ac450..508df0a39d8 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 @@ -59,23 +59,14 @@ import javax.transaction.SystemException; import javax.transaction.TransactionManager; -/** - * The message handler - */ public class ActiveMQMessageHandler implements MessageHandler, FailoverEventListener { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * The session - */ private final ClientSessionInternal session; private ClientConsumerInternal consumer; - /** - * The endpoint - */ private MessageEndpoint endpoint; private final ConnectionFactoryOptions options; diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/referenceable/ActiveMQRAConnectionFactoryObjectFactory.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/referenceable/ActiveMQRAConnectionFactoryObjectFactory.java index ab4e99d1941..3b934ae2b57 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/referenceable/ActiveMQRAConnectionFactoryObjectFactory.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/referenceable/ActiveMQRAConnectionFactoryObjectFactory.java @@ -24,7 +24,7 @@ /** * A ConnectionFactoryObjectFactory. - * + *

            * Given a reference - reconstructs an ActiveMQRAConnectionFactory */ public class ActiveMQRAConnectionFactoryObjectFactory implements ObjectFactory { diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/referenceable/SerializableObjectRefAddr.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/referenceable/SerializableObjectRefAddr.java index b4fce9fcd4c..539b7b22f64 100644 --- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/referenceable/SerializableObjectRefAddr.java +++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/referenceable/SerializableObjectRefAddr.java @@ -26,9 +26,9 @@ /** * A SerializableObjectRefAddr. - * + *

            * A RefAddr that can be used for any serializable object. - * + *

            * Basically the address is the serialized form of the object as a byte[] */ public class SerializableObjectRefAddr extends RefAddr { diff --git a/artemis-selector/pom.xml b/artemis-selector/pom.xml index b37784b55e1..a276a83138a 100644 --- a/artemis-selector/pom.xml +++ b/artemis-selector/pom.xml @@ -68,6 +68,24 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + + compile + + check + + + + + + ${project.build.sourceDirectory} + ${project.build.testSourceDirectory} + + + org.codehaus.mojo javacc-maven-plugin diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ArithmeticExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ArithmeticExpression.java index 81398648408..f63d034b5d7 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ArithmeticExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ArithmeticExpression.java @@ -18,8 +18,6 @@ /** * An expression which performs an operation on two expression values - * - * @version $Revision: 1.2 $ */ public abstract class ArithmeticExpression extends BinaryExpression { @@ -28,10 +26,6 @@ public abstract class ArithmeticExpression extends BinaryExpression { protected static final int DOUBLE = 3; boolean convertStringExpressions = false; - /** - * @param left - * @param right - */ public ArithmeticExpression(Expression left, Expression right) { super(left, right); convertStringExpressions = ComparisonExpression.CONVERT_STRING_EXPRESSIONS.get() != null; @@ -192,11 +186,6 @@ public Object evaluate(Filterable message) throws FilterException { return evaluate(lvalue, rvalue); } - /** - * @param lvalue - * @param rvalue - * @return - */ protected abstract Object evaluate(Object lvalue, Object rvalue); } diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/BinaryExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/BinaryExpression.java index 66eb559cf22..ba3c65adf3e 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/BinaryExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/BinaryExpression.java @@ -18,8 +18,6 @@ /** * An expression which performs an operation on two expression values. - * - * @version $Revision: 1.2 $ */ public abstract class BinaryExpression implements Expression { @@ -39,17 +37,11 @@ public Expression getRight() { return right; } - /** - * @see java.lang.Object#toString() - */ @Override public String toString() { return "(" + left.toString() + " " + getExpressionSymbol() + " " + right.toString() + ")"; } - /** - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { int result = left.hashCode(); @@ -58,9 +50,6 @@ public int hashCode() { return result; } - /** - * @see java.lang.Object#equals(java.lang.Object) - */ @Override public boolean equals(Object o) { if (this == o) { @@ -89,23 +78,14 @@ public boolean equals(Object o) { } /** - * Returns the symbol that represents this binary expression. For example, addition is - * represented by "+" - * - * @return + * {@return the symbol that represents this binary expression. For example, addition is represented by {@code +}} */ public abstract String getExpressionSymbol(); - /** - * @param expression - */ public void setRight(Expression expression) { right = expression; } - /** - * @param expression - */ public void setLeft(Expression expression) { left = expression; } diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/BooleanExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/BooleanExpression.java index 220850b951a..e7415847a4c 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/BooleanExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/BooleanExpression.java @@ -17,17 +17,12 @@ package org.apache.activemq.artemis.selector.filter; /** - * A BooleanExpression is an expression that always - * produces a Boolean result. - * - * @version $Revision: 1.2 $ + * An expression that always produces a {@code Boolean} result. */ public interface BooleanExpression extends Expression { /** - * @param message - * @return true if the expression evaluates to Boolean.TRUE. - * @throws FilterException + * {@return {@code true} if the expression evaluates to {@code Boolean.TRUE}} */ boolean matches(Filterable message) throws FilterException; diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ComparisonExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ComparisonExpression.java index b111f06249c..f5e78644085 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ComparisonExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ComparisonExpression.java @@ -23,8 +23,6 @@ /** * A filter performing a comparison of two objects - * - * @version $Revision: 1.2 $ */ public abstract class ComparisonExpression extends BinaryExpression implements BooleanExpression { @@ -33,10 +31,6 @@ public abstract class ComparisonExpression extends BinaryExpression implements B boolean convertStringExpressions = false; private static final Set REGEXP_CONTROL_CHARS = new HashSet<>(); - /** - * @param left - * @param right - */ public ComparisonExpression(Expression left, Expression right) { super(left, right); convertStringExpressions = CONVERT_STRING_EXPRESSIONS.get() != null; @@ -77,8 +71,6 @@ static class LikeExpression extends UnaryExpression implements BooleanExpression Pattern likePattern; - /** - */ LikeExpression(Expression right, String like, int escape) { super(right); @@ -341,8 +333,6 @@ public String getExpressionSymbol() { /** * Only Numeric expressions can be used in {@code >}, {@code >=}, {@code <} or {@code <=} expressions. - * - * @param expr */ public static void checkLessThanOperand(Expression expr) { if (expr instanceof ConstantExpression constantExpression) { @@ -360,10 +350,8 @@ public static void checkLessThanOperand(Expression expr) { } /** - * Validates that the expression can be used in {@code ==} or {@code <>} expression. Cannot - * not be NULL TRUE or FALSE literals. - * - * @param expr + * Validates that the expression can be used in {@code ==} or {@code <>} expression. Cannot not be NULL TRUE or FALSE + * literals. */ public static void checkEqualOperand(Expression expr) { if (expr instanceof ConstantExpression constantExpression) { @@ -374,10 +362,6 @@ public static void checkEqualOperand(Expression expr) { } } - /** - * @param left - * @param right - */ private static void checkEqualOperandCompatibility(Expression left, Expression right) { if (left instanceof ConstantExpression && right instanceof ConstantExpression) { if (left instanceof BooleanExpression && !(right instanceof BooleanExpression)) { diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ConstantExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ConstantExpression.java index fa616ecbc4a..602a50dea40 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ConstantExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ConstantExpression.java @@ -20,8 +20,6 @@ /** * Represents a constant expression - * - * @version $Revision: 1.2 $ */ public class ConstantExpression implements Expression { @@ -102,9 +100,6 @@ public Object getValue() { return value; } - /** - * @see java.lang.Object#toString() - */ @Override public String toString() { if (value == null) { @@ -119,17 +114,11 @@ public String toString() { return value.toString(); } - /** - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { return value != null ? value.hashCode() : 0; } - /** - * @see java.lang.Object#equals(Object) - */ @Override public boolean equals(final Object o) { if (this == o) { @@ -146,11 +135,7 @@ public boolean equals(final Object o) { } /** - * Encodes the value of string so that it looks like it would look like when - * it was provided in a selector. - * - * @param s - * @return + * Encodes the value of string so that it looks like it would look like when it was provided in a selector. */ public static String encodeString(String s) { StringBuilder b = new StringBuilder(); diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/Expression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/Expression.java index a8a09a7faf2..333a7f2886e 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/Expression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/Expression.java @@ -18,13 +18,11 @@ /** * Represents an expression - * - * @version $Revision: 1.2 $ */ public interface Expression { /** - * @return the value of this expression + * {@return the value of this expression} */ Object evaluate(Filterable message) throws FilterException; diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/Filterable.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/Filterable.java index 4ac7620ef92..d63930db489 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/Filterable.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/Filterable.java @@ -19,36 +19,24 @@ import org.apache.activemq.artemis.api.core.SimpleString; /** - * A Filterable is the object being evaluated by the filters. It provides - * access to filtered properties. - * - * @version $Revision: 1.4 $ + * A Filterable is the object being evaluated by the filters. It provides access to filtered properties. */ public interface Filterable { /** - * This method is used by message filters which do content based routing (Like the XPath - * based selectors). - * - * @param - * @param type - * @return - * @throws FilterException + * This method is used by message filters which do content based routing (Like the XPath based selectors). */ T getBodyAs(Class type) throws FilterException; /** * Extracts the named message property - * - * @param name - * @return */ Object getProperty(SimpleString name); /** * Used by the NoLocal filter. * - * @return a unique id for the connection that produced the message. + * @return a unique id for the connection that produced the message */ Object getLocalConnectionId(); diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/LogicExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/LogicExpression.java index 386f7bcab7d..dc641a5efc3 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/LogicExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/LogicExpression.java @@ -21,7 +21,6 @@ /** * A sequence of expressions, to be combined with OR or AND conjunctions. - * */ public abstract class LogicExpression implements BooleanExpression { @@ -51,10 +50,7 @@ public BooleanExpression getRight() { } /** - * Returns the symbol that represents this binary expression. For example, addition is - * represented by "+" - * - * @return + * {@return the symbol that represents this binary expression. For example, addition is represented by "+"} */ public abstract String getExpressionSymbol(); diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/PropertyExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/PropertyExpression.java index cb49be42549..f76c0cf7418 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/PropertyExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/PropertyExpression.java @@ -20,8 +20,6 @@ /** * Represents a property expression - * - * @version $Revision: 1.5 $ */ public class PropertyExpression implements Expression { @@ -44,25 +42,16 @@ public String getName() { return name.toString(); } - /** - * @see java.lang.Object#toString() - */ @Override public String toString() { return name.toString(); } - /** - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { return name.hashCode(); } - /** - * @see java.lang.Object#equals(java.lang.Object) - */ @Override public boolean equals(Object o) { if (o == null || !this.getClass().equals(o.getClass())) { diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java index 9f190bc43b9..64aef228019 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java @@ -23,8 +23,6 @@ /** * An expression which performs an operation on two expression values - * - * @version $Revision: 1.3 $ */ public abstract class UnaryExpression implements Expression { @@ -228,17 +226,11 @@ public void setRight(Expression expression) { right = expression; } - /** - * @see java.lang.Object#toString() - */ @Override public String toString() { return "(" + getExpressionSymbol() + " " + right.toString() + ")"; } - /** - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { int result = right.hashCode(); @@ -246,9 +238,6 @@ public int hashCode() { return result; } - /** - * @see java.lang.Object#equals(java.lang.Object) - */ @Override public boolean equals(Object o) { if (this == o) { @@ -273,10 +262,7 @@ public boolean equals(Object o) { } /** - * Returns the symbol that represents this binary expression. For example, - * addition is represented by "+" - * - * @return + * {@return the symbol that represents this binary expression, e.g. addition is represented by "+"} */ public abstract String getExpressionSymbol(); diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/XPathExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/XPathExpression.java index 200466f6cdc..c2c53ab78ea 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/XPathExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/XPathExpression.java @@ -84,9 +84,7 @@ public String toString() { } /** - * @param message - * @return true if the expression evaluates to Boolean.TRUE. - * @throws FilterException + * {@return true if the expression evaluates to Boolean.TRUE} */ @Override public boolean matches(Filterable message) throws FilterException { diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/XQueryExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/XQueryExpression.java index 3621f121621..075a3dba145 100755 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/XQueryExpression.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/XQueryExpression.java @@ -39,9 +39,7 @@ public String toString() { } /** - * @param message - * @return true if the expression evaluates to Boolean.TRUE. - * @throws FilterException + * @return true if the expression evaluates to Boolean.TRUE */ @Override public boolean matches(Filterable message) throws FilterException { diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/impl/LRUCache.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/impl/LRUCache.java index 9e6a9d50e6e..16fdbc1c18a 100644 --- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/impl/LRUCache.java +++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/impl/LRUCache.java @@ -21,11 +21,7 @@ /** * A Simple LRU Cache - * - * @param - * @param */ - public class LRUCache extends LinkedHashMap { private static final long serialVersionUID = -342098639681884413L; @@ -40,41 +36,29 @@ public LRUCache() { /** * Constructs a LRUCache with a maximum capacity - * - * @param maximumCacheSize */ public LRUCache(int maximumCacheSize) { this(0, maximumCacheSize, 0.75f, true); } /** - * Constructs an empty LRUCache instance with the specified - * initial capacity, maximumCacheSize,load factor and ordering mode. + * Constructs an empty {@code LRUCache} instance with the specified initial capacity, maximumCacheSize,load factor + * and ordering mode. * - * @param initialCapacity the initial capacity. - * @param maximumCacheSize - * @param loadFactor the load factor. - * @param accessOrder the ordering mode - true for access-order, - * false for insertion-order. - * @throws IllegalArgumentException if the initial capacity is negative or - * the load factor is non-positive. + * @param initialCapacity the initial capacity. + * @param loadFactor the load factor. + * @param accessOrder the ordering mode - {@code true} for access-order, {@code false} for insertion-order. + * @throws IllegalArgumentException if the initial capacity is negative or the load factor is non-positive. */ - public LRUCache(int initialCapacity, int maximumCacheSize, float loadFactor, boolean accessOrder) { super(initialCapacity, loadFactor, accessOrder); this.maxCacheSize = maximumCacheSize; } - /** - * @return Returns the maxCacheSize. - */ public int getMaxCacheSize() { return maxCacheSize; } - /** - * @param maxCacheSize The maxCacheSize to set. - */ public void setMaxCacheSize(int maxCacheSize) { this.maxCacheSize = maxCacheSize; } diff --git a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java index d260298b379..4e693edb059 100755 --- a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java +++ b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java @@ -264,9 +264,6 @@ public void testLike() throws Exception { assertSelector(message, "modelClassId LIKE 'com.whatever.something.%' AND modelInstanceId = '170' AND (modelRequestError IS NULL OR modelCorrelatedClientId = 'whatever')", true); } - /** - * Test cases from Mats Henricson - */ @Test public void testMatsHenricsonUseCases() throws Exception { MockMessage message = createMessage(); diff --git a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/UnknownHandlingSelectorTest.java b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/UnknownHandlingSelectorTest.java index 4af8ca19ca9..75a3fbb5c8a 100644 --- a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/UnknownHandlingSelectorTest.java +++ b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/UnknownHandlingSelectorTest.java @@ -40,7 +40,7 @@ public void setUp() throws Exception { message.setObjectProperty("nullProp", null); } - /** + /* * | NOT * +------+------ * | T | F @@ -55,7 +55,7 @@ public void notEvaluation() throws Exception { assertSelector("not(unknownProp)", false); } - /** + /* * | AND | T | F | U * +------+-------+-------+------- * | T | T | F | U @@ -76,7 +76,7 @@ public void andEvaluation() throws Exception { assertSelectorEvaluatesToUnknown("unknownProp AND unknownProp"); } - /** + /* * | OR | T | F | U * +------+-------+-------+-------- * | T | T | T | T diff --git a/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/ProtocolTracker.java b/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/ProtocolTracker.java index 5161640d82f..5fb1de5c41c 100644 --- a/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/ProtocolTracker.java +++ b/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/ProtocolTracker.java @@ -30,10 +30,9 @@ import org.osgi.util.tracker.ServiceTrackerCustomizer; /** - * Tracks the available ProtocolManagerFactory services as well as the required protocols. - * When a new service appears the factory is added to the server. - * When all needed protocols are present the server is started. - * When required a service disappears the server is stopped. + * Tracks the available ProtocolManagerFactory services as well as the required protocols. When a new service appears + * the factory is added to the server. When all needed protocols are present the server is started. When required a + * service disappears the server is stopped. */ @SuppressWarnings("rawtypes") public class ProtocolTracker implements ServiceTrackerCustomizer, ProtocolManagerFactory> { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/BridgeConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/BridgeConfiguration.java index 6a303ba25b2..04496596e6f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/BridgeConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/BridgeConfiguration.java @@ -204,7 +204,7 @@ public BridgeConfiguration(String name) { * example, if you pass the value "TRUE" for the key "auto-created" the {@code String} "TRUE" will be converted to * the {@code Boolean} {@code true}. * - * @param key the key to set to the value + * @param key the key to set to the value * @param value the value to set for the key * @return this {@code BridgeConfiguration} */ @@ -284,7 +284,10 @@ public String getName() { } /** - * @param name the name to set + * Sets the name of this {@code BridgeConfiguration}. If the {@code parentName} is {@code null} then it is also set. + * + * @param name the name to use + * @return this {@code BridgeConfiguration} */ public BridgeConfiguration setName(final String name) { this.name = name; @@ -307,17 +310,11 @@ public String getQueueName() { return queueName; } - /** - * @param queueName the queueName to set - */ public BridgeConfiguration setQueueName(final String queueName) { this.queueName = queueName; return this; } - /** - * @return the connectionTTL - */ public long getConnectionTTL() { return connectionTTL; } @@ -327,9 +324,6 @@ public BridgeConfiguration setConnectionTTL(long connectionTTL) { return this; } - /** - * @return the maxRetryInterval - */ public long getMaxRetryInterval() { return maxRetryInterval; } @@ -343,9 +337,6 @@ public String getForwardingAddress() { return forwardingAddress; } - /** - * @param forwardingAddress the forwardingAddress to set - */ public BridgeConfiguration setForwardingAddress(final String forwardingAddress) { this.forwardingAddress = forwardingAddress; return this; @@ -355,9 +346,6 @@ public String getFilterString() { return filterString; } - /** - * @param filterString the filterString to set - */ public BridgeConfiguration setFilterString(final String filterString) { this.filterString = filterString; return this; @@ -367,9 +355,6 @@ public TransformerConfiguration getTransformerConfiguration() { return transformerConfiguration; } - /** - * @param transformerConfiguration the transformerConfiguration to set - */ public BridgeConfiguration setTransformerConfiguration(final TransformerConfiguration transformerConfiguration) { this.transformerConfiguration = transformerConfiguration; return this; @@ -379,9 +364,6 @@ public List getStaticConnectors() { return staticConnectors; } - /** - * @param staticConnectors the staticConnectors to set - */ public BridgeConfiguration setStaticConnectors(final List staticConnectors) { this.staticConnectors = staticConnectors; return this; @@ -391,9 +373,6 @@ public String getDiscoveryGroupName() { return discoveryGroupName; } - /** - * @param discoveryGroupName the discoveryGroupName to set - */ public BridgeConfiguration setDiscoveryGroupName(final String discoveryGroupName) { this.discoveryGroupName = discoveryGroupName; return this; @@ -403,9 +382,6 @@ public boolean isHA() { return ha; } - /** - * @param ha is the bridge supporting HA? - */ public BridgeConfiguration setHA(final boolean ha) { this.ha = ha; return this; @@ -415,9 +391,6 @@ public long getRetryInterval() { return retryInterval; } - /** - * @param retryInterval the retryInterval to set - */ public BridgeConfiguration setRetryInterval(final long retryInterval) { this.retryInterval = retryInterval; return this; @@ -427,9 +400,6 @@ public double getRetryIntervalMultiplier() { return retryIntervalMultiplier; } - /** - * @param retryIntervalMultiplier the retryIntervalMultiplier to set - */ public BridgeConfiguration setRetryIntervalMultiplier(final double retryIntervalMultiplier) { this.retryIntervalMultiplier = retryIntervalMultiplier; return this; @@ -439,9 +409,6 @@ public int getInitialConnectAttempts() { return initialConnectAttempts; } - /** - * @param initialConnectAttempts the initialConnectAttempts to set - */ public BridgeConfiguration setInitialConnectAttempts(final int initialConnectAttempts) { this.initialConnectAttempts = initialConnectAttempts; return this; @@ -451,9 +418,6 @@ public int getReconnectAttempts() { return reconnectAttempts; } - /** - * @param reconnectAttempts the reconnectAttempts to set - */ public BridgeConfiguration setReconnectAttempts(final int reconnectAttempts) { this.reconnectAttempts = reconnectAttempts; return this; @@ -463,9 +427,6 @@ public boolean isUseDuplicateDetection() { return useDuplicateDetection; } - /** - * @param useDuplicateDetection the useDuplicateDetection to set - */ public BridgeConfiguration setUseDuplicateDetection(final boolean useDuplicateDetection) { this.useDuplicateDetection = useDuplicateDetection; return this; @@ -475,9 +436,6 @@ public int getConfirmationWindowSize() { return confirmationWindowSize; } - /** - * @param confirmationWindowSize the confirmationWindowSize to set - */ public BridgeConfiguration setConfirmationWindowSize(final int confirmationWindowSize) { this.confirmationWindowSize = confirmationWindowSize; return this; @@ -487,9 +445,6 @@ public int getProducerWindowSize() { return producerWindowSize; } - /** - * @param producerWindowSize the producerWindowSize to set - */ public BridgeConfiguration setProducerWindowSize(final int producerWindowSize) { this.producerWindowSize = producerWindowSize; return this; @@ -504,9 +459,6 @@ public BridgeConfiguration setClientFailureCheckPeriod(long clientFailureCheckPe return this; } - /** - * @return the minLargeMessageSize - */ public int getMinLargeMessageSize() { return minLargeMessageSize; } @@ -534,9 +486,6 @@ public BridgeConfiguration setPassword(String password) { return this; } - /** - * @return the callTimeout - */ public long getCallTimeout() { return callTimeout; } @@ -568,54 +517,35 @@ public BridgeConfiguration setRoutingType(ComponentConfigurationRoutingType rout return this; } - /** - * @return the bridge concurrency - */ public int getConcurrency() { return concurrency; } - /** - * @param concurrency the bridge concurrency to set - */ public BridgeConfiguration setConcurrency(int concurrency) { this.concurrency = concurrency; return this; } - /** - * @return the bridge pending ack timeout - */ public long getPendingAckTimeout() { return pendingAckTimeout; } - /** - * @param pendingAckTimeout the bridge pending ack timeout to set - */ public BridgeConfiguration setPendingAckTimeout(long pendingAckTimeout) { this.pendingAckTimeout = pendingAckTimeout; return this; } - /** - * @return the bridge client ID - */ public String getClientId() { return clientId; } - /** - * @param clientId the bridge clientId to set - */ public BridgeConfiguration setClientId(String clientId) { this.clientId = clientId; return this; } /** - * At this point this is only changed on testcases - * The bridge shouldn't be sending blocking anyways + * At this point this is only changed on testcases The bridge shouldn't be sending blocking anyways * * @param callTimeout the callTimeout to set */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java index 69dd8512946..5cbbb13cb99 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java @@ -120,91 +120,55 @@ public ClusterConnectionConfiguration setCompositeMembers(URISupport.CompositeDa return this; } - /** - * @return the clientFailureCheckPeriod - */ public long getClientFailureCheckPeriod() { return clientFailureCheckPeriod; } - /** - * @param clientFailureCheckPeriod the clientFailureCheckPeriod to set - */ public ClusterConnectionConfiguration setClientFailureCheckPeriod(long clientFailureCheckPeriod) { this.clientFailureCheckPeriod = clientFailureCheckPeriod; return this; } - /** - * @return the connectionTTL - */ public long getConnectionTTL() { return connectionTTL; } - /** - * @param connectionTTL the connectionTTL to set - */ public ClusterConnectionConfiguration setConnectionTTL(long connectionTTL) { this.connectionTTL = connectionTTL; return this; } - /** - * @return the retryIntervalMultiplier - */ public double getRetryIntervalMultiplier() { return retryIntervalMultiplier; } - /** - * @param retryIntervalMultiplier the retryIntervalMultiplier to set - */ public ClusterConnectionConfiguration setRetryIntervalMultiplier(double retryIntervalMultiplier) { this.retryIntervalMultiplier = retryIntervalMultiplier; return this; } - /** - * @return the maxRetryInterval - */ public long getMaxRetryInterval() { return maxRetryInterval; } - /** - * @param maxRetryInterval the maxRetryInterval to set - */ public ClusterConnectionConfiguration setMaxRetryInterval(long maxRetryInterval) { this.maxRetryInterval = maxRetryInterval; return this; } - /** - * @return the initialConnectAttempts - */ public int getInitialConnectAttempts() { return initialConnectAttempts; } - /** - * @param initialConnectAttempts the reconnectAttempts to set - */ public ClusterConnectionConfiguration setInitialConnectAttempts(int initialConnectAttempts) { this.initialConnectAttempts = initialConnectAttempts; return this; } - /** - * @return the reconnectAttempts - */ public int getReconnectAttempts() { return reconnectAttempts; } - /** - * @param reconnectAttempts the reconnectAttempts to set - */ public ClusterConnectionConfiguration setReconnectAttempts(int reconnectAttempts) { this.reconnectAttempts = reconnectAttempts; return this; @@ -214,9 +178,6 @@ public long getCallTimeout() { return callTimeout; } - /** - * @param callTimeout the callTimeout to set - */ public ClusterConnectionConfiguration setCallTimeout(long callTimeout) { this.callTimeout = callTimeout; return this; @@ -226,9 +187,6 @@ public long getCallFailoverTimeout() { return callFailoverTimeout; } - /** - * @param callFailoverTimeout the callTimeout to set - */ public ClusterConnectionConfiguration setCallFailoverTimeout(long callFailoverTimeout) { this.callFailoverTimeout = callFailoverTimeout; return this; @@ -247,9 +205,6 @@ public boolean isDuplicateDetection() { return duplicateDetection; } - /** - * @param duplicateDetection the duplicateDetection to set - */ public ClusterConnectionConfiguration setDuplicateDetection(boolean duplicateDetection) { this.duplicateDetection = duplicateDetection; return this; @@ -259,10 +214,6 @@ public MessageLoadBalancingType getMessageLoadBalancingType() { return messageLoadBalancingType; } - /** - * @param messageLoadBalancingType - * @return - */ public ClusterConnectionConfiguration setMessageLoadBalancingType(MessageLoadBalancingType messageLoadBalancingType) { this.messageLoadBalancingType = messageLoadBalancingType; return this; @@ -317,9 +268,6 @@ public long getRetryInterval() { return retryInterval; } - /** - * @param retryInterval the retryInterval to set - */ public ClusterConnectionConfiguration setRetryInterval(long retryInterval) { this.retryInterval = retryInterval; return this; @@ -334,24 +282,15 @@ public ClusterConnectionConfiguration setAllowDirectConnectionsOnly(boolean allo return this; } - /** - * @return the minLargeMessageSize - */ public int getMinLargeMessageSize() { return minLargeMessageSize; } - /** - * @param minLargeMessageSize the minLargeMessageSize to set - */ public ClusterConnectionConfiguration setMinLargeMessageSize(final int minLargeMessageSize) { this.minLargeMessageSize = minLargeMessageSize; return this; } - /* - * returns the cluster update interval - * */ public long getClusterNotificationInterval() { return clusterNotificationInterval; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java index 17765802b57..501ae3b53ea 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java @@ -71,21 +71,16 @@ public interface Configuration { Configuration setName(String name); /** - * We use Bean-utils to pass in System.properties that start with {@link #setSystemPropertyPrefix(String)}. - * The default should be 'brokerconfig.' (Including the "."). - * For example if you want to set clustered through a system property you must do: - * - * -Dbrokerconfig.clustered=true - * + * We use Bean-utils to pass in System.properties that start with {@link #setSystemPropertyPrefix(String)}} The + * default should be {@code brokerconfig.} (Including the "."). For example if you want to set clustered through a + * system property you must do: {@code -Dbrokerconfig.clustered=true}} + *

            * The prefix is configured here. - * @param systemPropertyPrefix - * @return */ Configuration setSystemPropertyPrefix(String systemPropertyPrefix); /** - * See doc at {@link #setSystemPropertyPrefix(String)}. - * @return + * See doc at {@link #setSystemPropertyPrefix(String)}} */ String getSystemPropertyPrefix(); @@ -109,17 +104,14 @@ public interface Configuration { Configuration setCriticalAnalyzerPolicy(CriticalAnalyzerPolicy policy); - /** - * Returns whether this server is clustered.
            - * {@code true} if {@link #getClusterConfigurations()} is not empty. + * {@return whether this server is clustered. {@code true} if {@link #getClusterConfigurations()} is not empty} */ boolean isClustered(); /** - * Returns whether delivery count is persisted before messages are delivered to the consumers.
            - * Default value is - * {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_PERSIST_DELIVERY_COUNT_BEFORE_DELIVERY} + * {@return whether delivery count is persisted before messages are delivered to the consumers; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_PERSIST_DELIVERY_COUNT_BEFORE_DELIVERY}} */ boolean isPersistDeliveryCountBeforeDelivery(); @@ -129,8 +121,8 @@ public interface Configuration { Configuration setPersistDeliveryCountBeforeDelivery(boolean persistDeliveryCountBeforeDelivery); /** - * Returns whether this server is using persistence and store data.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_PERSISTENCE_ENABLED}. + * {@return whether this server is using persistence and store data; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_PERSISTENCE_ENABLED}} */ boolean isPersistenceEnabled(); @@ -149,38 +141,40 @@ public interface Configuration { /** * Should use fdatasync on journal files. * - * @see fdatasync - * * @return a boolean + * @see fdatasync */ boolean isJournalDatasync(); /** - * documented at {@link #isJournalDatasync()} ()} + * documented at {@link #isJournalDatasync()} * - * @param enable * @return this */ Configuration setJournalDatasync(boolean enable); /** - * @return usernames mapped to ResourceLimitSettings + * {@return usernames mapped to ResourceLimitSettings} */ Map getResourceLimitSettings(); /** + * Set the collection of resource limits indexed by username. + * * @param resourceLimitSettings usernames mapped to ResourceLimitSettings */ Configuration setResourceLimitSettings(Map resourceLimitSettings); /** - * @param resourceLimitSettings usernames mapped to ResourceLimitSettings + * Add a resource limit to the underlying collection. + * + * @param resourceLimitSettings the ResourceLimitSettings to add */ Configuration addResourceLimitSettings(ResourceLimitSettings resourceLimitSettings); /** - * Returns the period (in milliseconds) to scan configuration files used by deployment.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_FILE_DEPLOYER_SCAN_PERIOD}. + * {@return the period (in milliseconds) to scan configuration files used by deployment; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_FILE_DEPLOYER_SCAN_PERIOD}} */ long getFileDeployerScanPeriod(); @@ -190,8 +184,8 @@ public interface Configuration { Configuration setFileDeployerScanPeriod(long period); /** - * Returns the maximum number of threads in the thread pool of this server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_THREAD_POOL_MAX_SIZE}. + * {@return the maximum number of threads in the thread pool of this server; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_THREAD_POOL_MAX_SIZE}} */ int getThreadPoolMaxSize(); @@ -201,8 +195,8 @@ public interface Configuration { Configuration setThreadPoolMaxSize(int maxSize); /** - * Returns the maximum number of threads in the scheduled thread pool of this server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE}. + * {@return the maximum number of threads in the scheduled thread pool of this server; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE}} */ int getScheduledThreadPoolMaxSize(); @@ -212,8 +206,8 @@ public interface Configuration { Configuration setScheduledThreadPoolMaxSize(int maxSize); /** - * Returns the interval time (in milliseconds) to invalidate security credentials.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_SECURITY_INVALIDATION_INTERVAL}. + * {@return the interval time (in milliseconds) to invalidate security credentials; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_SECURITY_INVALIDATION_INTERVAL}} */ long getSecurityInvalidationInterval(); @@ -228,8 +222,8 @@ public interface Configuration { Configuration setAuthenticationCacheSize(long size); /** - * Returns the configured size of the authentication cache.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_AUTHENTICATION_CACHE_SIZE}. + * {@return the configured size of the authentication cache; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_AUTHENTICATION_CACHE_SIZE}} */ long getAuthenticationCacheSize(); @@ -239,14 +233,14 @@ public interface Configuration { Configuration setAuthorizationCacheSize(long size); /** - * Returns the configured size of the authorization cache.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_AUTHORIZATION_CACHE_SIZE}. + * {@return the configured size of the authorization cache; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_AUTHORIZATION_CACHE_SIZE}} */ long getAuthorizationCacheSize(); /** - * Returns whether security is enabled for this server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_SECURITY_ENABLED}. + * {@return whether security is enabled for this server; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_SECURITY_ENABLED}} */ boolean isSecurityEnabled(); @@ -256,8 +250,8 @@ public interface Configuration { Configuration setSecurityEnabled(boolean enabled); /** - * Returns whether graceful shutdown is enabled for this server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_GRACEFUL_SHUTDOWN_ENABLED}. + * {@return whether graceful shutdown is enabled for this server; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_GRACEFUL_SHUTDOWN_ENABLED}} */ boolean isGracefulShutdownEnabled(); @@ -267,8 +261,8 @@ public interface Configuration { Configuration setGracefulShutdownEnabled(boolean enabled); /** - * Returns the graceful shutdown timeout for this server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_GRACEFUL_SHUTDOWN_TIMEOUT}. + * {@return the graceful shutdown timeout for this server; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_GRACEFUL_SHUTDOWN_TIMEOUT}} */ long getGracefulShutdownTimeout(); @@ -278,73 +272,72 @@ public interface Configuration { Configuration setGracefulShutdownTimeout(long timeout); /** - * Returns whether this server is manageable using JMX or not.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JMX_MANAGEMENT_ENABLED}. + * {@return whether this server is manageable using JMX or not; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_JMX_MANAGEMENT_ENABLED}} */ boolean isJMXManagementEnabled(); /** - * Sets whether this server is manageable using JMX or not.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JMX_MANAGEMENT_ENABLED}. + * Sets whether this server is manageable using JMX or not; default is + * {@link ActiveMQDefaultConfiguration#DEFAULT_JMX_MANAGEMENT_ENABLED}} */ Configuration setJMXManagementEnabled(boolean enabled); /** - * Returns the domain used by JMX MBeans (provided JMX management is enabled).
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JMX_DOMAIN}. + * {@return the domain used by JMX MBeans (provided JMX management is enabled); default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_JMX_DOMAIN}} */ String getJMXDomain(); /** * Sets the domain used by JMX MBeans (provided JMX management is enabled). *

            - * Changing this JMX domain is required if multiple ActiveMQ Artemis servers are run inside - * the same JVM and all servers are using the same MBeanServer. + * Changing this JMX domain is required if multiple ActiveMQ Artemis servers are run inside the same JVM and all + * servers are using the same MBeanServer. */ Configuration setJMXDomain(String domain); /** - * whether or not to use the broker name in the JMX tree + * whether to use the broker name in the JMX tree */ boolean isJMXUseBrokerName(); /** - * whether or not to use the broker name in the JMX tree + * whether to use the broker name in the JMX tree */ ConfigurationImpl setJMXUseBrokerName(boolean jmxUseBrokerName); /** - * Returns the list of interceptors classes used by this server for incoming messages (i.e. those being delivered to - * the server from clients). + * {@return the list of interceptors classes used by this server for incoming messages (i.e. those being delivered to + * the server from clients)} */ List getIncomingInterceptorClassNames(); /** - * Returns the list of interceptors classes used by this server for outgoing messages (i.e. those being delivered to - * clients from the server). + * {@return the list of interceptors classes used by this server for outgoing messages (i.e. those being delivered to + * clients from the server)} */ List getOutgoingInterceptorClassNames(); /** - * Sets the list of interceptors classes used by this server for incoming messages (i.e. those being delivered to - * the server from clients). - *
            - * Classes must implement {@link org.apache.activemq.artemis.api.core.Interceptor}. + * Sets the list of interceptors classes used by this server for incoming messages (i.e. those being delivered to the + * server from clients). + *

            + * Classes must implement {@link org.apache.activemq.artemis.api.core.Interceptor}} */ Configuration setIncomingInterceptorClassNames(List interceptors); /** * Sets the list of interceptors classes used by this server for outgoing messages (i.e. those being delivered to * clients from the server). - *
            - * Classes must implement {@link org.apache.activemq.artemis.api.core.Interceptor}. + *

            + * Classes must implement {@link org.apache.activemq.artemis.api.core.Interceptor}} */ Configuration setOutgoingInterceptorClassNames(List interceptors); /** - * Returns the connection time to live.
            - * This value overrides the connection time-to-live sent by the client.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_CONNECTION_TTL_OVERRIDE}. + * {@return the connection time to live; This value overrides the connection time-to-live sent by the + * client; default is {@link ActiveMQDefaultConfiguration#DEFAULT_CONNECTION_TTL_OVERRIDE}} */ long getConnectionTTLOverride(); @@ -354,7 +347,7 @@ public interface Configuration { Configuration setConnectionTTLOverride(long ttl); /** - * Returns if to use Core subscription naming for AMQP. + * {@return if to use Core subscription naming for AMQP} */ boolean isAmqpUseCoreSubscriptionNaming(); @@ -364,10 +357,10 @@ public interface Configuration { Configuration setAmqpUseCoreSubscriptionNaming(boolean amqpUseCoreSubscriptionNaming); /** - * deprecated: we decide based on the semantic context when to make things async or not - * Returns whether code coming from connection is executed asynchronously or not.
            - * Default value is - * {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_ASYNC_CONNECTION_EXECUTION_ENABLED}. + * {@return whether code coming from connection is executed asynchronously or not; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_ASYNC_CONNECTION_EXECUTION_ENABLED}} + *

            + * {@deprecated we decide based on the semantic context when to make things async or not} */ @Deprecated boolean isAsyncConnectionExecutionEnabled(); @@ -379,7 +372,7 @@ public interface Configuration { Configuration setEnabledAsyncConnectionExecution(boolean enabled); /** - * Returns the acceptors configured for this server. + * {@return the acceptors configured for this server} */ Set getAcceptorConfigurations(); @@ -397,14 +390,16 @@ public interface Configuration { * @param uri the URI of the acceptor * @return this * @throws Exception in case of Parsing errors on the URI - * @see Configuring the Transport + * @see Configuring + * the Transport */ Configuration addAcceptorConfiguration(String name, String uri) throws Exception; Configuration clearAcceptorConfigurations(); /** - * Returns the connectors configured for this server. + * {@return the connectors configured for this server} */ Map getConnectorConfigurations(); @@ -420,19 +415,19 @@ public interface Configuration { Configuration clearConnectorConfigurations(); /** - * Returns the broadcast groups configured for this server. + * {@return the broadcast groups configured for this server} */ List getBroadcastGroupConfigurations(); /** - * Sets the broadcast groups configured for this server. + * Sets the broadcast groups configured for this server} */ Configuration setBroadcastGroupConfigurations(List configs); Configuration addBroadcastGroupConfiguration(BroadcastGroupConfiguration config); /** - * Returns the discovery groups configured for this server. + * {@return the discovery groups configured for this server} */ Map getDiscoveryGroupConfigurations(); @@ -445,7 +440,7 @@ Configuration addDiscoveryGroupConfiguration(String key, DiscoveryGroupConfiguration discoveryGroupConfiguration); /** - * Returns the grouping handler configured for this server. + * {@return the grouping handler configured for this server} */ GroupingHandlerConfiguration getGroupingHandlerConfiguration(); @@ -455,7 +450,7 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setGroupingHandlerConfiguration(GroupingHandlerConfiguration groupingHandlerConfiguration); /** - * Returns the bridges configured for this server. + * {@return the bridges configured for this server} */ List getBridgeConfigurations(); @@ -465,7 +460,7 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setBridgeConfigurations(List configs); /** - * Returns the diverts configured for this server. + * {@return the diverts configured for this server} */ List getDivertConfigurations(); @@ -477,7 +472,7 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration addDivertConfiguration(DivertConfiguration config); /** - * Returns the redirects configured for this server. + * {@return the redirects configured for this server} */ List getConnectionRouters(); @@ -489,10 +484,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration addConnectionRouter(ConnectionRouterConfiguration config); /** - * Returns the cluster connections configured for this server. - *

            - * Modifying the returned list will modify the list of {@link ClusterConnectionConfiguration} - * used by this configuration. + * {@return the cluster connections configured for this server; modifying the returned list will modify the list of + * {@link ClusterConnectionConfiguration} used by this configuration} */ List getClusterConfigurations(); @@ -512,30 +505,31 @@ Configuration addDiscoveryGroupConfiguration(String key, List getAMQPConnection(); /** - * Quick set of all AMQP connection configurations in one call which will clear all - * previously set or added broker configurations. + * Quick set of all AMQP connection configurations in one call which will clear all previously set or added broker + * configurations. * - * @param amqpConnectionConfiugrations - * A list of AMQP broker connection configurations to assign to the broker. - * - * @return this configuration object. + * @param amqpConnectionConfiugrations A list of AMQP broker connection configurations to assign to the broker. + * @return this configuration object */ Configuration setAMQPConnectionConfigurations(List amqpConnectionConfiugrations); /** * Clears the current configuration object of all set or added AMQP connection configuration elements. * - * @return this configuration object. + * @return this configuration object */ Configuration clearAMQPConnectionConfigurations(); /** - * Returns the queues configured for this server. + * {@return the queues configured for this server} */ @Deprecated List getQueueConfigurations(); - + /** + * {@return the queues configured for this server; modifying the returned {@code List} will not impact the underlying + * {@code List}} + */ List getQueueConfigs(); /** @@ -555,7 +549,7 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration addQueueConfiguration(QueueConfiguration config); /** - * Returns the addresses configured for this server. + * {@return the addresses configured for this server} */ List getAddressConfigurations(); @@ -570,9 +564,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration addAddressConfiguration(CoreAddressConfiguration config); /** - * Returns the management address of this server.
            - * Clients can send management messages to this address to manage this server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MANAGEMENT_ADDRESS}. + * {@return the management address of this server; Clients can send management messages to this address to manage + * this server; default is {@link ActiveMQDefaultConfiguration#DEFAULT_MANAGEMENT_ADDRESS}} */ SimpleString getManagementAddress(); @@ -582,10 +575,9 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setManagementAddress(SimpleString address); /** - * Returns the management notification address of this server.
            - * Clients can bind queues to this address to receive management notifications emitted by this - * server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MANAGEMENT_NOTIFICATION_ADDRESS}. + * {@return the management notification address of this server; Clients can bind queues to this address to receive + * management notifications emitted by this server; default is + * {@link ActiveMQDefaultConfiguration#DEFAULT_MANAGEMENT_NOTIFICATION_ADDRESS}} */ SimpleString getManagementNotificationAddress(); @@ -595,8 +587,7 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setManagementNotificationAddress(SimpleString address); /** - * Returns the cluster user for this server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_CLUSTER_USER}. + * {@return the cluster user for this server; default is {@link ActiveMQDefaultConfiguration#DEFAULT_CLUSTER_USER}} */ String getClusterUser(); @@ -606,8 +597,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setClusterUser(String user); /** - * Returns the cluster password for this server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_CLUSTER_PASSWORD}. + * {@return the cluster password for this server; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_CLUSTER_PASSWORD}} */ String getClusterPassword(); @@ -617,8 +608,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setClusterPassword(String password); /** - * Returns the size of the cache for pre-creating message IDs.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_ID_CACHE_SIZE}. + * {@return the size of the cache for pre-creating message IDs; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_ID_CACHE_SIZE}} */ int getIDCacheSize(); @@ -628,8 +619,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setIDCacheSize(int idCacheSize); /** - * Returns whether message ID cache is persisted.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_PERSIST_ID_CACHE}. + * {@return whether message ID cache is persisted; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_PERSIST_ID_CACHE}} */ boolean isPersistIDCache(); @@ -641,8 +632,8 @@ Configuration addDiscoveryGroupConfiguration(String key, // Journal related attributes ------------------------------------------------------------ /** - * Returns the file system directory used to store bindings.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_BINDINGS_DIRECTORY}. + * {@return the file system directory used to store bindings; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_BINDINGS_DIRECTORY}} */ String getBindingsDirectory(); @@ -657,9 +648,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setBindingsDirectory(String dir); /** - * The max number of concurrent reads allowed on paging. - *

            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MAX_CONCURRENT_PAGE_IO}. + * {@return the max number of concurrent reads allowed on paging; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_MAX_CONCURRENT_PAGE_IO}} */ int getPageMaxConcurrentIO(); @@ -671,8 +661,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setPageMaxConcurrentIO(int maxIO); /** - * Returns whether the whole page is read while getting message after page cache is evicted.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_READ_WHOLE_PAGE}. + * {@return whether the whole page is read while getting message after page cache is evicted; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_READ_WHOLE_PAGE}} */ boolean isReadWholePage(); @@ -682,20 +672,18 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setReadWholePage(boolean read); /** - * Returns the file system directory used to store journal log.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_DIR}. + * {@return the file system directory used to store journal log; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_DIR}} */ String getJournalDirectory(); /** - * The location of the journal related to artemis.instance. - * - * @return + * {@return the location of the journal related to {@code artemis.instance}} */ File getJournalLocation(); /** - * The location of the node manager lock file related to artemis.instance. + * {@return the location of the node manager lock file related to artemis.instance} */ File getNodeManagerLockLocation(); @@ -705,8 +693,7 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setNodeManagerLockDirectory(String dir); /** - * the directory that contains the lock file - * @return the directory + * {@return the directory that contains the lock file} */ String getNodeManagerLockDirectory(); @@ -724,7 +711,10 @@ Configuration addDiscoveryGroupConfiguration(String key, File getJournalRetentionLocation(); - /** The retention period for the journal in milliseconds (always in milliseconds, a conversion is performed on set) */ + /** + * {@return the retention period for the journal in milliseconds (always in milliseconds, a conversion is performed + * on set)} + */ long getJournalRetentionPeriod(); Configuration setJournalRetentionPeriod(TimeUnit unit, long limit); @@ -734,9 +724,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalRetentionMaxBytes(long bytes); /** - * Returns the type of journal used by this server ({@code NIO}, {@code ASYNCIO} or {@code MAPPED}). - *
            - * Default value is ASYNCIO. + * {@return the type of journal used by this server ({@code NIO}, {@code ASYNCIO} or {@code MAPPED}); default is + * {@code ASYNCIO}} */ JournalType getJournalType(); @@ -746,8 +735,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalType(JournalType type); /** - * Returns whether the journal is synchronized when receiving transactional data.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_SYNC_TRANSACTIONAL}. + * {@return whether the journal is synchronized when receiving transactional data; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_SYNC_TRANSACTIONAL}} */ boolean isJournalSyncTransactional(); @@ -757,8 +746,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalSyncTransactional(boolean sync); /** - * Returns whether the journal is synchronized when receiving non-transactional data.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_SYNC_NON_TRANSACTIONAL}. + * {@return whether the journal is synchronized when receiving non-transactional data; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_SYNC_NON_TRANSACTIONAL}} */ boolean isJournalSyncNonTransactional(); @@ -768,8 +757,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalSyncNonTransactional(boolean sync); /** - * Returns the size (in bytes) of each journal files.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_FILE_SIZE}. + * {@return the size (in bytes) of each journal files; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_FILE_SIZE}} */ int getJournalFileSize(); @@ -779,8 +768,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalFileSize(int size); /** - * Returns the minimal number of journal files before compacting.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_COMPACT_MIN_FILES}. + * {@return the minimal number of journal files before compacting; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_COMPACT_MIN_FILES}} */ int getJournalCompactMinFiles(); @@ -790,29 +779,31 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalCompactMinFiles(int minFiles); /** - * Number of files that would be acceptable to keep on a pool. Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_POOL_FILES}. + * Number of files that would be acceptable to keep on a pool; default is + * {@link ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_POOL_FILES}} */ int getJournalPoolFiles(); /** - * Number of files that would be acceptable to keep on a pool. Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_POOL_FILES}. + * Number of files that would be acceptable to keep on a pool; default is + * {@link ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_POOL_FILES}} */ Configuration setJournalPoolFiles(int poolSize); /** - * Returns the percentage of live data before compacting the journal.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_COMPACT_PERCENTAGE}. + * {@return the percentage of live data before compacting the journal; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_COMPACT_PERCENTAGE}} */ int getJournalCompactPercentage(); /** - * @return How long to wait when opening a new Journal file before failing + * {@return How long to wait when opening a new Journal file before failing} */ int getJournalFileOpenTimeout(); /** - * Sets the journal file open timeout - */ + * Sets the journal file open timeout + */ Configuration setJournalFileOpenTimeout(int journalFileOpenTimeout); /** @@ -821,8 +812,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalCompactPercentage(int percentage); /** - * Returns the number of journal files to pre-create.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_MIN_FILES}. + * {@return the number of journal files to pre-create; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_MIN_FILES}} */ int getJournalMinFiles(); @@ -834,8 +825,8 @@ Configuration addDiscoveryGroupConfiguration(String key, // AIO and NIO need different values for these params /** - * Returns the maximum number of write requests that can be in the AIO queue at any given time.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_MAX_IO_AIO}. + * {@return the maximum number of write requests that can be in the AIO queue at any given time; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_MAX_IO_AIO}} */ int getJournalMaxIO_AIO(); @@ -845,9 +836,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalMaxIO_AIO(int journalMaxIO); /** - * Returns the timeout (in nanoseconds) used to flush buffers in the AIO queue. - *
            - * Default value is {@link org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO}. + * {@return the timeout (in nanoseconds) used to flush buffers in the AIO queue; default is {@link + * org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO}} */ int getJournalBufferTimeout_AIO(); @@ -856,21 +846,24 @@ Configuration addDiscoveryGroupConfiguration(String key, */ Configuration setJournalBufferTimeout_AIO(int journalBufferTimeout); - /** This is the device block size used on writing. - * This is usually translated as st_blksize from fstat. - * returning null mans the system should instead make a call on fstat and use st_blksize. - * The intention of this setting was to bypass the value in certain devices that will return a huge number as their block size (e.g. CephFS) */ + /** + * This is the device block size used on writing. This is usually translated as st_blksize from fstat. Returning + * {@code null} means the system should instead make a call on fstat and use st_blksize. The intention of this + * setting was to bypass the value in certain devices that will return a huge number as their block size (e.g. + * CephFS) + */ Integer getJournalDeviceBlockSize(); /** + * Set the journal device block size. + * * @see #getJournalDeviceBlockSize() */ Configuration setJournalDeviceBlockSize(Integer deviceBlockSize); /** - * Returns the buffer size (in bytes) for AIO. - *
            - * Default value is {@link org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_SIZE_AIO}. + * {@return the buffer size (in bytes) for AIO; default is {@link + * org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_SIZE_AIO}} */ int getJournalBufferSize_AIO(); @@ -880,8 +873,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalBufferSize_AIO(int journalBufferSize); /** - * Returns the maximum number of write requests for NIO journal.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_MAX_IO_NIO}. + * {@return the maximum number of write requests for NIO journal; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_MAX_IO_NIO}} */ int getJournalMaxIO_NIO(); @@ -891,9 +884,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalMaxIO_NIO(int journalMaxIO); /** - * Returns the timeout (in nanoseconds) used to flush buffers in the NIO. - *
            - * Default value is {@link org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO}. + * {@return the timeout (in nanoseconds) used to flush buffers in the NIO; default is {@link + * org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO}} */ int getJournalBufferTimeout_NIO(); @@ -903,9 +895,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalBufferTimeout_NIO(int journalBufferTimeout); /** - * Returns the buffer size (in bytes) for NIO. - *
            - * Default value is {@link org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_SIZE_NIO}. + * {@return the buffer size (in bytes) for NIO; default is {@link + * org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_SIZE_NIO}} */ int getJournalBufferSize_NIO(); @@ -915,20 +906,20 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setJournalBufferSize_NIO(int journalBufferSize); /** - * Returns the maximal number of data files before we can start deleting corrupted files instead of moving them to attic. - *
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_MAX_ATTIC_FILES}. + * {@return the maximal number of data files before we can start deleting corrupted files instead of moving them to + * attic; default value is {@link ActiveMQDefaultConfiguration#DEFAULT_JOURNAL_MAX_ATTIC_FILES}} */ int getJournalMaxAtticFiles(); /** - * Sets the maximal number of data files before we can start deleting corrupted files instead of moving them to attic. + * Sets the maximal number of data files before we can start deleting corrupted files instead of moving them to + * attic. */ Configuration setJournalMaxAtticFiles(int maxAtticFiles); /** - * Returns whether the bindings directory is created on this server startup.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_CREATE_BINDINGS_DIR}. + * {@return whether the bindings directory is created on this server startup; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_CREATE_BINDINGS_DIR}} */ boolean isCreateBindingsDir(); @@ -938,8 +929,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setCreateBindingsDir(boolean create); /** - * Returns whether the journal directory is created on this server startup.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_CREATE_JOURNAL_DIR}. + * {@return whether the journal directory is created on this server startup; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_CREATE_JOURNAL_DIR}} */ boolean isCreateJournalDir(); @@ -969,8 +960,8 @@ Configuration addDiscoveryGroupConfiguration(String key, // Paging Properties -------------------------------------------------------------------- /** - * Returns the file system directory used to store paging files.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_PAGING_DIR}. + * {@return the file system directory used to store paging files; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_PAGING_DIR}} */ String getPagingDirectory(); @@ -987,8 +978,8 @@ Configuration addDiscoveryGroupConfiguration(String key, // Large Messages Properties ------------------------------------------------------------ /** - * Returns the file system directory used to store large messages.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_LARGE_MESSAGES_DIR}. + * {@return the file system directory used to store large messages; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_LARGE_MESSAGES_DIR}} */ String getLargeMessagesDirectory(); @@ -1005,8 +996,8 @@ Configuration addDiscoveryGroupConfiguration(String key, // Other Properties --------------------------------------------------------------------- /** - * Returns whether wildcard routing is supported by this server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_WILDCARD_ROUTING_ENABLED}. + * {@return whether wildcard routing is supported by this server; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_WILDCARD_ROUTING_ENABLED}} */ boolean isWildcardRoutingEnabled(); @@ -1020,21 +1011,20 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setWildCardConfiguration(WildcardConfiguration wildcardConfiguration); /** - * Returns the timeout (in milliseconds) after which transactions is removed from the resource - * manager after it was created.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_TRANSACTION_TIMEOUT}. + * {@return the timeout (in milliseconds) after which transactions is removed from the resource manager after it was + * created; default is {@link ActiveMQDefaultConfiguration#DEFAULT_TRANSACTION_TIMEOUT}} */ long getTransactionTimeout(); /** - * Sets the timeout (in milliseconds) after which transactions is removed - * from the resource manager after it was created. + * Sets the timeout (in milliseconds) after which transactions is removed from the resource manager after it was + * created. */ Configuration setTransactionTimeout(long timeout); /** - * Returns whether message counter is enabled for this server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_COUNTER_ENABLED}. + * {@return whether message counter is enabled for this server; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_COUNTER_ENABLED}} */ boolean isMessageCounterEnabled(); @@ -1044,8 +1034,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setMessageCounterEnabled(boolean enabled); /** - * Returns the sample period (in milliseconds) to take message counter snapshot.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_COUNTER_SAMPLE_PERIOD}. + * {@return the sample period (in milliseconds) to take message counter snapshot; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_COUNTER_SAMPLE_PERIOD}} */ long getMessageCounterSamplePeriod(); @@ -1057,8 +1047,8 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setMessageCounterSamplePeriod(long period); /** - * Returns the maximum number of days kept in memory for message counter.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_COUNTER_MAX_DAY_HISTORY}. + * {@return the maximum number of days kept in memory for message counter; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_COUNTER_MAX_DAY_HISTORY}} */ int getMessageCounterMaxDayHistory(); @@ -1070,34 +1060,30 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setMessageCounterMaxDayHistory(int maxDayHistory); /** - * Returns the frequency (in milliseconds) to scan transactions to detect which transactions have - * timed out.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_TRANSACTION_TIMEOUT_SCAN_PERIOD}. + * {@return the frequency (in milliseconds) to scan transactions to detect which transactions have timed out; default + * is {@link ActiveMQDefaultConfiguration#DEFAULT_TRANSACTION_TIMEOUT_SCAN_PERIOD}} */ long getTransactionTimeoutScanPeriod(); /** - * Sets the frequency (in milliseconds) to scan transactions to detect which transactions - * have timed out. + * Sets the frequency (in milliseconds) to scan transactions to detect which transactions have timed out. */ Configuration setTransactionTimeoutScanPeriod(long period); /** - * Returns the frequency (in milliseconds) to scan messages to detect which messages have - * expired.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_EXPIRY_SCAN_PERIOD}. + * {@return the frequency (in milliseconds) to scan messages to detect which messages have expired; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_EXPIRY_SCAN_PERIOD}} */ long getMessageExpiryScanPeriod(); /** - * Sets the frequency (in milliseconds) to scan messages to detect which messages - * have expired. + * Sets the frequency (in milliseconds) to scan messages to detect which messages have expired. */ Configuration setMessageExpiryScanPeriod(long messageExpiryScanPeriod); /** - * Returns the priority of the thread used to scan message expiration.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_EXPIRY_THREAD_PRIORITY}. + * {@return the priority of the thread used to scan message expiration; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_EXPIRY_THREAD_PRIORITY}} */ @Deprecated int getMessageExpiryThreadPriority(); @@ -1109,29 +1095,34 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setMessageExpiryThreadPriority(int messageExpiryThreadPriority); /** - * Returns the frequency (in milliseconds) to scan addresses and queues to detect which - * ones should be deleted.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_EXPIRY_SCAN_PERIOD}. + * {@return the frequency (in milliseconds) to scan addresses and queues to detect which ones should be deleted; + * default is {@link ActiveMQDefaultConfiguration#DEFAULT_MESSAGE_EXPIRY_SCAN_PERIOD}} */ long getAddressQueueScanPeriod(); /** - * Sets the frequency (in milliseconds) to scan addresses and queues to detect which - * ones should be deleted. + * Sets the frequency (in milliseconds) to scan addresses and queues to detect which ones should be deleted. */ Configuration setAddressQueueScanPeriod(long addressQueueScanPeriod); /** - * @return A list of AddressSettings per matching to be deployed to the address settings repository + * {@return A list of AddressSettings per matching to be deployed to the address settings repository} */ Map getAddressSettings(); /** - * @param addressSettings list of AddressSettings per matching to be deployed to the address - * settings repository + * Set the collection of {@code AddressSettings} indexed by address match. + * + * @param addressSettings list of AddressSettings per matching to be deployed to the address settings repository */ Configuration setAddressSettings(Map addressSettings); + /** + * Add an {@code AddressSettings} to the underlying collection. + * + * @param key the address match + * @param addressesSetting the {@code AddressSettings} to add + */ Configuration addAddressSetting(String key, AddressSettings addressesSetting); Configuration clearAddressSettings(); @@ -1149,12 +1140,14 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration clearAddressesSettings(); /** + * Set the collection of {@code Role} objects indexed by match (i.e. address name). + * * @param roles a list of roles per matching */ Configuration setSecurityRoles(Map> roles); /** - * @return a list of roles per matching + * {@return a collection of roles indexed by matched} */ Map> getSecurityRoles(); @@ -1178,7 +1171,7 @@ Configuration addDiscoveryGroupConfiguration(String key, Configuration setMetricsConfiguration(MetricsConfiguration metricsConfiguration); /** - * @return list of {@link ConnectorServiceConfiguration} + * {@return list of {@link ConnectorServiceConfiguration}} */ List getConnectorServiceConfigurations(); @@ -1209,21 +1202,20 @@ Configuration addDiscoveryGroupConfiguration(String key, */ Boolean isMaskPassword(); - /* - * Whether or not that ActiveMQ Artemis should use all protocols available on the classpath. If false only the core protocol will - * be set, any other protocols will need to be set directly on the ActiveMQServer - * */ + /** + * Whether to use all protocols available on the classpath. If false only the core protocol will be set, any other + * protocols will need to be set directly on the ActiveMQServer + */ Configuration setResolveProtocols(boolean resolveProtocols); TransportConfiguration[] getTransportConfigurations(String... connectorNames); TransportConfiguration[] getTransportConfigurations(List connectorNames); - /* - * @see #setResolveProtocols() - * @return whether ActiveMQ Artemis should resolve and use any Protocols available on the classpath - * Default value is {@link org.apache.activemq.artemis.api.config.org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_RESOLVE_PROTOCOLS}. - * */ + /** + * {@return whether to resolve and use any Protocols available on the classpath; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_RESOLVE_PROTOCOLS}} {@see #setResolveProtocols()} + */ boolean isResolveProtocols(); Configuration copy() throws Exception; @@ -1302,34 +1294,46 @@ default boolean isJDBC() { int getDiskScanPeriod(); - /** A comma separated list of IPs we could use to validate if the network is UP. - * In case of none of these Ips are reached (if configured) the server will be shutdown. */ + /** + * A comma separated list of IPs we could use to validate if the network is UP. In case of none of these Ips are + * reached (if configured) the server will be shutdown. + */ Configuration setNetworkCheckList(String list); String getNetworkCheckList(); - /** A comma separated list of URIs we could use to validate if the network is UP. - * In case of none of these Ips are reached (if configured) the server will be shutdown. - * The difference from networkCheckList is that we will use HTTP to make this validation. */ + /** + * A comma separated list of URIs we could use to validate if the network is UP. In case of none of these Ips are + * reached (if configured) the server will be shutdown. The difference from networkCheckList is that we will use HTTP + * to make this validation. + */ Configuration setNetworkCheckURLList(String uris); String getNetworkCheckURLList(); - /** The interval on which we will perform network checks. */ + /** + * The interval on which we will perform network checks. + */ Configuration setNetworkCheckPeriod(long period); long getNetworkCheckPeriod(); - /** Time in ms for how long we should wait for a ping to finish. */ + /** + * Time in ms for how long we should wait for a ping to finish. + */ Configuration setNetworkCheckTimeout(int timeout); int getNetworkCheckTimeout(); - /** The NIC name to be used on network checks */ + /** + * The NIC name to be used on network checks + */ @Deprecated Configuration setNetworCheckNIC(String nic); - /** The NIC name to be used on network checks */ + /** + * The NIC name to be used on network checks + */ Configuration setNetworkCheckNIC(String nic); String getNetworkCheckNIC(); @@ -1344,9 +1348,8 @@ default boolean isJDBC() { String getInternalNamingPrefix(); /** - * Returns the timeout (in nanoseconds) used to sync pages. - *
            - * Default value is {@link org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO}. + * {@return the timeout (in nanoseconds) used to sync pages; + * default is {@link org.apache.activemq.artemis.ArtemisConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO}} */ int getPageSyncTimeout(); @@ -1355,89 +1358,38 @@ default boolean isJDBC() { */ Configuration setPageSyncTimeout(int pageSyncTimeout); - /** - * @param plugins - */ void registerBrokerPlugins(List plugins); - /** - * @param plugin - */ void registerBrokerPlugin(ActiveMQServerBasePlugin plugin); - /** - * @param plugin - */ void unRegisterBrokerPlugin(ActiveMQServerBasePlugin plugin); - /** - * @return - */ List getBrokerPlugins(); - /** - * @return - */ List getBrokerConnectionPlugins(); - /** - * @return - */ List getBrokerSessionPlugins(); - /** - * @return - */ List getBrokerConsumerPlugins(); - /** - * @return - */ List getBrokerAddressPlugins(); - /** - * @return - */ List getBrokerQueuePlugins(); - /** - * @return - */ List getBrokerBindingPlugins(); - /** - * @return - */ List getBrokerMessagePlugins(); - /** - * @return - */ List getBrokerBridgePlugins(); - /** - * @return - */ List getBrokerCriticalPlugins(); - /** - * @return - */ List getBrokerFederationPlugins(); - /** - * @return - */ List getBrokerAMQPFederationPlugins(); - /** - * @return - */ List getFederationConfigurations(); - /** - * @return - */ List getBrokerResourcePlugins(); String getTemporaryQueueNamespace(); @@ -1451,9 +1403,9 @@ default boolean isJDBC() { Configuration setMqttSessionScanInterval(long mqttSessionScanInterval); /** - * @see Configuration#setMqttSessionScanInterval(long) + * Get the MQTT session scan interval * - * @return + * @see Configuration#setMqttSessionScanInterval */ long getMqttSessionScanInterval(); @@ -1464,15 +1416,15 @@ default boolean isJDBC() { Configuration setMqttSessionStatePersistenceTimeout(long mqttSessionStatePersistenceTimeout); /** - * @see Configuration#setMqttSessionStatePersistenceTimeout(long) + * Get the MQTT session state persistence timeout * - * @return + * @see Configuration#setMqttSessionStatePersistenceTimeout */ long getMqttSessionStatePersistenceTimeout(); /** - * Returns whether suppression of session-notifications is enabled for this server.
            - * Default value is {@link org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration#DEFAULT_SUPPRESS_SESSION_NOTIFICATIONS}. + * {@return whether suppression of session-notifications is enabled for this server; default is {@link + * ActiveMQDefaultConfiguration#DEFAULT_SUPPRESS_SESSION_NOTIFICATIONS}} */ boolean isSuppressSessionNotifications(); @@ -1484,8 +1436,11 @@ default String resolvePropertiesSources(String propertiesFileUrl) { String getStatus(); - /** This value can reflect a desired state (revision) of config. Useful when {@literal configurationFileRefreshPeriod > 0}. - Eventually with some coordination we can update it from various server components. */ + /** + * This value can reflect a desired state (revision) of config. Useful when + * {@literal configurationFileRefreshPeriod > 0}. Eventually with some coordination we can update it from various + * server components. + */ // Inspired by https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#:~:text=The%20status%20describes%20the%20current,the%20desired%20state%20you%20supplied void setStatus(String status); @@ -1509,37 +1464,42 @@ default String resolvePropertiesSources(String propertiesFileUrl) { void setManagementRbacPrefix(String prefix); - /** This configures the Mirror Ack Manager number of attempts on queues before trying page acks. - * The default value here is 5. */ + /** + * This configures the Mirror Ack Manager number of attempts on queues before trying page acks. The default value + * here is 5. + */ int getMirrorAckManagerQueueAttempts(); Configuration setMirrorAckManagerQueueAttempts(int queueAttempts); - /** This configures the Mirror Ack Manager number of attempts on page acks. - * The default value here is 2. */ + /** + * This configures the Mirror Ack Manager number of attempts on page acks. The default value here is 2. + */ int getMirrorAckManagerPageAttempts(); Configuration setMirrorAckManagerPageAttempts(int pageAttempts); - /** This configures the interval in which the Mirror AckManager will retry acks when - * It is not intended to be configured through the XML. - * The default value here is 100, and this is in milliseconds. */ + /** + * This configures the interval in which the Mirror AckManager will retry acks when It is not intended to be + * configured through the XML. The default value here is 100, and this is in milliseconds. + */ int getMirrorAckManagerRetryDelay(); Configuration setMirrorAckManagerRetryDelay(int delay); - /** Should Mirror use Page Transactions When target destinations is paging? - * When a target queue on the mirror is paged, the mirror will not record a page transaction for every message. - * The default is false, and the overhead of paged messages will be smaller, but there is a possibility of eventual duplicates in case of interrupted communication between the mirror source and target. - * If you set this to true there will be a record stored on the journal for the page-transaction additionally to the record in the page store. */ + /** + * Should Mirror use Page Transactions When target destinations is paging? When a target queue on the mirror is + * paged, the mirror will not record a page transaction for every message. The default is false, and the overhead of + * paged messages will be smaller, but there is a possibility of eventual duplicates in case of interrupted + * communication between the mirror source and target. If you set this to true there will be a record stored on the + * journal for the page-transaction additionally to the record in the page store. + */ boolean isMirrorPageTransaction(); Configuration setMirrorPageTransaction(boolean ignorePageTransactions); /** * should log.warn when ack retries failed. - * @param warnUnacked - * @return */ Configuration setMirrorAckManagerWarnUnacked(boolean warnUnacked); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/CoreQueueConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/CoreQueueConfiguration.java index 6769427b344..bc77325a912 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/CoreQueueConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/CoreQueueConfiguration.java @@ -177,89 +177,56 @@ public static CoreQueueConfiguration fromQueueConfiguration(QueueConfiguration q .setRoutingType(queueConfiguration.getRoutingType() != null ? queueConfiguration.getRoutingType() : ActiveMQDefaultConfiguration.getDefaultRoutingType()); } - /** - * @param address the address to set - */ public CoreQueueConfiguration setAddress(final String address) { this.address = address; return this; } - /** - * @param name the name to set - */ public CoreQueueConfiguration setName(final String name) { this.name = name; return this; } - /** - * @param filterString the filterString to set - */ public CoreQueueConfiguration setFilterString(final String filterString) { this.filterString = filterString; return this; } - /** - * @param durable the durable to set; default value is true - */ public CoreQueueConfiguration setDurable(final boolean durable) { this.durable = durable; return this; } - /** - * @param maxConsumers for this queue, default is -1 (unlimited) - */ public CoreQueueConfiguration setMaxConsumers(Integer maxConsumers) { this.maxConsumers = maxConsumers; return this; } - /** - * @param consumersBeforeDispatch for this queue, default is 0 (dispatch as soon as 1 consumer) - */ public CoreQueueConfiguration setConsumersBeforeDispatch(Integer consumersBeforeDispatch) { this.consumersBeforeDispatch = consumersBeforeDispatch; return this; } - /** - * @param delayBeforeDispatch for this queue, default is 0 (start dispatch with no delay) - */ public CoreQueueConfiguration setDelayBeforeDispatch(Long delayBeforeDispatch) { this.delayBeforeDispatch = delayBeforeDispatch; return this; } - /** - * @param ringSize for this queue, default is -1 - */ public CoreQueueConfiguration setRingSize(Long ringSize) { this.ringSize = ringSize; return this; } - /** - * @param enabled for this queue, default is true - */ public CoreQueueConfiguration setEnabled(Boolean enabled) { this.enabled = enabled; return this; } - /** - * @param purgeOnNoConsumers delete this queue when consumer count reaches 0, default is false - */ public CoreQueueConfiguration setPurgeOnNoConsumers(Boolean purgeOnNoConsumers) { this.purgeOnNoConsumers = purgeOnNoConsumers; return this; } - /** - * @param user the use you want to associate with creating the queue - */ public CoreQueueConfiguration setUser(String user) { this.user = user; return this; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/DivertConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/DivertConfiguration.java index 5fc4c74f6b3..414ef8bd94b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/DivertConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/DivertConfiguration.java @@ -82,7 +82,7 @@ public DivertConfiguration() { * example, if you pass the value "TRUE" for the key "exclusive" the {@code String} "TRUE" will be converted to * the {@code Boolean} {@code true}. * - * @param key the key to set to the value + * @param key the key to set to the value * @param value the value to set for the key * @return this {@code DivertConfiguration} */ @@ -145,15 +145,14 @@ public ComponentConfigurationRoutingType getRoutingType() { return routingType; } - /** - * @param name the name to set - */ public DivertConfiguration setName(final String name) { this.name = name; return this; } /** + * Sets the {@code routingName}. If the input is {@code null} then a random {@code routingName} will be generated. + * * @param routingName the routingName to set */ public DivertConfiguration setRoutingName(final String routingName) { @@ -164,50 +163,31 @@ public DivertConfiguration setRoutingName(final String routingName) { } return this; } - - /** - * @param address the address to set - */ public DivertConfiguration setAddress(final String address) { this.address = address; return this; } - /** - * @param forwardingAddress the forwardingAddress to set - */ public DivertConfiguration setForwardingAddress(final String forwardingAddress) { this.forwardingAddress = forwardingAddress; return this; } - /** - * @param exclusive the exclusive to set - */ public DivertConfiguration setExclusive(final boolean exclusive) { this.exclusive = exclusive; return this; } - /** - * @param filterString the filterString to set - */ public DivertConfiguration setFilterString(final String filterString) { this.filterString = filterString; return this; } - /** - * @param transformerConfiguration the transformerConfiguration to set - */ public DivertConfiguration setTransformerConfiguration(final TransformerConfiguration transformerConfiguration) { this.transformerConfiguration = transformerConfiguration; return this; } - /** - * @param routingType the routingType to set - */ public DivertConfiguration setRoutingType(final ComponentConfigurationRoutingType routingType) { this.routingType = routingType; return this; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/FileDeploymentManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/FileDeploymentManager.java index 47898a1843d..7583cd82911 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/FileDeploymentManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/FileDeploymentManager.java @@ -50,9 +50,9 @@ public FileDeploymentManager(String configurationUrl) { this.configurationUrl = configurationUrl; } - /* - * parse a set of configuration with the Deployables that were given. - */ + /** + * Parse a set of configuration with the {@link Deployable}s that were given. + */ public void readConfiguration() throws Exception { URL url; @@ -83,9 +83,9 @@ public void readConfiguration() throws Exception { } } - /* - * Build a set of ActiveMQComponents from the Deployables configured - */ + /** + * Build a set of {@link ActiveMQComponent}s from the {@link Deployable}s configured + */ public Map buildService(ActiveMQSecurityManager securityManager, MBeanServer mBeanServer, ActivateCallback activateCallback) throws Exception { Map components = new HashMap<>(); @@ -98,9 +98,9 @@ public Map buildService(ActiveMQSecurityManager secur return components; } - /* - * add a Deployable to be configured - */ + /** + * Add a {@link Deployable} to be configured + */ public FileDeploymentManager addDeployable(Deployable deployable) { deployables.put(deployable.getRootElement(), deployable); return this; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/WildcardConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/WildcardConfiguration.java index d8b9f5de8be..f99734e60ae 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/WildcardConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/WildcardConfiguration.java @@ -144,11 +144,11 @@ public WildcardConfiguration setSingleWord(char singleWord) { /** * Convert the input from this WildcardConfiguration into the specified WildcardConfiguration. - * - * If the input already contains characters defined in the target WildcardConfiguration then those characters will - * be escaped and preserved as such in the returned String. That said, wildcard characters which are the same - * between the two configurations will not be escaped - * + *

            + * If the input already contains characters defined in the target WildcardConfiguration then those characters will be + * escaped and preserved as such in the returned String. That said, wildcard characters which are the same between + * the two configurations will not be escaped + *

            * If the input already contains escaped characters defined in this WildcardConfiguration then those characters will * be unescaped after conversion and restored in the returned String. * @@ -212,8 +212,8 @@ private boolean isEscaped(final String input) { /** * This will replace one character with another while ignoring escaped characters (i.e. those proceeded with '\'). * - * @param result the final result of the replacement - * @param replace the character to replace + * @param result the final result of the replacement + * @param replace the character to replace * @param replacement the replacement character to use */ private void replaceChar(StringBuilder result, char replace, char replacement) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPFederatedBrokerConnectionElement.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPFederatedBrokerConnectionElement.java index 8e5975df8a8..df5c7bf4b95 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPFederatedBrokerConnectionElement.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPFederatedBrokerConnectionElement.java @@ -57,17 +57,15 @@ public AMQPFederatedBrokerConnectionElement setType(AMQPBrokerConnectionAddressT } /** - * @return the configured remote address policy set. + * @return the configured remote address policy set */ public Set getRemoteAddressPolicies() { return remoteAddressPolicies; } /** - * @param remoteAddressPolicy - * the policy to add to the set of remote address policies set - * - * @return this configuration element instance. + * @param remoteAddressPolicy the policy to add to the set of remote address policies set + * @return this configuration element instance */ public AMQPFederatedBrokerConnectionElement addRemoteAddressPolicy(AMQPFederationAddressPolicyElement remoteAddressPolicy) { this.remoteAddressPolicies.add(remoteAddressPolicy); @@ -75,17 +73,15 @@ public AMQPFederatedBrokerConnectionElement addRemoteAddressPolicy(AMQPFederatio } /** - * @return the configured remote queue policy set. + * @return the configured remote queue policy set */ public Set getRemoteQueuePolicies() { return remoteQueuePolicies; } /** - * @param remoteQueuePolicy - * the policy to add to the set of remote queue policies set - * - * @return this configuration element instance. + * @param remoteQueuePolicy the policy to add to the set of remote queue policies set + * @return this configuration element instance */ public AMQPFederatedBrokerConnectionElement addRemoteQueuePolicy(AMQPFederationQueuePolicyElement remoteQueuePolicy) { this.remoteQueuePolicies.add(remoteQueuePolicy); @@ -93,17 +89,15 @@ public AMQPFederatedBrokerConnectionElement addRemoteQueuePolicy(AMQPFederationQ } /** - * @return the configured local address policy set. + * @return the configured local address policy set */ public Set getLocalAddressPolicies() { return localAddressPolicies; } /** - * @param localAddressPolicy - * the policy to add to the set of local address policies set - * - * @return this configuration element instance. + * @param localAddressPolicy the policy to add to the set of local address policies set + * @return this configuration element instance */ public AMQPFederatedBrokerConnectionElement addLocalAddressPolicy(AMQPFederationAddressPolicyElement localAddressPolicy) { this.localAddressPolicies.add(localAddressPolicy); @@ -111,17 +105,15 @@ public AMQPFederatedBrokerConnectionElement addLocalAddressPolicy(AMQPFederation } /** - * @return the configured local queue policy set. + * @return the configured local queue policy set */ public Set getLocalQueuePolicies() { return localQueuePolicies; } /** - * @param localQueuePolicy - * the policy to add to the set of local queue policies set - * - * @return this configuration element instance. + * @param localQueuePolicy the policy to add to the set of local queue policies set + * @return this configuration element instance */ public AMQPFederatedBrokerConnectionElement addLocalQueuePolicy(AMQPFederationQueuePolicyElement localQueuePolicy) { this.localQueuePolicies.add(localQueuePolicy); @@ -131,12 +123,9 @@ public AMQPFederatedBrokerConnectionElement addLocalQueuePolicy(AMQPFederationQu /** * Adds the given property key and value to the federation configuration element. * - * @param key - * The key that identifies the property - * @param value - * The value associated with the property key. - * - * @return this configuration element instance. + * @param key The key that identifies the property + * @param value The value associated with the property key. + * @return this configuration element instance */ public AMQPFederatedBrokerConnectionElement addProperty(String key, String value) { properties.put(key, value); @@ -146,12 +135,9 @@ public AMQPFederatedBrokerConnectionElement addProperty(String key, String value /** * Adds the given property key and value to the federation configuration element. * - * @param key - * The key that identifies the property - * @param value - * The value associated with the property key. - * - * @return this configuration element instance. + * @param key The key that identifies the property + * @param value The value associated with the property key. + * @return this configuration element instance */ public AMQPFederatedBrokerConnectionElement addProperty(String key, Number value) { properties.put(key, value); @@ -159,7 +145,7 @@ public AMQPFederatedBrokerConnectionElement addProperty(String key, Number value } /** - * @return the collection of configuration properties associated with this federation element. + * @return the collection of configuration properties associated with this federation element */ public Map getProperties() { return properties; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPFederationBrokerPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPFederationBrokerPlugin.java index 711ca0ab9b2..52949aa90ec 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPFederationBrokerPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPFederationBrokerPlugin.java @@ -20,9 +20,8 @@ import org.apache.activemq.artemis.core.server.plugin.ActiveMQServerBasePlugin; /** - * Marker interface for AMQP Federation broker plugins which allows for the decoupling - * of the actual AMQP federation broker plugin API as the AMQP protocol module may not - * always be present on the classpath for a broker install. + * Marker interface for AMQP Federation broker plugins which allows for the decoupling of the actual AMQP federation + * broker plugin API as the AMQP protocol module may not always be present on the classpath for a broker install. */ public interface AMQPFederationBrokerPlugin extends ActiveMQServerBasePlugin { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPMirrorBrokerConnectionElement.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPMirrorBrokerConnectionElement.java index 944099c2a00..eb147107348 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPMirrorBrokerConnectionElement.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/amqpBrokerConnectivity/AMQPMirrorBrokerConnectionElement.java @@ -55,8 +55,10 @@ public AMQPMirrorBrokerConnectionElement() { this.setType(AMQPBrokerConnectionAddressType.MIRROR); } - /** There is no setter for this property. - * Basically by setting a sourceMirrorAddress we are automatically setting this to true. */ + /** + * There is no setter for this property. Basically by setting a sourceMirrorAddress we are automatically setting this + * to true. + */ public boolean isDurable() { return durable; } @@ -120,12 +122,9 @@ public AMQPMirrorBrokerConnectionElement setSync(boolean sync) { /** * Adds the given property key and value to the mirror broker configuration element. * - * @param key - * The key that identifies the property - * @param value - * The value associated with the property key. - * - * @return this configuration element instance. + * @param key The key that identifies the property + * @param value The value associated with the property key. + * @return this configuration element instance */ public AMQPMirrorBrokerConnectionElement addProperty(String key, String value) { properties.put(key, value); @@ -135,12 +134,9 @@ public AMQPMirrorBrokerConnectionElement addProperty(String key, String value) { /** * Adds the given property key and value to the mirror broker configuration element. * - * @param key - * The key that identifies the property - * @param value - * The value associated with the property key. - * - * @return this configuration element instance. + * @param key The key that identifies the property + * @param value The value associated with the property key. + * @return this configuration element instance */ public AMQPMirrorBrokerConnectionElement addProperty(String key, Number value) { properties.put(key, value); @@ -148,7 +144,7 @@ public AMQPMirrorBrokerConnectionElement addProperty(String key, Number value) { } /** - * @return the collection of configuration properties associated with this mirror configuration element. + * @return the collection of configuration properties associated with this mirror configuration element */ public Map getProperties() { return properties; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/brokerConnectivity/BrokerConnectConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/brokerConnectivity/BrokerConnectConfiguration.java index c6055e137a4..e7b6936c987 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/brokerConnectivity/BrokerConnectConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/brokerConnectivity/BrokerConnectConfiguration.java @@ -21,10 +21,9 @@ /** * This is base class for outgoing broker configuration types. - * - * This is a new feature that at the time we introduced, is only being used for AMQP. - * Where the broker will create a connection towards another broker using a specific - * protocol. + *

            + * This is a new feature that at the time we introduced, is only being used for AMQP. Where the broker will create a + * connection towards another broker using a specific protocol. */ public abstract class BrokerConnectConfiguration implements Serializable { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ha/ReplicaPolicyConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ha/ReplicaPolicyConfiguration.java index b02ace5c3a8..fc1b716e006 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ha/ReplicaPolicyConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ha/ReplicaPolicyConfiguration.java @@ -32,9 +32,7 @@ public class ReplicaPolicyConfiguration implements HAPolicyConfiguration { private ScaleDownConfiguration scaleDownConfiguration; - /* - * used in the replicated policy after failover - * */ + // used in the replicated policy after failover private boolean allowFailBack = false; private long initialReplicationSyncTimeout = ActiveMQDefaultConfiguration.getDefaultInitialReplicationSyncTimeout(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ha/ReplicationBackupPolicyConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ha/ReplicationBackupPolicyConfiguration.java index 2b479481281..87921ddeef2 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ha/ReplicationBackupPolicyConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ha/ReplicationBackupPolicyConfiguration.java @@ -27,9 +27,7 @@ public class ReplicationBackupPolicyConfiguration implements HAPolicyConfigurati private String groupName = null; - /* - * used in the replicated policy after failover - * */ + // used in the replicated policy after failover private boolean allowFailBack = false; private long initialReplicationSyncTimeout = ActiveMQDefaultConfiguration.getDefaultInitialReplicationSyncTimeout(); 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 d5df6bb886d..9564365569f 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 @@ -1097,9 +1097,6 @@ public ConfigurationImpl setFileDeployerScanPeriod(final long period) { return this; } - /** - * @return the persistDeliveryCountBeforeDelivery - */ @Override public boolean isPersistDeliveryCountBeforeDelivery() { return persistDeliveryCountBeforeDelivery; @@ -1439,9 +1436,6 @@ public List getQueueConfigurations() { } @Override - /** - * Note: modifying the returned {@code List} will not impact the underlying {@code List}. - */ public List getQueueConfigs() { List result = new ArrayList<>(); for (CoreQueueConfiguration coreQueueConfiguration : coreQueueConfigurations) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/FileConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/FileConfiguration.java index 1c253efe5d2..cb1c2ee30f9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/FileConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/FileConfiguration.java @@ -48,9 +48,8 @@ public final class FileConfiguration extends ConfigurationImpl implements Deploy public void parse(Element config, URL url) throws Exception { FileConfigurationParser parser = new FileConfigurationParser(); - // https://jira.jboss.org/browse/HORNETQ-478 - We only want to validate AIO when - // starting the server - // and we don't want to do it when deploying activemq-queues.xml which uses the same parser and XML format + // We only want to validate AIO when starting the server and we don't want to do it when deploying + // activemq-queues.xml which uses the same parser and XML format. parser.setValidateAIO(true); parser.parseMainConfig(config, this); 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 e4bb54d81ee..aa62aefc6a9 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 @@ -136,9 +136,6 @@ public void parseConfiguration(final Node rootnode) throws Exception { /** * Parse the topic node as a TopicConfiguration object - * - * @param node - * @throws Exception */ public void parseTopicConfiguration(final Node node) throws Exception { String topicName = node.getAttributes().getNamedItem(NAME_ATTR).getNodeValue(); @@ -149,9 +146,6 @@ public void parseTopicConfiguration(final Node node) throws Exception { /** * Parse the Queue Configuration node as a QueueConfiguration object - * - * @param node - * @throws Exception */ public void parseQueueConfiguration(final Node node) throws Exception { Element e = (Element) node; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/SecurityConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/SecurityConfiguration.java index 9ed1a86114f..d3d5aaf9407 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/SecurityConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/SecurityConfiguration.java @@ -29,16 +29,10 @@ public class SecurityConfiguration extends Configuration { - /** - * the current valid users - */ protected final Map users = new HashMap<>(); protected String defaultUser = null; - /** - * the roles for the users - */ protected final Map> roles = new HashMap<>(); public SecurityConfiguration() { @@ -84,9 +78,9 @@ public void removeRole(final String user, final String role) { roles.get(user).remove(role); } - /* - * set the default user for null users - */ + /** + * Set the default user for null users. + */ public void setDefaultUser(final String username) { defaultUser = username; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/storage/DatabaseStorageConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/storage/DatabaseStorageConfiguration.java index dbe0f965225..011efff74d0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/storage/DatabaseStorageConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/storage/DatabaseStorageConfiguration.java @@ -162,9 +162,10 @@ public DatabaseStorageConfiguration setMaxPageSizeBytes(int maxPageSizeBytes) { } /** - * The DataSource to use to store Artemis data in the data store (can be {@code null} if {@code jdbcConnectionUrl} and {@code jdbcDriverClassName} are used instead). + * The DataSource to use to store Artemis data in the data store (can be {@code null} if {@code jdbcConnectionUrl} + * and {@code jdbcDriverClassName} are used instead). * - * @return the DataSource used to store Artemis data in the JDBC data store. + * @return the DataSource used to store Artemis data in the JDBC data store */ private DataSource getDataSource() { if (dataSource == null) { @@ -203,8 +204,6 @@ private DataSource getDataSource() { /** * Configure the DataSource to use to store Artemis data in the data store. - * - * @param dataSource */ public void setDataSource(DataSource dataSource) { this.dataSource = dataSource; @@ -264,11 +263,12 @@ public void setDataSourceClassName(String dataSourceClassName) { } /** - * The {@link SQLProvider.Factory} used to communicate with the JDBC data store. - * It can be {@code null}. If the value is {@code null} and {@code dataSource} is set, the {@code {@link org.apache.activemq.artemis.jdbc.store.sql.PropertySQLProvider.Factory}} will be used, - * else the type of the factory will be determined based on the {@code jdbcDriverClassName}. + * The {@link SQLProvider.Factory} used to communicate with the JDBC data store. It can be {@code null}. If the value + * is {@code null} and {@code dataSource} is set, the + * {@code {@link org.apache.activemq.artemis.jdbc.store.sql.PropertySQLProvider.Factory}} will be used, else the type + * of the factory will be determined based on the {@code jdbcDriverClassName}. * - * @return the factory used to communicate with the JDBC data store. + * @return the factory used to communicate with the JDBC data store */ public SQLProvider.Factory getSqlProviderFactory() { return sqlProviderFactory; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/Deployable.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/Deployable.java index d151a4912eb..a061360a556 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/Deployable.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/Deployable.java @@ -26,34 +26,35 @@ import org.w3c.dom.Element; /** - * A Deployable is an object that can be configured via an xml configuration element in the main configuration file "broker.xml" - * It holds all the information needed by the FileDeploymentManager to parse the configuration and build the component + * A Deployable is an object that can be configured via an xml configuration element in the main configuration file + * "broker.xml" It holds all the information needed by the FileDeploymentManager to parse the configuration and build + * the component */ public interface Deployable { - /* - * parse the element from the xml configuration - */ + /** + * parse the element from the xml configuration + */ void parse(Element config, URL url) throws Exception; - /* - * has this Deployable been parsed - */ + /** + * has this Deployable been parsed + */ boolean isParsed(); - /* - * The name of the root xml element for this Deployable, i.e. core or jms - */ + /** + * The name of the root xml element for this Deployable, i.e. core or jms + */ String getRootElement(); - /* - * The schema that should be used to validate the xml - */ + /** + * The schema that should be used to validate the xml + */ String getSchema(); - /* - * builds the service. The implementation should add a component to the components map passed in if it needs to. - */ + /** + * builds the service. The implementation should add a component to the components map passed in if it needs to. + */ void buildService(ActiveMQSecurityManager securityManager, MBeanServer mBeanServer, Map deployables, 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 48ba1456f9a..5e5a0dfa516 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 @@ -188,7 +188,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { private static final String DELETE_NON_DURABLE_QUEUE_NAME = "deleteNonDurableQueue"; - // HORNETQ-309 we keep supporting these attribute names for compatibility + // We keep supporting these attribute names for compatibility private static final String CREATETEMPQUEUE_NAME = "createTempQueue"; private static final String DELETETEMPQUEUE_NAME = "deleteTempQueue"; @@ -398,16 +398,10 @@ public final class FileConfigurationParser extends XMLConfigurationUtil { private boolean printPageMaxSizeUsed = false; - /** - * @return the validateAIO - */ public boolean isValidateAIO() { return validateAIO; } - /** - * @param validateAIO the validateAIO to set - */ public void setValidateAIO(final boolean validateAIO) { this.validateAIO = validateAIO; } @@ -755,10 +749,8 @@ public void parseMainConfig(final Element e, final Configuration config) throws config.setJournalType(JournalType.getType(s)); if (config.getJournalType() == JournalType.ASYNCIO) { - // https://jira.jboss.org/jira/browse/HORNETQ-295 - // We do the check here to see if AIO is supported so we can use the correct defaults and/or use - // correct settings in xml - // If we fall back later on these settings can be ignored + // We do the check here to see if AIO is supported so we can use the correct defaults and/or use correct + // settings in xml. If we fall back later on these settings can be ignored. boolean supportsAIO = AIOSequentialFileFactory.isSupported(); if (!supportsAIO) { @@ -947,10 +939,6 @@ private void parseJournalRetention(final Element e, final Configuration config) } } - /** - * @param e - * @param config - */ private void parseSecurity(final Element e, final Configuration config) throws Exception { NodeList elements = e.getElementsByTagName("security-settings"); if (elements.getLength() != 0) { @@ -1013,10 +1001,6 @@ private Map getMapOfChildPropertyElements(Node item) { return properties; } - /** - * @param e - * @param config - */ private void parseMetrics(final Element e, final Configuration config) { NodeList metrics = e.getElementsByTagName("metrics"); NodeList metricsPlugin = e.getElementsByTagName("metrics-plugin"); @@ -1078,10 +1062,6 @@ private ActiveMQMetricsPlugin parseMetricsPlugin(final Node item, final Configur return metricsPlugin; } - /** - * @param e - * @param config - */ private void parseQueues(final Element e, final Configuration config) { NodeList elements = e.getElementsByTagName("queues"); if (elements.getLength() != 0) { @@ -1102,10 +1082,6 @@ private List parseQueueConfigurations(final Element node, Ro return queueConfigurations; } - /** - * @param e - * @param config - */ private void parseAddresses(final Element e, final Configuration config) { NodeList elements = e.getElementsByTagName("addresses"); @@ -1118,10 +1094,6 @@ private void parseAddresses(final Element e, final Configuration config) { } } - /** - * @param e - * @param config - */ private void parseAddressSettings(final Element e, final Configuration config) { NodeList elements = e.getElementsByTagName("address-settings"); @@ -1140,10 +1112,6 @@ private void parseAddressSettings(final Element e, final Configuration config) { } } - /** - * @param e - * @param config - */ private void parseResourceLimits(final Element e, final Configuration config) { NodeList elements = e.getElementsByTagName("resource-limit-settings"); @@ -1156,10 +1124,6 @@ private void parseResourceLimits(final Element e, final Configuration config) { } } - /** - * @param node - * @return - */ protected Pair> parseSecurityRoles(final Node node, final Map> roleMappings) { final String match = node.getAttributes().getNamedItem("match").getNodeValue(); @@ -1238,7 +1202,8 @@ protected Pair> parseSecurityRoles(final Node node, final Map< /** * Translate and expand a set of role names to a set of mapped role names, also includes the original role names - * @param roles the original set of role names + * + * @param roles the original set of role names * @param roleMappings a one-to-many mapping of original role names to mapped role names * @return the final set of mapped role names */ @@ -1276,14 +1241,19 @@ private Pair> parseSecuritySettingPlu } /** - * Computes the map of internal ActiveMQ role names to sets of external (e.g. LDAP) role names. For example, given a role - * "myrole" with a DN of "cn=myrole,dc=local,dc=com": + * Computes the map of internal ActiveMQ role names to sets of external (e.g. LDAP) role names. For example, given a + * role "myrole" with a DN of "cn=myrole,dc=local,dc=com": + *

            {@code
                 *      from="cn=myrole,dc=local,dc=com", to="amq,admin,guest"
                 *      from="cn=myOtherRole,dc=local,dc=com", to="amq"
            +    * }
            * The resulting map will consist of: + *
            {@code
                 *      amq => {"cn=myrole,dc=local,dc=com","cn=myOtherRole",dc=local,dc=com"}
                 *      admin => {"cn=myrole,dc=local,dc=com"}
                 *      guest => {"cn=myrole,dc=local,dc=com"}
            +    * }
            + * * @param item the role-mapping node * @return the map of local ActiveMQ role names to the set of mapped role names */ @@ -1307,10 +1277,6 @@ private Map> parseSecurityRoleMapping(Node item) { return mappedRoleNames; } - /** - * @param node - * @return - */ protected Pair parseAddressSettings(final Node node) { String match = getAttributeValue(node, "match"); @@ -1489,10 +1455,6 @@ protected Pair parseAddressSettings(final Node node) { return setting; } - /** - * @param node - * @return - */ protected ResourceLimitSettings parseResourceLimitSettings(final Node node) { ResourceLimitSettings resourceLimitSettings = new ResourceLimitSettings(); @@ -2964,9 +2926,6 @@ private void parsePoolConfiguration(final Element e, final Configuration config, } } - /**RedirectConfiguration - * @param e - */ protected void parseWildcardConfiguration(final Element e, final Configuration mainConfig) { WildcardConfiguration conf = mainConfig.getWildcardConfiguration(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/Filter.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/Filter.java index 55c93461cb5..013f73173f5 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/Filter.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/Filter.java @@ -24,11 +24,10 @@ public interface Filter { /** - * JMS Topics (which are outside of the scope of the core API) will require a dumb subscription - * with a dummy-filter at this current version as a way to keep its existence valid and TCK - * tests. That subscription needs an invalid filter, however paging needs to ignore any - * subscription with this filter. For that reason, this filter needs to be rejected on paging or - * any other component on the system, and just be ignored for any purpose It's declared here as + * JMS Topics (which are outside of the scope of the core API) will require a dumb subscription with a dummy-filter + * at this current version as a way to keep its existence valid and TCK tests. That subscription needs an invalid + * filter, however paging needs to ignore any subscription with this filter. For that reason, this filter needs to be + * rejected on paging or any other component on the system, and just be ignored for any purpose It's declared here as * this filter is considered a global ignore */ String GENERIC_IGNORED_FILTER = "__AMQX=-1"; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/FilterUtils.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/FilterUtils.java index 776efb973bd..dfd7e88f59f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/FilterUtils.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/FilterUtils.java @@ -23,10 +23,10 @@ private FilterUtils() { } /** - * Returns {@code true} if {@code filter} is a {@link org.apache.activemq.artemis.core.filter.Filter#GENERIC_IGNORED_FILTER}. + * {@return {@code true} if {@code filter} is not {@code null} and is a {@link + * org.apache.activemq.artemis.core.filter.Filter#GENERIC_IGNORED_FILTER}} * * @param filter a subscription filter - * @return {@code true} if {@code filter} is not {@code null} and is a {@link org.apache.activemq.artemis.core.filter.Filter#GENERIC_IGNORED_FILTER} */ public static boolean isTopicIdentification(final Filter filter) { return filter != null && filter.getFilterString() != null && filter.getFilterString().toString().equals(Filter.GENERIC_IGNORED_FILTER); 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 b1232161300..0f6940a5053 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 @@ -39,21 +39,20 @@ /** * This class implements an ActiveMQ Artemis filter - * + *

            * ActiveMQ Artemis filters have the same syntax as JMS 1.1 selectors, but the identifiers are different. - * + *

            * Valid identifiers that can be used are: - * - * AMQPriority - the priority of the message - * AMQTimestamp - the timestamp of the message - * AMQDurable - "DURABLE" or "NON_DURABLE" - * AMQExpiration - the expiration of the message - * AMQSize - the encoded size of the full message in bytes - * AMQUserID - the user specified ID string (if any) - * Any other identifiers that appear in a filter expression represent header values for the message - * - * String values must be set as SimpleString, not java.lang.String (see JBMESSAGING-1307). - * Derived from JBoss MQ version by + *

              + *
            • {@code AMQPriority} - the priority of the message + *
            • {@code AMQTimestamp} - the timestamp of the message + *
            • {@code AMQDurable} - "DURABLE" or "NON_DURABLE" + *
            • {@code AMQExpiration} - the expiration of the message + *
            • {@code AMQSize} - the encoded size of the full message in bytes + *
            • {@code AMQUserID} - the user specified ID string (if any) + *
            • Any other identifiers that appear in a filter expression represent header values for the message + *
            + * String values must be set as {@code SimpleString}, not {@code java.lang.String} */ public class FilterImpl implements Filter { @@ -63,9 +62,8 @@ public class FilterImpl implements Filter { private final BooleanExpression booleanExpression; - /** - * @return null if filterStr is null or an empty String and a valid filter else + * {@return null if {@code filterStr} is null or an empty String and a valid filter else} * @throws ActiveMQException if the string does not correspond to a valid filter */ public static Filter createFilter(final String filterStr) throws ActiveMQException { @@ -73,7 +71,7 @@ public static Filter createFilter(final String filterStr) throws ActiveMQExcepti } /** - * @return null if filterStr is null or an empty String and a valid filter else + * {@return null if {@code filterStr} is null or an empty String and a valid filter else} * @throws ActiveMQException if the string does not correspond to a valid filter */ public static Filter createFilter(final SimpleString filterStr) throws ActiveMQException { 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 65eb592688e..94e451f1a62 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 @@ -2491,9 +2491,6 @@ public String[] listSessions(final String connectionID) { } } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.api.core.management.ActiveMQServerControl#listProducersInfoAsJSON() - */ @Override public String listProducersInfoAsJSON() throws Exception { if (AuditLogger.isBaseLoggingEnabled()) { @@ -3464,7 +3461,6 @@ public void addAddressSettings(final String address, } checkStarted(); - // JBPAPP-6334 requested this to be pageSizeBytes > maxSizeBytes if (pageSizeBytes > maxSizeBytes && maxSizeBytes > 0) { throw new IllegalStateException("pageSize has to be lower than maxSizeBytes. Invalid argument (" + pageSizeBytes + " < " + maxSizeBytes + ")"); } @@ -3553,7 +3549,6 @@ public String addAddressSettings(String address, String addressSettingsConfigura if (addressSettingsConfiguration == null) { throw ActiveMQMessageBundle.BUNDLE.failedToParseJson(addressSettingsConfigurationAsJson); } - // JBPAPP-6334 requested this to be pageSizeBytes > maxSizeBytes if (addressSettingsConfiguration.getPageSizeBytes() > addressSettingsConfiguration.getMaxSizeBytes() && addressSettingsConfiguration.getMaxSizeBytes() > 0) { throw new IllegalStateException("pageSize has to be lower than maxSizeBytes. Invalid argument (" + addressSettingsConfiguration.getPageSizeBytes() + " < " + addressSettingsConfiguration.getMaxSizeBytes() + ")"); } 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 fc715174a5a..a0f8fed8ab9 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 @@ -779,10 +779,6 @@ public String listScheduledMessagesAsJSON() throws Exception { } } - /** - * @param refs - * @return - */ private Map[] convertMessagesToMaps(List refs) throws ActiveMQException { final int attributeSizeLimit = addressSettingsRepository.getMatch(address).getManagementMessageAttributeSizeLimit(); Map[] messages = new Map[refs.size()]; @@ -885,12 +881,11 @@ public String listMessagesAsJSON(final String filter) throws Exception { } /** - * this method returns a Map representing the first message. - * or null if there's no first message. - * @return - * @throws Exception + * this method returns a Map representing the first message. or null if there's no first message. + * * @deprecated Use {@link #peekFirstMessage()} instead. */ + @Deprecated protected Map getFirstMessage() throws Exception { if (AuditLogger.isBaseLoggingEnabled()) { AuditLogger.getFirstMessage(queue); @@ -913,8 +908,8 @@ protected Map getFirstMessage() throws Exception { } /** - * this method returns a Map representing the first message. - * or null if there's no first message. + * this method returns a Map representing the first message. or null if there's no first message. + * * @return A result of {@link Message#toMap()} */ protected Map peekFirstMessage() { @@ -938,8 +933,8 @@ protected Map peekFirstMessage() { } /** - * this method returns a Map representing the first scheduled message. - * or null if there's no first message. + * this method returns a Map representing the first scheduled message. or null if there's no first message. + * * @return A result of {@link Message#toMap()} */ protected Map peekFirstScheduledMessage() { @@ -966,6 +961,7 @@ protected Map peekFirstScheduledMessage() { * @deprecated Use {@link #peekFirstMessageAsJSON()} instead. */ @Override + @Deprecated public String getFirstMessageAsJSON() throws Exception { if (AuditLogger.isBaseLoggingEnabled()) { AuditLogger.getFirstMessageAsJSON(queue); @@ -978,7 +974,8 @@ public String getFirstMessageAsJSON() throws Exception { /** * Uses {@link #peekFirstMessage()} and returns the result as JSON. - * @return A {@link Message} instance as a JSON object, or "null" if there's no such message. + * + * @return A {@link Message} instance as a JSON object, or {@code "null"} if there's no such message */ @Override public String peekFirstMessageAsJSON() { @@ -994,7 +991,8 @@ public String peekFirstMessageAsJSON() { /** * Uses {@link #peekFirstScheduledMessage()} and returns the result as JSON. - * @return A {@link Message} instance as a JSON object, or "null" if there's no such message. + * + * @return A {@link Message} instance as a JSON object, or {@code "null"} if there's no such message */ @Override public String peekFirstScheduledMessageAsJSON() { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ActiveMQAbstractView.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ActiveMQAbstractView.java index 8b413fd08c1..627a29b15d1 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ActiveMQAbstractView.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ActiveMQAbstractView.java @@ -172,9 +172,6 @@ public String getSortOrder() { /** * JsonObjectBuilder will throw an NPE if a null value is added. For this reason we check for null explicitly when * adding objects. - * - * @param o - * @return */ protected String toString(Object o) { return o == null ? "" : o.toString(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConsumerField.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConsumerField.java index f7c689e5013..122ec3c4113 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConsumerField.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ConsumerField.java @@ -64,8 +64,9 @@ public String getName() { } /** - * There is some inconsistency with some json objects returned for consumers because they were hard coded. - * This is just to track the differences and provide backward compatibility. + * There is some inconsistency with some json objects returned for consumers because they were hard coded. This is + * just to track the differences and provide backward compatibility. + * * @return the old alternative name */ public String getAlternativeName() { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ProducerField.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ProducerField.java index 075f2ccf307..14e55c7ee42 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ProducerField.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/view/ProducerField.java @@ -53,8 +53,9 @@ public String getName() { } /** - * There is some inconsistency with some json objects returned for consumers because they were hard coded. - * This is just to track the differences and provide backward compatibility. + * There is some inconsistency with some json objects returned for consumers because they were hard coded. This is + * just to track the differences and provide backward compatibility. + * * @return the old alternative name */ public String getAlternativeName() { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java index 24399618aeb..23ccfdae6f9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/MessageCounter.java @@ -29,12 +29,11 @@ /** * This class stores message count informations for a given queue - * + *

            * At intervals this class samples the queue for message count data - * - * Note that the underlying queue *does not* update statistics every time a message - * is added since that would reall slow things down, instead we *sample* the queues at - * regular intervals - this means we are less intrusive on the queue + *

            + * Note that the underlying queue *does not* update statistics every time a message is added since that would reall slow + * things down, instead we *sample* the queues at regular intervals - this means we are less intrusive on the queue */ public class MessageCounter { @@ -72,7 +71,6 @@ public class MessageCounter { private long lastMessagesAcked; - /** * Constructor * @@ -139,7 +137,7 @@ public void run() { }; - /* + /** * This method is called periodically to update statistics from the queue */ public synchronized void onTimer() { @@ -167,8 +165,7 @@ public boolean isDestinationDurable() { } /** - * Gets the total message count since startup or - * last counter reset + * Gets the total message count since startup or last counter reset */ public long getCount() { return countTotal; @@ -186,16 +183,14 @@ public long getCountDelta() { } /** - * Gets the current message count of pending messages - * within the destination waiting for dispatch + * Gets the current message count of pending messages within the destination waiting for dispatch */ public long getMessageCount() { return serverQueue.getMessageCount(); } /** - * Gets the message count delta of pending messages - * since last method call. + * Gets the message count delta of pending messages since last method call. */ public long getMessageCountDelta() { long current = serverQueue.getMessageCount(); @@ -279,14 +274,14 @@ public List getHistory() { /** * Get message counter history data as string in format - * - * "day count\n - * Date 1, hour counter 0, hour counter 1, ..., hour counter 23\n - * Date 2, hour counter 0, hour counter 1, ..., hour counter 23\n + *

            +    * day count
            +    * Date 1, hour counter 0, hour counter 1, ..., hour counter 23
            +    * Date 2, hour counter 0, hour counter 1, ..., hour counter 23
                 * .....
                 * .....
            -    * Date n, hour counter 0, hour counter 1, ..., hour counter 23\n"
            -    *
            +    * Date n, hour counter 0, hour counter 1, ..., hour counter 23
            +    * 
            * @return String message history data string */ public String getHistoryAsString() { @@ -324,9 +319,7 @@ public String toString() { } /** - * Returns a JSON String serialization of a {@link MessageCounter} object. - * - * @return + * {@return a JSON String serialization of a {@link MessageCounter} object} */ public String toJSon() { DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM); @@ -349,9 +342,6 @@ public String toJSon() { .toString(); } - - - /** * Update message counter history * @@ -438,8 +428,7 @@ public static final class DayCounter { * Constructor * * @param date day counter date - * @param isStartDay true first day counter - * false follow up day counter + * @param isStartDay true first day counter false follow up day counter */ DayCounter(final GregorianCalendar date, final boolean isStartDay) { // store internal copy of creation date @@ -537,8 +526,10 @@ private void finalizeDayCounter() { } /** - * Return day counter data as string with format
            - * "Date, hour counter 0, hour counter 1, ..., hour counter 23". + * Return day counter data as string with format + *
            +       * Date, hour counter 0, hour counter 1, ..., hour counter 23
            +       * 
            * * @return String day counter data */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterManagerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterManagerImpl.java index 03470f5df41..e896be5f6bd 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterManagerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/messagecounter/impl/MessageCounterManagerImpl.java @@ -29,9 +29,6 @@ import org.apache.activemq.artemis.core.messagecounter.MessageCounterManager; import org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent; -/** - * A MessageCounterManager - */ public class MessageCounterManagerImpl implements MessageCounterManager { public static final long DEFAULT_SAMPLE_PERIOD = ActiveMQDefaultConfiguration.getDefaultMessageCounterSamplePeriod(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PageTransactionInfo.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PageTransactionInfo.java index 9692e2b7a6b..cb22e96b21d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PageTransactionInfo.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PageTransactionInfo.java @@ -33,8 +33,10 @@ public interface PageTransactionInfo extends EncodingSupport { void reloadPrepared(Transaction transaction); - /* When we reload a transaction, - * We may have to add the counters after commit. */ + /* + * When we reload a transaction, + * We may have to add the counters after commit. + */ Transaction getPreparedTransaction(); void commit(); @@ -66,14 +68,16 @@ void reloadUpdate(StorageManager storageManager, int getNumberOfMessages(); /** - * This method will hold the position to be delivered later in case this transaction is pending. - * If the tx is not pending, it will return false, so the caller can deliver it right away + * This method will hold the position to be delivered later in case this transaction is pending. If the tx is not + * pending, it will return false, so the caller can deliver it right away * * @return true if the message will be delivered later, false if it should be delivered right away */ boolean deliverAfterCommit(PageIterator pageIterator, PageSubscription cursor, PagedReference pagedMessage); - /** Used on PageRebuildManager to cleanup orphaned Page Transactions */ + /** + * Used on PageRebuildManager to cleanup orphaned Page Transactions + */ boolean isOrphaned(); PageTransactionInfo setOrphaned(boolean orphaned); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagedMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagedMessage.java index 69bff3a5719..83fdae86f3b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagedMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagedMessage.java @@ -25,8 +25,7 @@ /** * A Paged message. *

            - * We can't just record the ServerMessage as we need other information (such as the TransactionID - * used during paging) + * We can't just record the ServerMessage as we need other information (such as the TransactionID used during paging) */ public interface PagedMessage extends EncodingSupport { @@ -44,19 +43,16 @@ public interface PagedMessage extends EncodingSupport { long getTransactionID(); /** - * This is the size of the message when persisted on disk and is used for metrics tracking - * If a normal message it will be the encoded message size - * If a large message it will be encoded message size + large message body size - * @return - * @throws ActiveMQException + * This is the size of the message when persisted on disk and is used for metrics tracking If a normal message it + * will be the encoded message size If a large message it will be encoded message size + large message body size */ long getPersistentSize() throws ActiveMQException; - /** This returns how much the PagedMessage used, or it's going to use - * from storage. - * We can't calculate the encodeSize as some persisters don't guarantee to re-store the data - * at the same amount of bytes it used. In some cases it may need to add headers in AMQP - * or extra data that may affect the outcome of getEncodeSize() */ + /** + * This returns how much the PagedMessage used, or it's going to use from storage. We can't calculate the encodeSize + * as some persisters don't guarantee to re-store the data at the same amount of bytes it used. In some cases it may + * need to add headers in AMQP or extra data that may affect the outcome of getEncodeSize() + */ int getStoredSize(); long getPageNumber(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingManager.java index e17fb803345..2eab3889436 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingManager.java @@ -44,7 +44,7 @@ public interface PagingManager extends ActiveMQComponent, HierarchicalRepositoryChangeListener { /** - * Returns the PageStore associated with the address. A new page store is created if necessary. + * {@return the PageStore associated with the address; a new page store is created if necessary} */ PagingStore getPageStore(SimpleString address) throws Exception; @@ -58,17 +58,12 @@ public interface PagingManager extends ActiveMQComponent, HierarchicalRepository */ PageTransactionInfo getTransaction(long transactionID); - /** - * @param transactionID - */ void removeTransaction(long transactionID); Map getTransactions(); /** * Reload previously created PagingStores into memory - * - * @throws Exception */ void reloadStores() throws Exception; @@ -86,7 +81,9 @@ public interface PagingManager extends ActiveMQComponent, HierarchicalRepository void injectMonitor(FileStoreMonitor monitor) throws Exception; - /** Execute a runnable inside the PagingManager's executor */ + /** + * Execute a runnable inside the PagingManager's executor + */ default void execute(Runnable runnable) { throw new UnsupportedOperationException("not implemented"); } @@ -104,22 +101,20 @@ default void execute(Runnable runnable) { void unlock(); /** - * Add size at the global count level. - * if sizeOnly = true, only the size portion is updated. If false both the counter for bytes and number of messages is updated. + * Add size at the global count level. If sizeOnly = true, only the size portion is updated. If false both the + * counter for bytes and number of messages is updated. */ PagingManager addSize(int size, boolean sizeOnly); /** - * An utility method to call addSize(size, false); - * this is a good fit for an IntConsumer. + * An utility method to call addSize(size, false); this is a good fit for an IntConsumer. */ default PagingManager addSize(int size) { return addSize(size, false); } /** - * An utility method to call addSize(size, true); - * this is a good fit for an IntConsumer. + * An utility method to call addSize(size, true); this is a good fit for an IntConsumer. */ default PagingManager addSizeOnly(int size) { return addSize(size, true); @@ -145,7 +140,6 @@ default long getGlobalMessages() { /** * Use this when you have no refernce of an address. (anonymous AMQP Producers for example) - * @param runWhenAvailable */ void checkMemory(Runnable runWhenAvailable); @@ -153,7 +147,6 @@ default long getGlobalMessages() { /** * Use this when you have no refernce of an address. (anonymous AMQP Producers for example) - * @param runWhenAvailable */ default void checkStorage(Runnable runWhenAvailable) { checkMemory(runWhenAvailable); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingStore.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingStore.java index 1dd8d5ac142..9e3608056b6 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingStore.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/PagingStore.java @@ -39,12 +39,10 @@ import org.apache.activemq.artemis.utils.runnables.AtomicRunnable; /** - *

            * The implementation will take care of details such as PageSize. *

            - * The producers will write directly to PagingStore, and the store will decide what Page file should - * be used based on configured size. - *

            + * The producers will write directly to PagingStore, and the store will decide what Page file should be used based on + * configured size. * * @see PagingManager */ @@ -55,7 +53,7 @@ public interface PagingStore extends ActiveMQComponent, RefCountMessageListener long getNumberOfPages(); /** - * Returns the page id of the current page in which the system is writing files. + * {@return the page id of the current page in which the system is writing files} */ long getCurrentWritingPage(); @@ -79,7 +77,9 @@ default PagingStore enforceAddressFullMessagePolicy(AddressFullMessagePolicy enf Long getPageLimitBytes(); - /** Callback to be used by a counter when the Page is full for that counter */ + /** + * Callback to be used by a counter when the Page is full for that counter + */ void pageFull(PageSubscription subscription); boolean isPageFull(); @@ -106,11 +106,13 @@ default PagingStore enforceAddressFullMessagePolicy(AddressFullMessagePolicy enf void applySetting(AddressSettings addressSettings); - /** This method will look if the current state of paging is not paging, - * without using a lock. - * For cases where you need absolutely atomic results, check it directly on the internal variables while requiring a readLock. - * - * It's ok to look for this with an estimate on starting a task or not, but you will need to recheck on actual paging operations. */ + /** + * This method will look if the current state of paging is not paging, without using a lock. For cases where you need + * absolutely atomic results, check it directly on the internal variables while requiring a readLock. + *

            + * It's ok to look for this with an estimate on starting a task or not, but you will need to recheck on actual paging + * operations. + */ boolean isPaging(); /** @@ -121,8 +123,8 @@ default PagingStore enforceAddressFullMessagePolicy(AddressFullMessagePolicy enf /** * Write message to page if we are paging. * - * @return {@code true} if we are paging and have handled the data, {@code false} if the data - * needs to be sent to the journal + * @return {@code true} if we are paging and have handled the data, {@code false} if the data needs to be sent to the + * journal * @throws NullPointerException if {@code readLock} is null */ boolean page(Message message, Transaction tx, RouteContextList listCtx) throws Exception; @@ -131,7 +133,10 @@ default PagingStore enforceAddressFullMessagePolicy(AddressFullMessagePolicy enf Page usePage(long page); - /** Use this method when you want to use the cache of used pages. If you are just using offline (e.g. print-data), use the newPageObject method.*/ + /** + * Use this method when you want to use the cache of used pages. If you are just using offline (e.g. print-data), use + * the newPageObject method. + */ Page usePage(long page, boolean create); Page usePage(long page, boolean createEntry, boolean createFile); @@ -146,11 +151,11 @@ default PagingStore enforceAddressFullMessagePolicy(AddressFullMessagePolicy enf void processReload() throws Exception; /** - * Remove the first page from the Writing Queue. - * The file will still exist until Page.delete is called, - * So, case the system is reloaded the same Page will be loaded back if delete is not called. + * Remove the first page from the Writing Queue. The file will still exist until Page.delete is called, So, case the + * system is reloaded the same Page will be loaded back if delete is not called. * - * @throws Exception Note: This should still be part of the interface, even though ActiveMQ Artemis only uses through the + * @throws Exception Note: This should still be part of the interface, even though ActiveMQ Artemis only uses through + * the */ Page depage() throws Exception; @@ -164,20 +169,22 @@ default void forceAnotherPage() throws Exception { Page getCurrentPage(); - /** it will save snapshots on the counters */ + /** + * Save snapshots on the counters + */ void counterSnapshot(); /** - * @return true if paging was started, or false if paging was already started before this call + * {@return true if paging was started, or false if paging was already started before this call} */ boolean startPaging() throws Exception; void stopPaging() throws Exception; - /** * + /** + * Add size to this {@code PageStore}. * - * @param size - * @param sizeOnly if false we won't increment the number of messages. (add references for example) + * @param sizeOnly if {@code false} we won't increment the number of messages. (add references for example) */ void addSize(int size, boolean sizeOnly, boolean affectGlobal); @@ -207,8 +214,7 @@ default void addSize(int size) { /** * Write lock the PagingStore. * - * @param timeout milliseconds to wait for the lock. If value is {@literal -1} then wait - * indefinitely. + * @param timeout milliseconds to wait for the lock. If value is {@literal -1} then wait indefinitely. * @return {@code true} if the lock was obtained, {@code false} otherwise */ boolean writeLock(long timeout); @@ -225,8 +231,7 @@ default void addSize(int size) { void readUnlock(); /** - * This is used mostly by tests. - * We will wait any pending runnable to finish its execution + * This is used mostly by tests. We will wait any pending runnable to finish its execution */ void flushExecutors(); @@ -238,7 +243,6 @@ default void addSize(int size) { * Files to synchronize with a remote backup. * * @return a collection of page IDs which must be synchronized with a replicating backup - * @throws Exception */ Collection getCurrentIds() throws Exception; @@ -246,10 +250,6 @@ default void addSize(int size) { * Sends the pages with given IDs to the {@link ReplicationManager}. *

            * Sending is done here to avoid exposing the internal {@link org.apache.activemq.artemis.core.io.SequentialFile}s. - * - * @param replicator - * @param pageIds - * @throws Exception */ void sendPages(ReplicationManager replicator, Collection pageIds) throws Exception; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/NonExistentPage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/NonExistentPage.java index 9a9c3b60db5..d46d3eea47f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/NonExistentPage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/NonExistentPage.java @@ -17,9 +17,9 @@ package org.apache.activemq.artemis.core.paging.cursor; /** - * This is an internal exception. - * In certain cases AfterCommit could try to decrease the reference counting on large messages. - * But if the whole page is cleaned an exception could happen, which is ok on that path, and we need to identify it. + * This is an internal exception. In certain cases AfterCommit could try to decrease the reference counting on large + * messages. But if the whole page is cleaned an exception could happen, which is ok on that path, and we need to + * identify it. */ public class NonExistentPage extends RuntimeException { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PageCursorProvider.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PageCursorProvider.java index e5c28aa30c2..b39560c1eb1 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PageCursorProvider.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PageCursorProvider.java @@ -31,7 +31,6 @@ public interface PageCursorProvider { /** * @param queueId The cursorID should be the same as the queueId associated for persistence - * @return */ PageSubscription getSubscription(long queueId); @@ -58,9 +57,6 @@ public interface PageCursorProvider { */ void onPageModeCleared(); - /** - * @param pageCursorImpl - */ void close(PageSubscription pageCursorImpl); void checkClearPageLimit(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PageSubscription.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PageSubscription.java index 5cccd69fb77..c41c9647302 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PageSubscription.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/PageSubscription.java @@ -33,7 +33,9 @@ public interface PageSubscription { // To be called before the server is down void stop(); - /** Save a snapshot of the current counter value in the journal */ + /** + * Save a snapshot of the current counter value in the journal + */ void counterSnapshot(); /** @@ -95,16 +97,13 @@ default void ackTx(Transaction tx, PagedReference position) throws Exception { // for internal (cursor) classes void confirmPosition(Transaction tx, PagePosition position, boolean fromDelivery) throws Exception; - /** - * @return the first page in use or MAX_LONG if none is in use - */ + /** + * {@return the first page in use or MAX_LONG if none is in use} + */ long getFirstPage(); // Reload operations - /** - * @param position - */ void reloadACK(PagePosition position); boolean reloadPageCompletion(PagePosition position) throws Exception; @@ -113,8 +112,6 @@ default void ackTx(Transaction tx, PagedReference position) throws Exception { /** * To be called when the cursor decided to ignore a position. - * - * @param position */ void positionIgnored(PagePosition position); @@ -122,8 +119,6 @@ default void ackTx(Transaction tx, PagedReference position) throws Exception { /** * To be used to avoid a redelivery of a prepared ACK after load - * - * @param position */ void reloadPreparedACK(Transaction tx, PagePosition position); @@ -135,19 +130,12 @@ default void ackTx(Transaction tx, PagedReference position) throws Exception { void printDebug(); - /** - * @param page - * @return - */ boolean isComplete(long page); void forEachConsumedPage(Consumer pageCleaner); /** * To be used to requery the reference - * - * @param pos - * @return */ PagedMessage queryMessage(PagePosition pos); @@ -155,10 +143,6 @@ default void ackTx(Transaction tx, PagedReference position) throws Exception { Queue getQueue(); - /** - * @param deletedPage - * @throws Exception - */ void onDeletePage(Page deletedPage) throws Exception; void removePendingDelivery(PagedMessage pagedMessage); 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 873485b961c..9518f78a481 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 @@ -53,8 +53,9 @@ public class PagedReferenceImpl extends AbstractProtocolReference implements Pag // just to avoid creating on object on each call PagePosition cachedPositionObject; - /** This will create a new PagePosition, or return one previously created. - * This method is used to avoid repetitions on browsing iteration only. + /** + * This will create a new PagePosition, or return one previously created. This method is used to avoid repetitions on + * browsing iteration only. */ @Override public PagePosition getPosition() { @@ -106,7 +107,8 @@ public void onDelivery(Consumer onDelivery) { } /** - * It will call {@link Consumer#accept(Object)} on {@code this} of the {@link Consumer} registered in {@link #onDelivery(Consumer)}, if any. + * It will call {@link Consumer#accept(Object)} on {@code this} of the {@link Consumer} registered in + * {@link #onDelivery(Consumer)}, if any. */ @Override public void run() { @@ -280,9 +282,6 @@ public void acknowledge(Transaction tx, AckReason reason, ServerConsumer consume getQueue().acknowledge(tx, this, reason, consumer, delivering); } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { String msgToString; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCounterRebuildManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCounterRebuildManager.java index 1311ce07ac5..de0bd19e097 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCounterRebuildManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageCounterRebuildManager.java @@ -42,8 +42,10 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.function.BiConsumer; -/** this class will copy current data from the Subscriptions, count messages while the server is already active - * performing other activity */ +/** + * this class will copy current data from the Subscriptions, count messages while the server is already active + * performing other activity + */ public class PageCounterRebuildManager implements Runnable { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -68,8 +70,11 @@ public PageCounterRebuildManager(PagingManager pagingManager, PagingStore store, this.transactions = transactions; this.storedLargeMessages = storedLargeMessages; } - /** this method will perform the copy from Acked recorded from the subscription into a separate data structure. - * So we can count data while we consolidate at the end */ + + /** + * this method will perform the copy from Acked recorded from the subscription into a separate data structure. So we + * can count data while we consolidate at the end + */ private void initialize(PagingStore store) { store.writeLock(); try { 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 89a44e3ebb9..050f3a1314d 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 @@ -122,9 +122,8 @@ public void processReload() throws Exception { } if (!cursorList.isEmpty()) { - // https://issues.jboss.org/browse/JBPAPP-10338 if you ack out of order, - // the min page could be beyond the first page. - // we have to reload any previously acked message + // If you ack out of order, the min page could be beyond the first page. We have to reload any previously acked + // message long cursorsMinPage = checkMinPage(cursorList); // checkMinPage will return MaxValue if there aren't any pages or any cursors @@ -201,10 +200,10 @@ public Future scheduleCleanup() { } /** - * Delete everything associated with any queue on this address. - * This is to be called when the address is about to be released from paging. - * Hence the PagingStore will be holding a write lock, meaning no messages are going to be paged at this time. - * So, we shouldn't lock anything after this method, to avoid dead locks between the writeLock and any synchronization with the CursorProvider. + * Delete everything associated with any queue on this address. This is to be called when the address is about to be + * released from paging. Hence the PagingStore will be holding a write lock, meaning no messages are going to be + * paged at this time. So, we shouldn't lock anything after this method, to avoid dead locks between the writeLock + * and any synchronization with the CursorProvider. */ @Override public void onPageModeCleared() { @@ -342,15 +341,8 @@ protected void cleanup() { } /** - * This cleanup process will calculate the min page for every cursor - * and then we remove the pages based on that. - * if we knew ahead all the queues belonging to every page we could remove this process. - * @param depagedPages - * @param depagedPagesSet - * @param cursorList - * @param minPage - * @param firstPage - * @throws Exception + * This cleanup process will calculate the min page for every cursor and then we remove the pages based on that. if + * we knew ahead all the queues belonging to every page we could remove this process. */ private void cleanupRegularStream(List depagedPages, LongHashSet depagedPagesSet, @@ -387,12 +379,14 @@ private void cleanupRegularStream(List depagedPages, } } - /** The regular depaging will take care of removing messages in a regular streaming. - * - * if we had a list of all the cursors that belong to each page, this cleanup would be enough on every situation (with some adjustment to currentPages) - * So, this routing is to optimize removing pages when all the acks are made on every cursor. - * We still need regular depaging on a streamed manner as it will check the min page for all the existent cursors. - * */ + /** + * The regular depaging will take care of removing messages in a regular streaming. + *

            + * if we had a list of all the cursors that belong to each page, this cleanup would be enough on every situation + * (with some adjustment to currentPages) So, this routing is to optimize removing pages when all the acks are made + * on every cursor. We still need regular depaging on a streamed manner as it will check the min page for all the + * existent cursors. + */ private void cleanupMiddleStream(List depagedPages, LongHashSet depagedPagesSet, List cursorList, @@ -510,9 +504,6 @@ private boolean checkPageCompletion(List cursorList, long minP return complete; } - /** - * @return - */ private synchronized List cloneSubscriptions() { List cursorList = new ArrayList<>(activeCursors.values()); return cursorList; @@ -525,11 +516,6 @@ protected void onDeletePage(Page deletedPage) throws Exception { } } - /** - * @param cursorList - * @param currentPage - * @throws Exception - */ protected void storeBookmark(List cursorList, Page currentPage) throws Exception { try { // First step: Move every cursor to the next bookmarked page (that was just created) @@ -585,10 +571,9 @@ private void deliverIfNecessary(Collection cursorList, long mi for (PageSubscription cursor : cursorList) { long firstPage = cursor.getFirstPage(); if (firstPage == minPage) { - /** - * if first page is current writing page and it's not complete, or - * first page is before the current writing page, we need to trigger - * deliverAsync to delete messages in the pages. + /* + * if first page is current writing page and it's not complete, or first page is before the current writing + * page, we need to trigger deliverAsync to delete messages in the pages. */ if (cursor.getQueue().getMessageCount() == 0 && (!currentWriting || !cursor.isComplete(firstPage))) { cursor.getQueue().deliverAsync(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PagePositionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PagePositionImpl.java index 9933449a061..fbc47d6aa7b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PagePositionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PagePositionImpl.java @@ -24,10 +24,9 @@ public class PagePositionImpl implements PagePosition { /** * The index of the message on the page file. - * - * This can be used as -1 in cases where the message is irrelevant, - * for instance when a cursor is storing the next message to be received - * or when a page is marked as fully complete (as the ACKs are removed) + *

            + * This can be used as -1 in cases where the message is irrelevant, for instance when a cursor is storing the next + * message to be received or when a page is marked as fully complete (as the ACKs are removed) */ private final int messageNr; @@ -37,8 +36,7 @@ public class PagePositionImpl implements PagePosition { private long recordID = -1; /** - * Optional size value that can be set to specify the peristent size of the message - * for metrics tracking purposes + * Optional size value that can be set to specify the peristent size of the message for metrics tracking purposes */ private long persistentSize; @@ -47,50 +45,31 @@ public PagePositionImpl(long pageNr, int messageNr) { this.messageNr = messageNr; } - - /** - * @return the recordID - */ @Override public long getRecordID() { return recordID; } - /** - * @param recordID the recordID to set - */ @Override public void setRecordID(long recordID) { this.recordID = recordID; } - /** - * @return the pageNr - */ @Override public long getPageNr() { return pageNr; } - /** - * @return the messageNr - */ @Override public int getMessageNr() { return messageNr; } - /** - * @return the persistentSize - */ @Override public long getPersistentSize() { return persistentSize; } - /** - * @param persistentSize the persistentSize to set - */ @Override public void setPersistentSize(long persistentSize) { this.persistentSize = persistentSize; @@ -134,5 +113,4 @@ public boolean equals(Object obj) { public String toString() { return "PagePositionImpl [pageNr=" + pageNr + ", messageNr=" + messageNr + ", recordID=" + recordID + "]"; } - } 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 b77ad7e5894..807bd811ae4 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 @@ -47,11 +47,15 @@ public class PageSubscriptionCounterImpl extends BasePagingCounter { // the journal record id that is holding the current value private long recordID = -1; - /** while we rebuild the counters, we will use the recordedValues */ + /** + * while we rebuild the counters, we will use the recordedValues + */ private volatile long recordedValue = -1; private static final AtomicLongFieldUpdater recordedValueUpdater = AtomicLongFieldUpdater.newUpdater(PageSubscriptionCounterImpl.class, "recordedValue"); - /** while we rebuild the counters, we will use the recordedValues */ + /** + * while we rebuild the counters, we will use the recordedValues + */ private volatile long recordedSize = -1; private static final AtomicLongFieldUpdater recordedSizeUpdater = AtomicLongFieldUpdater.newUpdater(PageSubscriptionCounterImpl.class, "recordedSize"); @@ -156,9 +160,6 @@ public void increment(Transaction tx, int add, long size) throws Exception { /** * This method will install the TXs - * - * @param tx - * @param add */ @Override public void applyIncrementOnTX(Transaction tx, int add, long size) { @@ -399,32 +400,21 @@ private static class PendingCounter { private volatile int count; private volatile long persistentSize; - /** - * @param id - * @param count - * @param persistentSize - */ PendingCounter(long id, int count, long persistentSize) { super(); this.id = id; this.count = count; this.persistentSize = persistentSize; } - /** - * @return the id - */ + public long getId() { return id; } - /** - * @return the count - */ + public int getCount() { return count; } - /** - * @return the size - */ + public long getPersistentSize() { return persistentSize; } 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 49640a67624..c674b6a26f9 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 @@ -72,7 +72,9 @@ public final class PageSubscriptionImpl implements PageSubscription { private boolean empty = true; - /** for tests */ + /** + * for tests + */ public AtomicInteger getScheduledCleanupCount() { return scheduledCleanupCount; } @@ -211,9 +213,8 @@ public PageSubscriptionCounter getCounter() { /** * A page marked as complete will be ignored until it's cleared. *

            - * Usually paging is a stream of messages but in certain scenarios (such as a pending prepared - * TX) we may have big holes on the page streaming, and we will need to ignore such pages on the - * cursor/subscription. + * Usually paging is a stream of messages but in certain scenarios (such as a pending prepared TX) we may have big + * holes on the page streaming, and we will need to ignore such pages on the cursor/subscription. */ @Override public boolean reloadPageCompletion(PagePosition position) throws Exception { @@ -315,14 +316,12 @@ public void cleanupEntries(final boolean completeDelete) throws Exception { } for (PageCursorInfo infoPG : completedPages) { - // HORNETQ-1017: There are a few cases where a pending transaction might set a big hole on the page system - // where we need to ignore these pages in case of a restart. - // for that reason when we delete complete ACKs we store a single record per page file that will - // be removed once the page file is deleted - // notice also that this record is added as part of the same transaction where the information is deleted. - // In case of a TX Failure (a crash on the server) this will be recovered on the next cleanup once the - // server is restarted. - // first will mark the page as complete + // There are a few cases where a pending transaction might set a big hole on the page system where we need + // to ignore these pages in case of a restart. For that reason when we delete complete ACKs we store a + // single record per page file that will be removed once the page file is deleted notice also that this + // record is added as part of the same transaction where the information is deleted. In case of a TX Failure + // (a crash on the server) this will be recovered on the next cleanup once the server is restarted. First + // will mark the page as complete if (isPersistent()) { PagePosition completePage = new PagePositionImpl(infoPG.getPageId(), infoPG.getNumberOfMessages()); infoPG.setCompleteInfo(completePage); @@ -863,8 +862,6 @@ private PageTransactionInfo getPageTransaction(final PagedReference reference) t /** * A callback from the PageCursorInfo. It will be called when all the messages on a page have been acked - * - * @param info */ private void onPageDone(final PageCursorInfo info) { if (autoCleanup) { @@ -875,12 +872,11 @@ private void onPageDone(final PageCursorInfo info) { } } - /** * This will hold information about the pending ACKs towards a page. *

            - * This instance will be released as soon as the entire page is consumed, releasing the memory at - * that point The ref counts are increased also when a message is ignored for any reason. + * This instance will be released as soon as the entire page is consumed, releasing the memory at that point The ref + * counts are increased also when a message is ignored for any reason. */ public final class PageCursorInfo implements ConsumedPage { @@ -904,7 +900,8 @@ public final class PageCursorInfo implements ConsumedPage { private boolean pendingDelete; /** - * This is to be set when all the messages are complete on a given page, and we cleanup the records that are marked on it + * This is to be set when all the messages are complete on a given page, and we cleanup the records that are + * marked on it */ private PagePosition completePage; @@ -980,9 +977,6 @@ public void clear() { this.acks = null; } - /** - * @param completePage - */ public void setCompleteInfo(final PagePosition completePage) { if (logger.isTraceEnabled()) { logger.trace("Setting up complete page {} on cursor {} on subscription {}", completePage, this, PageSubscriptionImpl.this); @@ -1015,9 +1009,6 @@ public void setPendingDelete() { pendingDelete = true; } - /** - * @return the pageId - */ @Override public long getPageId() { return pageId; @@ -1087,9 +1078,6 @@ synchronized boolean internalAddACK(final PagePosition position) { } } - /** - * - */ protected void checkDone() { if (isDone()) { onPageDone(this); @@ -1214,8 +1202,7 @@ private void initPage(long page) { private final java.util.Queue redeliveries = new LinkedList<>(); /** - * next element taken on hasNext test. - * it has to be delivered on next next operation + * next element taken on hasNext test. it has to be delivered on next next operation */ private volatile PagedReference cachedNext; @@ -1439,8 +1426,8 @@ public synchronized NextResult tryNext() { } /** - * QueueImpl::deliver could be calling hasNext while QueueImpl.depage could be using next and hasNext as well. - * It would be a rare race condition but I would prefer avoiding that scenario + * QueueImpl::deliver could be calling hasNext while QueueImpl.depage could be using next and hasNext as well. It + * would be a rare race condition but I would prefer avoiding that scenario */ @Override public synchronized boolean hasNext() { 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 2ca9c476469..147f18166f0 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 @@ -62,7 +62,9 @@ public int usageDown() { return referenceCounter.decrement(); } - /** to be called when the page is supposed to be released */ + /** + * to be called when the page is supposed to be released + */ public void releaseTask(Consumer releaseTask) { referenceCounter.setTask(() -> releaseTask.accept(this)); } @@ -183,8 +185,10 @@ public synchronized void write(final PagedMessage message, boolean lineUp, boole storageManager.pageWrite(storeName, message, pageId, lineUp, originallyReplicated); } - /** This write will not interact back with the storage manager. - * To avoid ping pongs with Journal retaining events and any other stuff. */ + /** + * This write will not interact back with the storage manager. To avoid ping pongs with Journal retaining events and + * any other stuff. + */ public synchronized void writeDirect(PagedMessage message) throws Exception { if (!file.isOpen()) { throw ActiveMQMessageBundle.BUNDLE.cannotWriteToClosedFile(file); @@ -236,8 +240,8 @@ public void close(boolean sendReplicaClose) throws Exception { } /** - * sendEvent means it's a close happening from a major event such moveNext. - * While reading the cache we don't need (and shouldn't inform the backup + * sendEvent means it's a close happening from a major event such moveNext. While reading the cache we don't need + * (and shouldn't inform the backup */ public synchronized void close(boolean sendReplicaClose, boolean waitSync) throws Exception { if (readFileBuffer != null) { @@ -363,10 +367,6 @@ public int hashCode() { return (int) (pageId ^ (pageId >>> 32)); } - /** - * @param position - * @param msgNumber - */ private void markFileAsSuspect(final String fileName, final int position, final int msgNumber) { ActiveMQServerLogger.LOGGER.pageSuspectFile(fileName, position, msgNumber); suspiciousRecords = true; 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 30727535026..84990bd8df8 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 @@ -25,7 +25,8 @@ import java.lang.invoke.MethodHandles; /** - * This is a simple cache where we keep Page objects only while they are being used. */ + * 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(MethodHandles.lookup().lookupClass()); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTimedWriter.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTimedWriter.java index 7fbd8fac479..78d9795d97d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTimedWriter.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PageTimedWriter.java @@ -99,10 +99,11 @@ public synchronized void stop() { processMessages(); } - /** We increment task while holding the readLock. - * This is because we verify if the system is paging, and we get out of paging when no pending tasks and no pending messages. - * We allocate a task while holding the read Lock. - * We cannot call addTask within the lock as if the semaphore gets out of credits we would deadlock in certain cases. */ + /** + * We increment task while holding the readLock. This is because we verify if the system is paging, and we get out of + * paging when no pending tasks and no pending messages. We allocate a task while holding the read Lock. We cannot + * call addTask within the lock as if the semaphore gets out of credits we would deadlock in certain cases. + */ public void incrementTask() { pendingTasksUpdater.incrementAndGet(this); } 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 b2a35438ffd..54d99fae921 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 @@ -67,8 +67,9 @@ public final class PageTransactionInfoImpl implements PageTransactionInfo { private List lateDeliveries; - /** To be used during by the RebuildManager. - * When reading transactions not found transactions are marked as done. */ + /** + * To be used during by the RebuildManager. When reading transactions not found transactions are marked as done. + */ private boolean orphaned; public PageTransactionInfoImpl(final long transactionID) { @@ -193,9 +194,8 @@ public void store(final StorageManager storageManager, } /* - * This is to be used after paging. We will update the PageTransactions until they get all the messages delivered. On that case we will delete the page TX - * (non-Javadoc) - * @see org.apache.activemq.artemis.core.paging.PageTransactionInfo#storeUpdate(org.apache.activemq.artemis.core.persistence.StorageManager, org.apache.activemq.artemis.core.transaction.Transaction, int) + * This is to be used after paging. We will update the PageTransactions until they get all the messages delivered. On + * that case we will delete the page TX */ @Override public void storeUpdate(final StorageManager storageManager, @@ -213,11 +213,6 @@ public void reloadUpdate(final StorageManager storageManager, updt.setStored(); } - /** - * @param storageManager - * @param pagingManager - * @param tx - */ protected UpdatePageTXOperation internalUpdatePageManager(final StorageManager storageManager, final PagingManager pagingManager, final Transaction tx, @@ -319,10 +314,8 @@ public synchronized boolean deliverAfterCommit(PageIterator iterator, } /** - * a Message shouldn't be delivered until it's committed - * For that reason the page-reference will be written right away - * But in certain cases we can only deliver after the commit - * For that reason we will perform a late delivery + * a Message shouldn't be delivered until it's committed For that reason the page-reference will be written right + * away But in certain cases we can only deliver after the commit For that reason we will perform a late delivery * through the method redeliver. */ private static class LateDelivery { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java index 130c012d6a9..b2637a99fa3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagedMessageImpl.java @@ -73,9 +73,9 @@ public static byte valueOf(Message message) { return NOT_CORE; } } + /** - * Large messages will need to be instantiated lazily during getMessage when the StorageManager - * is available + * Large messages will need to be instantiated lazily during getMessage when the StorageManager is available */ private byte[] largeMessageLazyData; 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 0b76155d667..0e97dac5a29 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 @@ -70,10 +70,9 @@ public final class PagingManagerImpl implements PagingManager { private volatile boolean started = false; /** - * Lock used at the start of synchronization between a primary server and its backup. - * Synchronization will lock all {@link PagingStore} instances, and so any operation here that - * requires a lock on a {@link PagingStore} instance needs to take a read-lock on - * {@link #syncLock} to avoid dead-locks. + * Lock used at the start of synchronization between a primary server and its backup. Synchronization will lock all + * {@link PagingStore} instances, and so any operation here that requires a lock on a {@link PagingStore} instance + * needs to take a read-lock on {@link #syncLock} to avoid dead-locks. */ private final ReentrantReadWriteLock syncLock = new ReentrantReadWriteLock(); @@ -286,9 +285,7 @@ public void tick(long usableSpace, long totalSpace, boolean withinLimit, FileSto } } - /* - * For tests only! - */ + // For tests only! protected void setDiskFull(boolean diskFull) { this.diskFull = diskFull; } 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 347258c1310..3954a3e576d 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 @@ -156,8 +156,8 @@ public class PagingStoreImpl implements PagingStore { private final PageCursorProvider cursorProvider; - // This lock mostly protects the paging field. - // It is also used to block producers in eventual cases such as dropping a queue, but mostly to protect if the storage is in paging mode + // This lock mostly protects the paging field. It is also used to block producers in eventual cases such as dropping + // a queue, but mostly to protect if the storage is in paging mode. private final ReadWriteLock lock = new ReentrantReadWriteLock(); private volatile boolean running = false; @@ -245,9 +245,6 @@ private void configureSizeMetric() { size.setMax(maxSize, maxSize, maxMessages, maxMessages); } - /** - * @param addressSettings - */ @Override public void applySetting(final AddressSettings addressSettings) { applySetting(addressSettings, false); @@ -407,7 +404,6 @@ private void pageLimitReleased() { } } - @Override public void readLock() { readLock(-1L); @@ -763,10 +759,10 @@ protected void reloadLivePage(long pageId) throws Exception { resetCurrentPage(page); - /** - * The page file might be incomplete in the cases: 1) last message incomplete 2) disk damaged. - * In case 1 we can keep writing the file. But in case 2 we'd better not bcs old data might be overwritten. - * Here we open a new page so the incomplete page would be reserved for recovery if needed. + /* + * The page file might be incomplete in the cases: 1) last message incomplete 2) disk damaged. In case 1 we can + * keep writing the file. But in case 2 we'd better not bcs old data might be overwritten. Here we open a new page + * so the incomplete page would be reserved for recovery if needed. */ if (page.getSize() != page.getFile().size()) { openNewPage(); @@ -832,10 +828,9 @@ public boolean startPaging() { readUnlock(); } - // We need to guarantee a readLock on the storageManager before starting paging. - // This is because the replication manager will get a list of files to synchronize while - // holding a writeLock on the storageManager. - // So we must guarantee a readLock here otherwise the list might be wrong. + // We need to guarantee a readLock on the storageManager before starting paging. This is because the replication + // manager will get a list of files to synchronize while holding a writeLock on the storageManager. So we must + // guarantee a readLock here otherwise the list might be wrong. try (ArtemisCloseable readLock = storageManager.closeableReadLock()) { // if the first check failed, we do it again under a global currentPageLock // (writeLock) this time @@ -990,18 +985,15 @@ public void forceAnotherPage(boolean useExecutor) throws Exception { } } - /** * Returns a Page out of the Page System without reading it. *

            - * The method calling this method will remove the page and will start reading it outside of any - * locks. This method could also replace the current file by a new file, and that process is done - * through acquiring a writeLock on currentPageLock. - *

            + * The method calling this method will remove the page and will start reading it outside of any locks. This method + * could also replace the current file by a new file, and that process is done through acquiring a writeLock on + * currentPageLock. *

            - * Observation: This method is used internally as part of the regular depage process, but - * externally is used only on tests, and that's why this method is part of the Testable Interface - *

            + * Observation: This method is used internally as part of the regular depage process, but externally is used only on + * tests, and that's why this method is part of the Testable Interface */ @Override public Page removePage(int pageId) { @@ -1059,14 +1051,13 @@ public Page removePage(int pageId) { /** * Returns a Page out of the Page System without reading it. *

            - * The method calling this method will remove the page and will start reading it outside of any - * locks. This method could also replace the current file by a new file, and that process is done - * through acquiring a writeLock on currentPageLock. + * The method calling this method will remove the page and will start reading it outside of any locks. This method + * could also replace the current file by a new file, and that process is done through acquiring a writeLock on + * currentPageLock. *

            *

            - * Observation: This method is used internally as part of the regular depage process, but - * externally is used only on tests, and that's why this method is part of the Testable Interface - *

            + * Observation: This method is used internally as part of the regular depage process, but externally is used only on + * tests, and that's why this method is part of the Testable Interface */ @Override public Page depage() throws Exception { @@ -1441,10 +1432,6 @@ private long[] routeQueues(Transaction tx, RouteContextList ctx) throws Exceptio /** * This is done to prevent non tx to get out of sync in case of failures - * - * @param tx - * @param ctx - * @throws Exception */ private void applyPageCounters(Transaction tx, RouteContextList ctx, long size) throws Exception { List durableQueues = ctx.getDurableQueues(); @@ -1660,7 +1647,7 @@ private void openNewPage() throws Exception { } public String createFileName(final long pageID) { - /** {@link DecimalFormat} is not thread safe. */ + // DecimalFormat is not thread safe. synchronized (format) { return format.format(pageID) + ".page"; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/OperationContext.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/OperationContext.java index 6a7d0a9c4f8..b8f518def90 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/OperationContext.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/OperationContext.java @@ -28,15 +28,13 @@ public interface OperationContext extends IOCompletion { /** - * Execute the task when all IO operations are complete, - * Or execute it immediately if nothing is pending. - * Notice it's possible to pass a consistencyLevel to what should be waited before completing the operation. + * Execute the task when all IO operations are complete, Or execute it immediately if nothing is pending. Notice it's + * possible to pass a consistencyLevel to what should be waited before completing the operation. */ void executeOnCompletion(IOCallback runnable, OperationConsistencyLevel consistencyLevel); /** - * Execute the task when all IO operations are complete, - * Or execute it immediately if nothing is pending. + * Execute the task when all IO operations are complete, Or execute it immediately if nothing is pending. * * @param runnable the tas to be executed. */ @@ -53,9 +51,10 @@ public interface OperationContext extends IOCompletion { void waitCompletion() throws Exception; /** - * @param timeout in milliseconds - * @return - * @throws Exception + * Wait for the completion of this operation. + * + * @param timeout how long to wait in milliseconds + * @return {@code true} if the operation completed within the specified timeout; {@code false} if not */ boolean waitCompletion(long timeout) throws Exception; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/StorageManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/StorageManager.java index 585c12627e1..53ff9c92ff4 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/StorageManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/StorageManager.java @@ -70,18 +70,17 @@ /** * A StorageManager - * + *

            * Note about IDGEnerator - * - * I've changed StorageManager to extend IDGenerator, because in some places - * all we needed from the StorageManager was the idGeneration. - * I couldn't just get the IDGenerator from the inner part because the NullPersistent has its own sequence. - * So the best was to add the interface and adjust the callers for the method + *

            + * I've changed StorageManager to extend IDGenerator, because in some places all we needed from the StorageManager was + * the idGeneration. I couldn't just get the IDGenerator from the inner part because the NullPersistent has its own + * sequence. So the best was to add the interface and adjust the callers for the method */ public interface StorageManager extends MapStorageManager, IDGenerator, ActiveMQComponent { default long getMaxRecordSize() { - /** Null journal is pretty much memory */ + // Null journal is pretty much memory return Long.MAX_VALUE; } @@ -90,7 +89,7 @@ default boolean isReplicated() { } default long getWarningRecordSize() { - /** Null journal is pretty much memory */ + // Null journal is pretty much memory return Long.MAX_VALUE; } @@ -123,10 +122,10 @@ default SequentialFileFactory getJournalSequentialFileFactory() { void setContext(OperationContext context); /** + * Stop this {@code StorageManager} * * @param ioCriticalError is the server being stopped due to an IO critical error. - * @param sendFailover this is to send the replication stopping in case of replication. - * @throws Exception + * @param sendFailover this is to send the replication stopping in case of replication. */ void stop(boolean ioCriticalError, boolean sendFailover) throws Exception; @@ -147,33 +146,25 @@ default SequentialFileFactory getJournalSequentialFileFactory() { void afterStoreOperations(IOCallback run); /** - * Block until the operations are done. - * Warning: Don't use it inside an ordered executor, otherwise the system may lock up - * in case of the pools are full - * - * @throws Exception + * Block until the operations are done. Warning: Don't use it inside an ordered executor, otherwise the system may + * lock up in case of the pools are full */ boolean waitOnOperations(long timeout) throws Exception; /** - * Block until the operations are done. - * Warning: Don't use it inside an ordered executor, otherwise the system may lock up - * in case of the pools are full - * - * @throws Exception + * Block until the operations are done. Warning: Don't use it inside an ordered executor, otherwise the system may + * lock up in case of the pools are full */ void waitOnOperations() throws Exception; /** - * AIO has an optimized buffer which has a method to release it - * instead of the way NIO will release data based on GC. + * AIO has an optimized buffer which has a method to release it instead of the way NIO will release data based on GC. * These methods will use that buffer if the inner method supports it */ ByteBuffer allocateDirectBuffer(int size); /** - * AIO has an optimized buffer which has a method to release it - * instead of the way NIO will release data based on GC. + * AIO has an optimized buffer which has a method to release it instead of the way NIO will release data based on GC. * These methods will use that buffer if the inner method supports it */ void freeDirectBuffer(ByteBuffer buffer); @@ -237,15 +228,15 @@ default SequentialFileFactory getJournalSequentialFileFactory() { /** * Creates a new LargeServerMessage for the core Protocol with the given id. * - * @param id - * @param message This is a temporary message that holds the parsed properties. The remoting - * layer can't create a ServerMessage directly, then this will be replaced. + * @param message This is a temporary message that holds the parsed properties. The remoting layer can't create a + * ServerMessage directly, then this will be replaced. * @return a large message object - * @throws Exception */ LargeServerMessage createCoreLargeMessage(long id, Message message) throws Exception; - /** Other protocols may inform the storage manager when a large message was created. */ + /** + * Other protocols may inform the storage manager when a large message was created. + */ LargeServerMessage onLargeMessageCreate(long id, LargeServerMessage largeMessage) throws Exception; enum LargeMessageExtension { @@ -266,7 +257,6 @@ public String getExtension() { * * @param messageID the id of the message * @param extension the extension to add to the file - * @return */ SequentialFile createFileForLargeMessage(long messageID, LargeMessageExtension extension); @@ -351,11 +341,10 @@ JournalLoadInformation loadMessageJournal(PostOffice postOffice, void deleteQueueBinding(long tx, long queueBindingID) throws Exception; /** - * + * Store a queue's status. * @param queueID The id of the queue * @param status The current status of the queue. (Reserved for future use, ATM we only use this record for PAUSED) * @return the id of the journal - * @throws Exception */ long storeQueueStatus(long queueID, AddressQueueStatus status) throws Exception; @@ -429,6 +418,8 @@ JournalLoadInformation loadBindingJournal(List queueBindingInf Map getPersistedKeyValuePairs(String mapId); /** + * Store the specificed page counter. + * * @return The ID with the stored counter */ long storePageCounter(long txID, long queueID, long value, long persistentSize) throws Exception; @@ -442,30 +433,23 @@ JournalLoadInformation loadBindingJournal(List queueBindingInf void deletePendingPageCounter(long txID, long recordID) throws Exception; /** + * Store the specificed page counter increment. + * * @return the ID with the increment record - * @throws Exception */ long storePageCounterInc(long txID, long queueID, int add, long persistentSize) throws Exception; /** + * Store the specificed page counter increment. + * * @return the ID with the increment record - * @throws Exception */ long storePageCounterInc(long queueID, int add, long size) throws Exception; - /** - * @return the bindings journal - */ Journal getBindingsJournal(); - /** - * @return the message journal - */ Journal getMessageJournal(); - /** - * @see org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager#startReplication(org.apache.activemq.artemis.core.replication.ReplicationManager, org.apache.activemq.artemis.core.paging.PagingManager, String, boolean, long) - */ void startReplication(ReplicationManager replicationManager, PagingManager pagingManager, String nodeID, @@ -475,9 +459,8 @@ void startReplication(ReplicationManager replicationManager, /** * Write message to page if we are paging. * - * @return {@code true} if we are paging and have handled the data, {@code false} if the data - * needs to be sent to the journal - * @throws Exception + * @return {@code true} if we are paging and have handled the data, {@code false} if the data needs to be sent to the + * journal */ boolean addToPage(PagingStore store, Message msg, Transaction tx, RouteContextList listCtx) throws Exception; @@ -488,11 +471,6 @@ void startReplication(ReplicationManager replicationManager, */ void stopReplication(); - /** - * @param appendFile - * @param messageID - * @param bytes - */ void addBytesToLargeMessage(SequentialFile appendFile, long messageID, byte[] bytes) throws Exception; void addBytesToLargeMessage(SequentialFile file, @@ -501,10 +479,6 @@ void addBytesToLargeMessage(SequentialFile file, /** * Stores the id from IDManager. - * - * @param journalID - * @param id - * @throws Exception */ void storeID(long journalID, long id) throws Exception; @@ -520,11 +494,9 @@ default ArtemisCloseable closeableReadLock() { /** * Read lock the StorageManager. USE WITH CARE! *

            - * The main lock is used to write lock the whole manager when starting replication. Sub-systems, - * say Paging classes, that use locks of their own AND also write through the StorageManager MUST - * first read lock the storageManager before taking their own locks. Otherwise, we may dead-lock - * when starting replication sync. - * + * The main lock is used to write lock the whole manager when starting replication. Sub-systems, say Paging classes, + * that use locks of their own AND also write through the StorageManager MUST first read lock the storageManager + * before taking their own locks. Otherwise, we may dead-lock when starting replication sync. */ ArtemisCloseable closeableReadLock(boolean tryLock); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedAddressSetting.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedAddressSetting.java index 02b6116a0ab..dcb06cbe150 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedAddressSetting.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedAddressSetting.java @@ -21,9 +21,10 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings; /** - * This class is only kept for compatibility reasons. The encode method should be dead code at this point and - * only the decode should be used when versioning is at play. - * Deprecated Use PersistedAddressSettingJSON instead + * This class is only kept for compatibility reasons. The encode method should be dead code at this point and only the + * decode should be used when versioning is at play. + * + * @deprecated Use PersistedAddressSettingJSON instead */ @Deprecated public class PersistedAddressSetting extends AbstractPersistedAddressSetting implements EncodingSupport { @@ -33,9 +34,6 @@ public PersistedAddressSetting() { super(); } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { return "PersistedAddressSetting [storeId=" + storeId + diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedAddressSettingJSON.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedAddressSettingJSON.java index 3f47c977674..99ce6597a3d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedAddressSettingJSON.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedAddressSettingJSON.java @@ -37,10 +37,6 @@ public AddressSettings getSetting() { return super.getSetting(); } - /** - * @param addressMatch - * @param setting - */ public PersistedAddressSettingJSON(SimpleString addressMatch, AddressSettings setting, SimpleString jsonSetting) { super(addressMatch, setting); this.jsonSetting = jsonSetting; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedRole.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedRole.java index 38307e897c4..07d0f089462 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedRole.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedRole.java @@ -91,9 +91,6 @@ public void decode(ActiveMQBuffer buffer) { } } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { StringBuilder result = new StringBuilder(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedSecuritySetting.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedSecuritySetting.java index 4b4c0b2f907..12c2f0d9a8a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedSecuritySetting.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedSecuritySetting.java @@ -25,7 +25,6 @@ public class PersistedSecuritySetting implements EncodingSupport { - private long storeId; private SimpleString addressMatch; @@ -58,21 +57,6 @@ public class PersistedSecuritySetting implements EncodingSupport { public PersistedSecuritySetting() { } - /** - * @param addressMatch - * @param sendRoles - * @param consumeRoles - * @param createDurableQueueRoles - * @param deleteDurableQueueRoles - * @param createNonDurableQueueRoles - * @param deleteNonDurableQueueRoles - * @param manageRoles - * @param browseRoles - * @param createAddressRoles - * @param deleteAddressRoles - * @param viewRoles - * @param editRoles - */ public PersistedSecuritySetting(final String addressMatch, final String sendRoles, final String consumeRoles, @@ -111,84 +95,50 @@ public void setStoreId(final long id) { storeId = id; } - /** - * @return the addressMatch - */ public SimpleString getAddressMatch() { return addressMatch; } - /** - * @return the sendRoles - */ public String getSendRoles() { return stringFrom(sendRoles); } - /** - * @return the consumeRoles - */ public String getConsumeRoles() { return stringFrom(consumeRoles); } - /** - * @return the createDurableQueueRoles - */ public String getCreateDurableQueueRoles() { return stringFrom(createDurableQueueRoles); } - /** - * @return the deleteDurableQueueRoles - */ public String getDeleteDurableQueueRoles() { return stringFrom(deleteDurableQueueRoles); } - /** - * @return the createNonDurableQueueRoles - */ public String getCreateNonDurableQueueRoles() { return stringFrom(createNonDurableQueueRoles); } - /** - * @return the deleteNonDurableQueueRoles - */ public String getDeleteNonDurableQueueRoles() { return stringFrom(deleteNonDurableQueueRoles); } - /** - * @return the manageRoles - */ public String getManageRoles() { return stringFrom(manageRoles); } - /** - * @return the browseRoles - */ public String getBrowseRoles() { return stringFrom(browseRoles); } - /** - * @return the createAddressRoles - */ public String getCreateAddressRoles() { return stringFrom(createAddressRoles); } - /** - * @return the deleteAddressRoles - */ public String getDeleteAddressRoles() { return stringFrom(deleteAddressRoles); } - public String getViewRoles() { return stringFrom(viewRoles); } @@ -260,9 +210,6 @@ public void decode(final ActiveMQBuffer buffer) { } } - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { final int prime = 31; @@ -284,9 +231,6 @@ public int hashCode() { return result; } - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ @Override public boolean equals(Object obj) { if (this == obj) @@ -366,9 +310,6 @@ public boolean equals(Object obj) { return true; } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { return "PersistedSecuritySetting [storeId=" + storeId + diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedUser.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedUser.java index aef5dec3b89..b3dee5d5231 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedUser.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedUser.java @@ -72,9 +72,6 @@ public void decode(ActiveMQBuffer buffer) { password = buffer.readString(); } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { return "PersistedUser [storeId=" + storeId + 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 77902643630..7eeb0e06131 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 @@ -137,9 +137,9 @@ import static org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds.SET_SCHEDULED_DELIVERY_TIME; /** - * Controls access to the journals and other storage files such as the ones used to store pages and - * large messages. This class must control writing of any non-transient data, as it is the key point - * for synchronizing any replicating backup server. + * Controls access to the journals and other storage files such as the ones used to store pages and large messages. + * This class must control writing of any non-transient data, as it is the key point for synchronizing any replicating + * backup server. *

            * Using this class also ensures that locks are acquired in the right order, avoiding dead-locks. */ @@ -291,9 +291,6 @@ public long getWarningRecordSize() { /** * Called during initialization. Used by implementations to setup Journals, Stores etc... - * - * @param config - * @param criticalErrorListener */ protected abstract void init(Configuration config, IOCriticalErrorListener criticalErrorListener); @@ -710,12 +707,11 @@ public void commit(final long txID, final boolean lineUpContext) throws Exceptio logger.trace("calling getContext(true).done() for txID={}, lineupContext={} syncTransactional={}... forcing call on getContext(true).done", txID, lineUpContext, syncTransactional); } - /** - * If {@code lineUpContext == false}, it means that we have previously lined up a - * context somewhere else (specifically see @{link TransactionImpl#asyncAppendCommit}), - * hence we need to mark it as done even if {@code syncTransactional = false} as in this - * case {@code getContext(syncTransactional=false)} would pass a dummy context to the - * {@code messageJournal.appendCommitRecord(...)} call above. + /* + * If lineUpContext == false, it means that we have previously lined up a context somewhere else + * (specifically see TransactionImpl#asyncAppendCommit), hence we need to mark it as done even if + * syncTransactional = false as in this case getContext(syncTransactional=false) would pass a dummy context + * to the messageJournal.appendCommitRecord(...) call above. */ getContext(true).done(); } @@ -1460,12 +1456,6 @@ public void checkInvalidPageTransactions(PagingManager pagingManager, } } - /** - * @param queueID - * @param pageSubscriptions - * @param queueInfos - * @return - */ private static PageSubscription locateSubscription(final long queueID, final Map pageSubscriptions, final Map queueInfos, @@ -1866,9 +1856,7 @@ public synchronized boolean isStarted() { } } - /** - * TODO: Is this still being used ? - */ + // TODO: Is this still being used ? public JournalLoadInformation[] loadInternalOnly() throws Exception { try (ArtemisCloseable lock = closeableReadLock()) { JournalLoadInformation[] info = new JournalLoadInformation[2]; @@ -2176,11 +2164,6 @@ public void pageSyncDone() { } } - /** - * @param id - * @param buffer - * @return - */ protected static PersistedSecuritySetting newSecurityRecord(long id, ActiveMQBuffer buffer) { PersistedSecuritySetting roles = new PersistedSecuritySetting(); roles.decode(buffer); @@ -2188,11 +2171,6 @@ protected static PersistedSecuritySetting newSecurityRecord(long id, ActiveMQBuf return roles; } - /** - * @param id - * @param buffer - * @return - */ static PersistedAddressSetting newAddressEncoding(long id, ActiveMQBuffer buffer) { PersistedAddressSetting setting = new PersistedAddressSetting(); setting.decode(buffer); @@ -2256,11 +2234,6 @@ static PersistedKeyValuePair newKeyValuePairEncoding(long id, ActiveMQBuffer buf return persistedKeyValuePair; } - /** - * @param id - * @param buffer - * @return - */ static GroupingEncoding newGroupEncoding(long id, ActiveMQBuffer buffer) { GroupingEncoding encoding = new GroupingEncoding(); encoding.decode(buffer); @@ -2268,11 +2241,6 @@ static GroupingEncoding newGroupEncoding(long id, ActiveMQBuffer buffer) { return encoding; } - /** - * @param id - * @param buffer - * @return - */ protected static PersistentQueueBindingEncoding newQueueBindingEncoding(long id, ActiveMQBuffer buffer) { PersistentQueueBindingEncoding bindingEncoding = new PersistentQueueBindingEncoding(); @@ -2282,11 +2250,6 @@ protected static PersistentQueueBindingEncoding newQueueBindingEncoding(long id, return bindingEncoding; } - /** - * @param id - * @param buffer - * @return - */ protected static QueueStatusEncoding newQueueStatusEncoding(long id, ActiveMQBuffer buffer) { QueueStatusEncoding statusEncoding = new QueueStatusEncoding(); 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 fcd4f19bdc5..3e7a2bb30dc 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 @@ -32,8 +32,8 @@ import java.lang.invoke.MethodHandles; /** - * An ID generator that allocates a batch of IDs of size {@link #checkpointSize} and records the ID - * in the journal only when starting a new batch. + * An ID generator that allocates a batch of IDs of size {@link #checkpointSize} and records the ID in the journal only + * when starting a new batch. * * @see IDGenerator */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/BufferSplitter.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/BufferSplitter.java index e8db7f1c187..49c4f86c18d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/BufferSplitter.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/BufferSplitter.java @@ -22,7 +22,9 @@ import org.apache.activemq.artemis.api.core.ActiveMQBuffer; import org.apache.activemq.artemis.core.journal.EncodingSupport; -/** this class will split a big buffer into smaller buffers */ +/** + * this class will split a big buffer into smaller buffers + */ public class BufferSplitter { 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 79bc73700a6..80b25eff87a 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 @@ -205,11 +205,6 @@ public void write(int b) throws IOException { } }); - /** - * @param fileFactory - * @param journal - * @throws Exception - */ private static DescribeJournal describeJournal(SequentialFileFactory fileFactory, JournalImpl journal, final File path, diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalRecordIds.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalRecordIds.java index fdff9eff572..16b2f4d310e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalRecordIds.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalRecordIds.java @@ -19,9 +19,8 @@ /** * These record IDs definitions are meant to be public. *

            - * If any other component or any test needs to validate user-record-types from the Journal directly - * This is where the definitions will exist and this is what these tests should be using to verify - * the IDs. + * If any other component or any test needs to validate user-record-types from the Journal directly This is where the + * definitions will exist and this is what these tests should be using to verify the IDs. */ public final class JournalRecordIds { 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 faae02ea096..54d0624c933 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 @@ -186,9 +186,10 @@ protected void init(Configuration config, IOCriticalErrorListener criticalErrorL /** * We need to correct the file size if its not a multiple of the alignement - * @param fileSize : the configured file size. + * + * @param fileSize : the configured file size. * @param alignment : the alignment. - * @return the fixed file size. + * @return the fixed file size */ protected int fixJournalFileSize(int fileSize, int alignment) { int size = fileSize; @@ -346,11 +347,6 @@ protected void performCachedLargeMessageDeletes() { } @Override - /** - * @param buff - * @return - * @throws Exception - */ protected LargeServerMessage parseLargeMessage(final ActiveMQBuffer buff) throws Exception { LargeServerMessage largeMessage = createCoreLargeMessage(); @@ -712,11 +708,6 @@ private void sendLargeMessageFiles(final Map> pendingLa } } - /** - * @param pagingManager - * @return - * @throws Exception - */ private Map> getPageInformationForSync(PagingManager pagingManager) throws Exception { Map> info = new HashMap<>(); for (SimpleString storeName : pagingManager.getStoreNames()) { @@ -747,10 +738,8 @@ private void checkAndCreateDir(final File dir, final boolean create) { *

            * Collects a list of existing large messages and their current size, passing re. *

            - * So we know how much of a given message to sync with the backup. Further data appends to the - * messages will be replicated normally. - * - * @throws Exception + * So we know how much of a given message to sync with the backup. Further data appends to the messages will be + * replicated normally. */ private Map> recoverPendingLargeMessages() throws Exception { @@ -778,10 +767,6 @@ public void recoverLargeMessagesOnFolder(Set storedLargeMessages) throws E }); } - /** - * @param pageFilesToSync - * @throws Exception - */ private void sendPagesToBackup(Map> pageFilesToSync, PagingManager manager) throws Exception { for (Map.Entry> entry : pageFilesToSync.entrySet()) { 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 dea5a96ed64..bf080e8cb48 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 @@ -223,9 +223,9 @@ public SequentialFile getReadingFile() throws ActiveMQException { return file.cloneFile(); } - /** Meant for test-ability, be careful if you decide to use it. - * and in case you use it for a real reason, please change the documentation here. - * @param file + /** + * Meant for test-ability, be careful if you decide to use it. and in case you use it for a real reason, please + * change the documentation here. */ public void replaceFile(SequentialFile file) { this.file = file; @@ -306,8 +306,8 @@ public int getBodyBufferSize() { } /** - * sendEvent means it's a close happening from end of write largemessage. - * While reading the largemessage we don't need (and shouldn't inform the backup + * sendEvent means it's a close happening from end of write largemessage. While reading the largemessage we don't + * need (and shouldn't inform the backup */ public synchronized void releaseResources(boolean sync, boolean sendEvent) { if (file != null && file.isOpen()) { @@ -443,9 +443,6 @@ public int readInto(final ByteBuffer bufferRead) throws ActiveMQException { } } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.message.LargeBodyEncoder#getSize() - */ @Override public long getSize() throws ActiveMQException { return getBodySize(); 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 8928ef78719..da0f05437dc 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 @@ -57,7 +57,9 @@ public Message toMessage() { private final LargeBody largeBody; - /** This will check if a regular message needs to be converted as large message */ + /** + * This will check if a regular message needs to be converted as large message + */ public static Message checkLargeMessage(Message message, StorageManager storageManager) throws Exception { if (message.isLargeMessage()) { return message; // nothing to be done on this case @@ -133,10 +135,6 @@ public LargeServerMessageImpl(final StorageManager storageManager) { /** * Copy constructor - * - * @param properties - * @param copy - * @param fileCopy */ public LargeServerMessageImpl(final LargeServerMessageImpl copy, TypedProperties properties, 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 0ee9d13183f..e61644eca32 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 @@ -41,9 +41,6 @@ public final class LargeServerMessageInSync implements ReplicatedLargeMessage { private boolean syncDone; private boolean deleted; - /** - * @param storageManager - */ public LargeServerMessageInSync(StorageManager storageManager) { mainLM = storageManager.createCoreLargeMessage(); this.storageManager = storageManager; @@ -125,9 +122,6 @@ public synchronized void deleteFile() throws Exception { } } - /** - * @throws Exception - */ private void deleteAppendFile() throws Exception { if (appendFile != null) { if (appendFile.isOpen()) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java index d0635adb3d2..80454d0953a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java @@ -35,16 +35,17 @@ /** * Each instance of OperationContextImpl is associated with an executor (usually an ordered Executor). - * - * Tasks are hold until the operations are complete and executed in the natural order as soon as the operations are returned - * from replication and storage. - * + *

            + * Tasks are hold until the operations are complete and executed in the natural order as soon as the operations are + * returned from replication and storage. + *

            * If there are no pending IO operations, the tasks are just executed at the callers thread without any context switch. - * - * So, if you are doing operations that are not dependent on IO (e.g NonPersistentMessages) you wouldn't have any context switch. - * - * If you need to track store operations you can set the system property "ARTEMIS_OPCONTEXT_MAX_DEBUG_TRACKERS" - * with the max number of trackers that you want to keep in memory. + *

            + * So, if you are doing operations that are not dependent on IO (e.g NonPersistentMessages) you wouldn't have any + * context switch. + *

            + * If you need to track store operations you can set the system property "ARTEMIS_OPCONTEXT_MAX_DEBUG_TRACKERS" with the + * max number of trackers that you want to keep in memory. */ public class OperationContextImpl implements OperationContext { @@ -358,9 +359,6 @@ private void checkTasks() { } } - /** - * @param task - */ private void execute(final IOCallback task) { EXECUTORS_PENDING_UPDATER.incrementAndGet(this); try { @@ -380,10 +378,6 @@ private void execute(final IOCallback task) { } } - /* - * (non-Javadoc) - * @see org.apache.activemq.artemis.core.replication.ReplicationToken#complete() - */ public void complete() { } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/DeleteEncoding.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/DeleteEncoding.java index 565d6fde494..be7af7f602b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/DeleteEncoding.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/DeleteEncoding.java @@ -31,26 +31,17 @@ public DeleteEncoding(final byte recordType, final long id) { this.id = id; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.journal.EncodingSupport#getEncodeSize() - */ @Override public int getEncodeSize() { return DataConstants.SIZE_BYTE + DataConstants.SIZE_LONG; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.journal.EncodingSupport#readInto(org.apache.activemq.artemis.api.core.ActiveMQBuffer) - */ @Override public void encode(ActiveMQBuffer buffer) { buffer.writeByte(recordType); buffer.writeLong(id); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.journal.EncodingSupport#decode(org.apache.activemq.artemis.api.core.ActiveMQBuffer) - */ @Override public void decode(ActiveMQBuffer buffer) { recordType = buffer.readByte(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/FinishPageMessageOperation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/FinishPageMessageOperation.java index d741e9507c8..fcf368f78fb 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/FinishPageMessageOperation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/FinishPageMessageOperation.java @@ -25,8 +25,7 @@ /** * This is only used when loading a transaction. *

            - * it might be possible to merge the functionality of this class with - * {@link FinishPageMessageOperation} + * it might be possible to merge the functionality of this class with {@link FinishPageMessageOperation} */ // TODO: merge this class with the one on the PagingStoreImpl public class FinishPageMessageOperation extends TransactionOperationAbstract implements TransactionOperation { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/LargeMessagePersister.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/LargeMessagePersister.java index 499e978f403..992675985fe 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/LargeMessagePersister.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/LargeMessagePersister.java @@ -42,29 +42,19 @@ public static LargeMessagePersister getInstance() { protected LargeMessagePersister() { } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.journal.EncodingSupport#decode(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer) - */ @Override public LargeServerMessage decode(final ActiveMQBuffer buffer, LargeServerMessage message, CoreMessageObjectPools objectPools) { ((CoreMessage)message).decodeHeadersAndProperties(buffer.byteBuf()); return message; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.journal.EncodingSupport#encode(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer) - */ @Override public void encode(final ActiveMQBuffer buffer, LargeServerMessage message) { ((CoreMessage)message).encodeHeadersAndProperties(buffer.byteBuf()); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.journal.EncodingSupport#getEncodeSize() - */ @Override public int getEncodeSize(LargeServerMessage message) { return message.toMessage().getEncodeSize(); } - } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PendingLargeMessageEncoding.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PendingLargeMessageEncoding.java index 3da1363e2cf..c1dfe4585b2 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PendingLargeMessageEncoding.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PendingLargeMessageEncoding.java @@ -31,25 +31,16 @@ public PendingLargeMessageEncoding(final long pendingLargeMessageID) { public PendingLargeMessageEncoding() { } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.journal.EncodingSupport#decode(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer) - */ @Override public void decode(final ActiveMQBuffer buffer) { largeMessageID = buffer.readLong(); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.journal.EncodingSupport#readInto(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer) - */ @Override public void encode(final ActiveMQBuffer buffer) { buffer.writeLong(largeMessageID); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.journal.EncodingSupport#getEncodeSize() - */ @Override public int getEncodeSize() { return DataConstants.SIZE_LONG; @@ -59,5 +50,4 @@ public int getEncodeSize() { public String toString() { return "PendingLargeMessageEncoding::MessageID=" + largeMessageID; } - } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Address.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Address.java index 60a8755f0fd..ebd6d0b4ead 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Address.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Address.java @@ -19,7 +19,7 @@ import org.apache.activemq.artemis.api.core.SimpleString; /** - * USed to hold a hierarchical style address, delimited by a '.'. + * Used to hold a hierarchical style address, delimited by a '.'. */ public interface Address { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/AddressManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/AddressManager.java index 8d925955700..2e4cf5d9e42 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/AddressManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/AddressManager.java @@ -38,11 +38,6 @@ public interface AddressManager { /** * This will use a Transaction as we need to confirm the queue was removed - * - * @param uniqueName - * @param tx - * @return - * @throws Exception */ Binding removeBinding(SimpleString uniqueName, Transaction tx) throws Exception; @@ -69,15 +64,18 @@ public interface AddressManager { Set getAddresses(); /** - * @param addressInfo - * @return true if the address was added, false if it wasn't added + * {@return {@code true} if the address was added, false if it wasn't added} */ boolean addAddressInfo(AddressInfo addressInfo) throws Exception; boolean reloadAddressInfo(AddressInfo addressInfo) throws Exception; - /** it will return null if there are no updates. - * it will throw an exception if the address doesn't exist */ + /** + * Update the specified {@code AddressInfo} + * + * @return the updated {@code AddressInfo} or {@code null} if there are no updates + * @throws Exception if the address doesn't exist + */ AddressInfo updateAddressInfo(SimpleString addressName, EnumSet routingTypes) throws Exception; AddressInfo removeAddressInfo(SimpleString address) throws Exception; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Binding.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Binding.java index 30e138c66d6..afc417a82b4 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Binding.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Binding.java @@ -61,10 +61,8 @@ default boolean isLocal() { /** * This method will create a string representation meant for management operations. *

            - * This is different from the toString() method that is meant for debugging and will - * contain information that regular users won't understand well. - * - * @return + * This is different from the toString() method that is meant for debugging and will contain information that regular + * users won't understand well. */ String toManagementString(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Bindings.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Bindings.java index 07b3f457688..b1bbb92ed37 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Bindings.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/Bindings.java @@ -46,12 +46,8 @@ public interface Bindings extends UnproposalListener { MessageLoadBalancingType getMessageLoadBalancingType(); /** - * * @param message the message being copied - * @param originatingQueue - * @param context * @return a Copy of the message if redistribution succeeded, or null if it wasn't redistributed - * @throws Exception */ Message redistribute(Message message, Queue originatingQueue, RoutingContext context) throws Exception; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/DuplicateIDCache.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/DuplicateIDCache.java index 11d8535d03d..2f0d3269a8d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/DuplicateIDCache.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/DuplicateIDCache.java @@ -34,9 +34,8 @@ public interface DuplicateIDCache { int getSize(); /** - * it will add the data to the cache. - * If TX == null it won't use a transaction. - * if instantAdd=true, it won't wait a transaction to add on the cache which is needed on the case of the Bridges + * It will add the data to the cache. If TX == null it won't use a transaction. if instantAdd=true, it won't wait a + * transaction to add on the cache which is needed on the case of the Bridges */ void addToCache(byte[] duplicateID, Transaction tx, boolean instantAdd) throws Exception; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java index 7cc9d22771c..4ebd7a3cd90 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java @@ -39,21 +39,20 @@ import org.apache.activemq.artemis.core.transaction.Transaction; /** - * A PostOffice instance maintains a mapping of a String address to a Queue. Multiple Queue instances can be bound - * with the same String address. - * + * A PostOffice instance maintains a mapping of a String address to a Queue. Multiple Queue instances can be bound with + * the same String address. + *

            * Given a message and an address a PostOffice instance will route that message to all the Queue instances that are * registered with that address. - * + *

            * Addresses can be any String instance. - * + *

            * A Queue instance can only be bound against a single address in the post office. */ public interface PostOffice extends ActiveMQComponent { /** - * @param addressInfo - * @return true if the address was added, false if it wasn't added + * {@return true if the address was added, false if it wasn't added} */ boolean addAddressInfo(AddressInfo addressInfo) throws Exception; @@ -105,10 +104,9 @@ QueueBinding updateQueue(SimpleString name, QueueBinding updateQueue(QueueConfiguration queueConfiguration) throws Exception; /** - * @param queueConfiguration - * @param forceUpdate Setting to true will make null values override current values too - * @return - * @throws Exception + * Update a queue's configuration. + * + * @param forceUpdate Setting to {@code true} will make {@code null} values override current values too */ QueueBinding updateQueue(QueueConfiguration queueConfiguration, boolean forceUpdate) throws Exception; @@ -122,9 +120,6 @@ QueueBinding updateQueue(SimpleString name, /** * It will lookup the Binding without creating an item on the Queue if non-existent - * - * @param address - * @throws Exception */ Bindings lookupBindingsForAddress(SimpleString address) throws Exception; @@ -141,9 +136,6 @@ default Queue findQueue(final long bindingID) { /** * Differently to lookupBindings, this will always create a new element on the Queue if non-existent - * - * @param address - * @throws Exception */ Bindings getBindingsForAddress(SimpleString address) throws Exception; @@ -188,11 +180,6 @@ RoutingStatus route(Message message, /** * This method was renamed as reload, use the new method instead - * @param message - * @param queue - * @param tx - * @return - * @throws Exception */ @Deprecated default MessageReference reroute(Message message, Queue queue, Transaction tx) throws Exception { @@ -214,7 +201,7 @@ Pair redistribute(Message message, Object getNotificationLock(); - // we can't start expiry scanner until the system is load otherwise we may get weird races - https://issues.jboss.org/browse/HORNETQ-1142 + // we can't start expiry scanner until the system is load otherwise we may get weird races void startExpiryScanner(); void startAddressQueueScanner(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/QueueInfo.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/QueueInfo.java index f271ebe8d92..eb6d4a7f4e3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/QueueInfo.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/QueueInfo.java @@ -139,9 +139,6 @@ public boolean matchesAddress(SimpleString address) { return containsAddress; } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { return "QueueInfo [routingName=" + routingName + diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java index a1c9b952b79..6d13c2278f2 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressImpl.java @@ -64,7 +64,7 @@ public boolean containsWildCard() { /** * This method should actually be called `isMatchedBy`. * - * @return `true` if this equals otherAddr or this address is matched by a pattern represented by otherAddr + * @return {@code true} if this equals otherAddr or this address is matched by a pattern represented by otherAddr */ @Override public boolean matches(final Address otherAddr) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressMap.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressMap.java index 88f273eaaa1..df97126f6ce 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressMap.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/AddressMap.java @@ -46,7 +46,7 @@ public String[] getPaths(final SimpleString address) { } /** - * @param address - a non wildcard to match against wildcards in the map + * @param address a non wildcard to match against wildcards in the map */ public void visitMatchingWildcards(SimpleString address, AddressMapVisitor collector) throws Exception { @@ -56,8 +56,8 @@ public void visitMatchingWildcards(SimpleString address, } /** - * @param wildcardAddress - a wildcard address to match against non wildcards in the map - */ + * @param wildcardAddress a wildcard address to match against non wildcards in the map + */ public void visitMatching(SimpleString wildcardAddress, AddressMapVisitor collector) throws Exception { final String[] paths = getPaths(wildcardAddress); 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 2e774b937ec..2710d1df020 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 @@ -67,8 +67,8 @@ public final class BindingsImpl implements Bindings { private final Map bindingsIdMap = new ConcurrentHashMap<>(); /** - * This is the same as bindingsIdMap but indexed on the binding's uniqueName rather than ID. Two maps are - * maintained to speed routing, otherwise we'd have to loop through the bindingsIdMap when routing to an FQQN. + * This is the same as bindingsIdMap but indexed on the binding's uniqueName rather than ID. Two maps are maintained + * to speed routing, otherwise we'd have to loop through the bindingsIdMap when routing to an FQQN. */ private final Map bindingsNameMap = new ConcurrentHashMap<>(); @@ -315,7 +315,8 @@ private void route(final Message message, context.clear(); } - /* This is a special treatment for scaled-down messages involving SnF queues. + /* + * This is a special treatment for scaled-down messages involving SnF queues. * See org.apache.activemq.artemis.core.server.impl.ScaleDownHandler.scaleDownMessages() for the logic that sends messages with this property */ final byte[] ids = message.removeExtraBytesProperty(Message.HDR_SCALEDOWN_TO_IDS); @@ -431,9 +432,8 @@ public String toString() { /** * This code has a race on the assigned value to routing names. *

            - * This is not that much of an issue because
            - * Say you have the same queue name bound into two servers. The routing will load balance between - * these two servers. This will eventually send more messages to one server than the other + * This is not that much of an issue because say you have the same queue name bound into two servers. The routing + * will load balance between these two servers. This will eventually send more messages to one server than the other * (depending if you are using multi-thread), and not lose messages. */ private Binding getNextBinding(final Message message, @@ -461,8 +461,7 @@ private Binding getNextBinding(final Message message, nextPosition = moveNextPosition(nextPosition, bindingsCount); break; } - //https://issues.jboss.org/browse/HORNETQ-1254 When !routeWhenNoConsumers, - // the localQueue should always have the priority over the secondary bindings + // When !routeWhenNoConsumers, the localQueue should always have the priority over the secondary bindings if (lastLowPriorityBinding == -1 || loadBalancingType.equals(MessageLoadBalancingType.ON_DEMAND) && binding instanceof LocalQueueBinding) { lastLowPriorityBinding = nextPosition; } @@ -679,7 +678,6 @@ private static int moveNextPosition(int position, final int length) { /** * debug method: used just for tests!! - * @return */ public Map> getRoutingNameBindingMap() { return routingNameBindingMap.copyAsMap(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/CopyOnWriteBindings.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/CopyOnWriteBindings.java index 044b2663595..4e5e79fafa0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/CopyOnWriteBindings.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/CopyOnWriteBindings.java @@ -32,7 +32,7 @@ import org.apache.activemq.artemis.core.postoffice.Binding; /** - * This is a copy-on-write map of {@link Binding} along with the last index set.
            + * This is a copy-on-write map of {@link Binding} along with the last index set. */ final class CopyOnWriteBindings { @@ -131,9 +131,10 @@ public void removeBinding(Binding binding) { } /** - * Returns a snapshot of the bindings, if present and a "lazy" binding index, otherwise {@code null}.
            - * There is no strong commitment on preserving the index value if the related bindings are concurrently modified - * or the index itself is concurrently modified. + * Returns a snapshot of the bindings, if present and a "lazy" binding index, otherwise {@code null}. + *

            + * There is no strong commitment on preserving the index value if the related bindings are concurrently modified or + * the index itself is concurrently modified. */ public Pair getBindings(SimpleString routingName) { Objects.requireNonNull(routingName); @@ -153,14 +154,13 @@ public Pair getBindings(SimpleString routingName) { public interface BindingsConsumer { /** - * {@code bindings} cannot be {@code null} or empty. - * {@code nextPosition} cannot be null. + * {@code bindings} cannot be {@code null} or empty. {@code nextPosition} cannot be null. */ void accept(Binding[] bindings, BindingIndex nextPosition) throws T; } /** - * Iterates through the bindings and its related indexes.
            + * Iterates through the bindings and its related indexes. */ public void forEachBindings(BindingsConsumer bindingsConsumer) throws T { Objects.requireNonNull(bindingsConsumer); @@ -181,15 +181,15 @@ public void forEachBindings(BindingsConsumer bindingsCo public interface RoutingNameBindingsConsumer { /** - * {@code routingName} cannot be {@code null}. - * {@code bindings} cannot be {@code null} or empty. - * {@code nextPosition} cannot be null. + * @param routingName cannot be {@code null} + * @param bindings cannot be {@code null} or empty + * @param nextPosition cannot be null */ void accept(SimpleString routingName, Binding[] bindings, BindingIndex nextPosition) throws T; } /** - * Iterates through the bindings and its related indexes.
            + * Iterates through the bindings and its related indexes. */ public void forEach(RoutingNameBindingsConsumer bindingsConsumer) throws T { Objects.requireNonNull(bindingsConsumer); @@ -272,8 +272,8 @@ private static Binding[] removeBindingIfPresent(final AtomicReference } /** - * Returns {@code true} if the given binding has been added or already present, - * {@code false} if bindings are going to be garbage-collected. + * {@return {@code true} if the given binding has been added or already present, {@code false} if bindings are going + * to be garbage-collected} */ private static boolean addBindingIfAbsent(final AtomicReference bindings, final Binding newBinding) { Objects.requireNonNull(bindings); 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 32378207a95..dccce30a31d 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 @@ -38,11 +38,12 @@ import static org.apache.activemq.artemis.core.postoffice.impl.IntegerCache.boxedInts; /** - * {@link InMemoryDuplicateIDCache} and {@link PersistentDuplicateIDCache} impls have been separated for performance - * and memory footprint reasons.
            - * Instead of using a single {@link DuplicateIDCache} impl, we've let 2 different impls to contain just the bare - * minimum data in order to have 2 different memory footprint costs at runtime, while making easier to track dependencies - * eg in-memory cache won't need any {@link StorageManager} because no storage operations are expected to happen. + * {@link InMemoryDuplicateIDCache} and {@link PersistentDuplicateIDCache} impls have been separated for performance and + * memory footprint reasons. + *

            + * Instead of using a single {@link DuplicateIDCache} impl, we've let 2 different impls to contain just the bare minimum + * data in order to have 2 different memory footprint costs at runtime, while making easier to track dependencies eg + * in-memory cache won't need any {@link StorageManager} because no storage operations are expected to happen. */ final class InMemoryDuplicateIDCache implements DuplicateIDCache { 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 e495c4b2699..bcccddfa469 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 @@ -42,11 +42,12 @@ import static org.apache.activemq.artemis.core.postoffice.impl.IntegerCache.boxedInts; /** - * {@link InMemoryDuplicateIDCache} and {@link PersistentDuplicateIDCache} impls have been separated for performance - * and memory footprint reasons.
            - * Instead of using a single {@link DuplicateIDCache} impl, we've let 2 different impls to contain just the bare - * minimum data in order to have 2 different memory footprint costs at runtime, while making easier to track dependencies - * eg in-memory cache won't need any {@link StorageManager} because no storage operations are expected to happen. + * {@link InMemoryDuplicateIDCache} and {@link PersistentDuplicateIDCache} impls have been separated for performance and + * memory footprint reasons. + *

            + * Instead of using a single {@link DuplicateIDCache} impl, we've let 2 different impls to contain just the bare minimum + * data in order to have 2 different memory footprint costs at runtime, while making easier to track dependencies eg + * in-memory cache won't need any {@link StorageManager} because no storage operations are expected to happen. */ final class PersistentDuplicateIDCache implements DuplicateIDCache { 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 f0ba83c17a2..533c0eca44f 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 @@ -111,8 +111,8 @@ import static org.apache.activemq.artemis.utils.collections.IterableStream.iterableOf; /** - * This is the class that will make the routing to Queues and decide which consumer will get the messages - * It's the queue component on distributing the messages * * + * This is the class that will make the routing to Queues and decide which consumer will get the messages It's the queue + * component on distributing the messages * * */ public class PostOfficeImpl implements PostOffice, NotificationListener, BindingsFactory { @@ -1145,11 +1145,9 @@ public RoutingStatus route(final Message message, return route(message, context, direct, rejectDuplicates, bindingMove, false); } - /** - * The route can call itelf sending to DLA. - * if a DLA still not found, it should then use previous semantics. - * */ + * The route can call itelf sending to DLA. if a DLA still not found, it should then use previous semantics. + */ private RoutingStatus route(final Message message, final RoutingContext context, final boolean direct, @@ -1423,7 +1421,8 @@ public MessageReference reload(final Message message, final Queue queue, final T } /** - * The redistribution can't process the route right away as we may be dealing with a large message which will need to be processed on a different thread + * The redistribution can't process the route right away as we may be dealing with a large message which will need to + * be processed on a different thread */ @Override public Pair redistribute(final Message message, @@ -1611,9 +1610,6 @@ public void sendQueueInfoToQueue(final SimpleString queueName, final SimpleStrin } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { return "PostOfficeImpl [server=" + server + "]"; @@ -1802,9 +1798,6 @@ public static void storeDurableReference(StorageManager storageManager, Message /** * This will kick a delivery async on the queue, so the queue may have a chance to depage messages - * - * @param tx - * @param entry */ private void schedulePageDelivery(Transaction tx, Map.Entry entry) { if (tx != null) { @@ -2028,8 +2021,9 @@ private static boolean queueWasUsed(Queue queue, AddressSettings settings) { return queue.getMessagesExpired() > 0 || queue.getMessagesAcknowledged() > 0 || queue.getMessagesKilled() > 0 || queue.getConsumerRemovedTimestamp() != -1 || settings.getAutoDeleteQueuesSkipUsageCheck(); } - /** To be used by the AddressQueueReaper. - * It is also exposed for tests through PostOfficeTestAccessor */ + /** + * To be used by the AddressQueueReaper. It is also exposed for tests through PostOfficeTestAccessor + */ void reapAddresses(boolean initialCheck) { getLocalQueues().forEach(queue -> { AddressSettings settings = addressSettingsRepository.getMatch(queue.getAddress().toString()); 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 e8e327fac4b..dfa2c798edc 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 @@ -62,9 +62,6 @@ public class SimpleAddressManager implements AddressManager { private final ConcurrentMap localBindingsMap = new ConcurrentHashMap<>(); - /** - * {@code HashMap} - */ protected final ConcurrentMap mappings = new ConcurrentHashMap<>(); private final ConcurrentMap> nameMap = new ConcurrentHashMap<>(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/WildcardAddressManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/WildcardAddressManager.java index a7d4518f439..1e5085206dd 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/WildcardAddressManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/WildcardAddressManager.java @@ -83,9 +83,9 @@ public void visit(Bindings matchingBindings) throws Exception { } /** - * If the address to add the binding to contains a wildcard then a copy of the binding (with the same underlying queue) - * will be added to matching addresses. If the address is non wildcard, then we need to add any existing matching wildcard - * bindings to this address the first time we see it. + * If the address to add the binding to contains a wildcard then a copy of the binding (with the same underlying + * queue) will be added to matching addresses. If the address is non wildcard, then we need to add any existing + * matching wildcard bindings to this address the first time we see it. * * @param binding the binding to add * @return true if the address was a new mapping diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java index a7f469c1e9b..5450b76df34 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java @@ -178,7 +178,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception ctx.pipeline().remove(this); ctx.pipeline().remove(HTTP_HANDLER); ctx.fireChannelRead(msg); - } else if (upgrade != null && upgrade.equalsIgnoreCase(NettyConnector.ACTIVEMQ_REMOTING)) { // HORNETQ-1391 + } else if (upgrade != null && upgrade.equalsIgnoreCase(NettyConnector.ACTIVEMQ_REMOTING)) { // Send the response and close the connection if necessary. ctx.writeAndFlush(new DefaultFullHttpResponse(HTTP_1_1, FORBIDDEN)).addListener(ChannelFutureListener.CLOSE); } @@ -213,7 +213,6 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) t Set protocolSet = protocolMap.keySet(); if (!protocolSet.isEmpty()) { // Use getBytes(...) as this works with direct and heap buffers. - // See https://issues.jboss.org/browse/HORNETQ-1406 byte[] bytes = new byte[8]; in.getBytes(0, bytes); 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 5f89c45e11b..f6d97677e15 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 @@ -461,7 +461,8 @@ private void slowPacketHandler(final Packet packet) { final int clientVersion = remotingConnection.getChannelVersion(); BindingQueryResult result = session.executeBindingQuery(request.getAddress()); - /* if the session is JMS and it's from an older client then we need to add the old prefix to the queue + /* + * if the session is JMS and it's from an older client then we need to add the old prefix to the queue * names otherwise the older client won't realize the queue exists and will try to create it and receive * an error */ 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 ae975c430e5..9854ec37866 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 @@ -155,7 +155,7 @@ private void handleCreateSession(final CreateSessionMessage request) { throw ActiveMQMessageBundle.BUNDLE.serverNotStarted(); } - // XXX HORNETQ-720 Taylor commented out this test. Should be verified. + // Taylor commented out this test. Should be verified. /*if (!server.checkActivate()) { throw new ActiveMQException(ActiveMQException.SESSION_CREATION_REJECTED, @@ -242,7 +242,6 @@ private void handleReattachSession(final ReattachSessionMessage request) { ServerSessionPacketHandler sessionHandler = protocolManager.getSessionHandler(request.getName()); - // HORNETQ-720 XXX ataylor? if (/*!server.checkActivate() || */ sessionHandler == null) { response = new ReattachSessionResponseMessage(-1, false); } else { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManagerFactory.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManagerFactory.java index 0fe6ec0de92..4ab39a3600c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManagerFactory.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManagerFactory.java @@ -42,12 +42,7 @@ public Persister[] getPersister() { } /** - * {@inheritDoc} * - * - * @param server - * @param incomingInterceptors - * @param outgoingInterceptors - * @return + * {@inheritDoc} */ @Override public ProtocolManager createProtocolManager(final ActiveMQServer server, diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java index 1d91b10a8e4..80d72d32cf8 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupRegistrationMessage.java @@ -21,12 +21,10 @@ import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl; /** - * Registers a given backup-server as the replicating backup of a primary server (i.e. a regular - * ActiveMQ). + * Registers a given backup-server as the replicating backup of a primary server (i.e. a regular ActiveMQ). *

            - * If it succeeds the backup will start synchronization of its state with the new backup node, and - * replicating any new data. If it fails the backup server will receive a message indicating - * failure, and should shutdown. + * If it succeeds the backup will start synchronization of its state with the new backup node, and replicating any new + * data. If it fails the backup server will receive a message indicating failure, and should shutdown. * * @see BackupReplicationStartFailedMessage */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NodeAnnounceMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NodeAnnounceMessage.java index dfc5daf5678..eaf21bc1373 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NodeAnnounceMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NodeAnnounceMessage.java @@ -95,9 +95,6 @@ public String getScaleDownGroupName() { return scaleDownGroupName; } - /** - * @return the currentEventID - */ public long getCurrentEventID() { return currentEventID; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationAddMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationAddMessage.java index 7bf32f3aaba..9e9b1874ced 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationAddMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationAddMessage.java @@ -113,16 +113,10 @@ public void decodeRest(final ActiveMQBuffer buffer) { buffer.readBytes(recordData); } - /** - * @return the id - */ public long getId() { return id; } - /** - * @return the journalID - */ public byte getJournalID() { return journalID; } @@ -131,16 +125,10 @@ public ADD_OPERATION_TYPE getRecord() { return operation; } - /** - * @return the recordType - */ public byte getJournalRecordType() { return journalRecordType; } - /** - * @return the recordData - */ public byte[] getRecordData() { return recordData; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java index 3f8ef71dca4..26221673fa5 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationAddTXMessage.java @@ -131,9 +131,6 @@ public long getTxId() { return txId; } - /** - * @return the journalID - */ public byte getJournalID() { return journalID; } @@ -142,16 +139,10 @@ public ADD_OPERATION_TYPE getOperation() { return operation; } - /** - * @return the recordType - */ public byte getRecordType() { return recordType; } - /** - * @return the recordData - */ public byte[] getRecordData() { return recordData; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java index b449eb41bc6..550ac20b574 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java @@ -72,9 +72,6 @@ public long getTxId() { return txId; } - /** - * @return the journalID - */ public byte getJournalID() { return journalID; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java index c8fe3eec689..1cbcd0ff212 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationDeleteMessage.java @@ -59,16 +59,10 @@ public void decodeRest(final ActiveMQBuffer buffer) { id = buffer.readLong(); } - /** - * @return the id - */ public long getId() { return id; } - /** - * @return the journalID - */ public byte getJournalID() { return journalID; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java index 4e942bd58fe..5bedb827f4c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationDeleteTXMessage.java @@ -82,9 +82,6 @@ public void decodeRest(final ActiveMQBuffer buffer) { buffer.readBytes(recordData); } - /** - * @return the id - */ public long getId() { return id; } @@ -93,16 +90,10 @@ public long getTxId() { return txId; } - /** - * @return the journalID - */ public byte getJournalID() { return journalID; } - /** - * @return the recordData - */ public byte[] getRecordData() { return recordData; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeginMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeginMessage.java index 8f875ba69b5..961db4e7e84 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeginMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeginMessage.java @@ -51,9 +51,6 @@ public void decodeRest(final ActiveMQBuffer buffer) { messageId = buffer.readLong(); } - /** - * @return the messageId - */ public long getMessageId() { return messageId; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageEndMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageEndMessage.java index cdd78134957..783359f2c38 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageEndMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageEndMessage.java @@ -36,7 +36,8 @@ public ReplicationLargeMessageEndMessage() { public ReplicationLargeMessageEndMessage(final long messageId, final long pendingRecordId, final boolean isDelete) { this(); this.messageId = messageId; - /* We use a negative value to indicate that this id is pre-generated by primary node so that it won't be generated + /* + * We use a negative value to indicate that this id is pre-generated by primary node so that it won't be generated * at the backup. See https://issues.apache.org/jira/browse/ARTEMIS-1221. */ this.pendingRecordId = -pendingRecordId; @@ -69,9 +70,6 @@ public void decodeRest(final ActiveMQBuffer buffer) { } } - /** - * @return the messageId - */ public long getMessageId() { return messageId; } @@ -111,9 +109,6 @@ public long getPendingRecordId() { return pendingRecordId; } - /** - * @return the isDelete - */ public boolean isDelete() { return isDelete; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java index 40887d77ad4..82151c3b764 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java @@ -32,10 +32,6 @@ public ReplicationLargeMessageWriteMessage() { super(PacketImpl.REPLICATION_LARGE_MESSAGE_WRITE); } - /** - * @param messageId - * @param body - */ public ReplicationLargeMessageWriteMessage(final long messageId, final byte[] body) { this(); @@ -67,16 +63,10 @@ public void decodeRest(final ActiveMQBuffer buffer) { buffer.readBytes(body); } - /** - * @return the messageId - */ public long getMessageId() { return messageId; } - /** - * @return the body - */ public byte[] getBody() { return body; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java index 4d1a73b2d40..787218ecb5b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java @@ -84,23 +84,14 @@ public void decodeRest(final ActiveMQBuffer buffer) { isDelete = buffer.readBoolean(); } - /** - * @return the pageNumber - */ public long getPageNumber() { return pageNumber; } - /** - * @return the storeName - */ public SimpleString getStoreName() { return storeName; } - /** - * @return the isDelete - */ public boolean isDelete() { return isDelete; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java index 6c8b485cefb..28a1d6478d8 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageWriteMessage.java @@ -101,16 +101,10 @@ public SimpleString getAddress() { } } - /** - * @return the pageNumber - */ public long getPageNumber() { return pageNumber; } - /** - * @return the pagedMessage - */ public PagedMessage getPagedMessage() { return pagedMessage; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java index 886e2af93c7..507b3787696 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPrepareMessage.java @@ -78,16 +78,10 @@ public long getTxId() { return txId; } - /** - * @return the journalID - */ public byte getJournalID() { return journalID; } - /** - * @return the recordData - */ public byte[] getRecordData() { return recordData; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPrimaryIsStoppingMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPrimaryIsStoppingMessage.java index 1a5569a646d..a27d028897f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPrimaryIsStoppingMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPrimaryIsStoppingMessage.java @@ -29,13 +29,12 @@ public final class ReplicationPrimaryIsStoppingMessage extends PacketImpl { public enum PrimaryStopping { /** - * Notifies the backup that its primary is going to stop. The backup will then NOT fail-over if - * it gets signals from the cluster that its primary sent a disconnect. + * Notifies the backup that its primary is going to stop. The backup will then NOT fail-over if it gets signals + * from the cluster that its primary sent a disconnect. */ STOP_CALLED(0), /** - * Orders the backup to fail-over immediately. Meant as a follow-up message to - * {@link #STOP_CALLED}. + * Orders the backup to fail-over immediately. Meant as a follow-up message to {@link #STOP_CALLED}. */ FAIL_OVER(1); private final int code; @@ -51,9 +50,6 @@ public ReplicationPrimaryIsStoppingMessage() { super(PacketImpl.REPLICATION_SCHEDULED_FAILOVER); } - /** - * @param b - */ public ReplicationPrimaryIsStoppingMessage(PrimaryStopping b) { this(); this.primaryStopping = b; @@ -76,10 +72,8 @@ public void decodeRest(final ActiveMQBuffer buffer) { } /** - * The first message is sent to turn-off the quorumManager, which in some cases would trigger a - * faster fail-over than what would be correct. - * - * @return + * The first message is sent to turn-off the quorumManager, which in some cases would trigger a faster fail-over than + * what would be correct. */ public PrimaryStopping isFinalMessage() { return primaryStopping; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java index cd601bb8403..17cf9d44dd9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java @@ -29,8 +29,8 @@ /** * This message may signal start or end of the replication synchronization. *

            - * At start, it sends all fileIDs used in a given journal primary server to the backup, so the backup - * can reserve those IDs. + * At start, it sends all fileIDs used in a given journal primary server to the backup, so the backup can reserve those + * IDs. */ public class ReplicationStartSyncMessage extends PacketImpl { @@ -171,8 +171,8 @@ public boolean isServerToFailBack() { } /** - * @return {@code true} if the primary has finished synchronizing its data and the backup is - * therefore up-to-date, {@code false} otherwise. + * @return {@code true} if the primary has finished synchronizing its data and the backup is therefore up-to-date, + * {@code false} otherwise. */ public boolean isSynchronizationFinished() { return synchronizationIsFinished; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationSyncFileMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationSyncFileMessage.java index 8d891392c21..744d2fa3241 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationSyncFileMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationSyncFileMessage.java @@ -28,8 +28,8 @@ import org.apache.activemq.artemis.utils.DataConstants; /** - * Message is used to sync {@link org.apache.activemq.artemis.core.io.SequentialFile}s to a backup server. The {@link FileType} controls - * which extra information is sent. + * Message is used to sync {@link org.apache.activemq.artemis.core.io.SequentialFile}s to a backup server. The + * {@link FileType} controls which extra information is sent. */ public final class ReplicationSyncFileMessage extends PacketImpl { @@ -38,8 +38,8 @@ public final class ReplicationSyncFileMessage extends PacketImpl { */ private AbstractJournalStorageManager.JournalContent journalType; /** - * This value refers to {@link org.apache.activemq.artemis.core.journal.impl.JournalFile#getFileID()}, or the - * message id if we are sync'ing a large-message. + * This value refers to {@link org.apache.activemq.artemis.core.journal.impl.JournalFile#getFileID()}, or the message + * id if we are sync'ing a large-message. */ private long fileId; private int dataSize; @@ -59,8 +59,7 @@ public enum FileType { } /** - * @param readByte - * @return {@link FileType} corresponding to the byte code. + * @return {@link FileType} corresponding to the byte code */ public static FileType getFileType(byte readByte) { for (FileType type : ALL_OF) { 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 b124b1ae521..4e7279777bb 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 @@ -187,7 +187,7 @@ public synchronized boolean isStarted() { return started; } - /* + /** * Stop accepting new connections */ @Override diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java index 22d9d9eb3ca..2176d606c7d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java @@ -38,8 +38,7 @@ import io.netty.util.ReferenceCountUtil; /** - * Ensures that every request has a response and also that any uninitiated responses always wait for - * a response. + * Ensures that every request has a response and also that any uninitiated responses always wait for a response. */ public class HttpAcceptorHandler extends ChannelDuplexHandler { 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 57e86a874e0..80879c24846 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 @@ -215,10 +215,14 @@ public class NettyAcceptor extends AbstractAcceptor { private NotificationService notificationService; - /** The amount of time we wait before new tasks are added during a shutdown period. */ + /** + * The amount of time we wait before new tasks are added during a shutdown period. + */ private int quietPeriod; - /** The total amount of time we wait before a hard shutdown. */ + /** + * The total amount of time we wait before a hard shutdown. + */ private int shutdownTimeout; private boolean paused; @@ -566,8 +570,8 @@ public void setKeyStoreParameters(String keyStorePath, String keyStoreAlias) { } /** - * Transfers the Netty channel that has been created outside of this NettyAcceptor - * to control it and configure it according to this NettyAcceptor setting. + * Transfers the Netty channel that has been created outside of this NettyAcceptor to control it and configure it + * according to this NettyAcceptor setting. * * @param channel A Netty channel created outside this NettyAcceptor. */ @@ -843,8 +847,6 @@ public void setNotificationService(final NotificationService notificationService /** * not allowed - * - * @param defaultActiveMQPrincipal */ @Override public void setDefaultActiveMQPrincipal(ActiveMQPrincipal defaultActiveMQPrincipal) { @@ -853,8 +855,6 @@ public void setDefaultActiveMQPrincipal(ActiveMQPrincipal defaultActiveMQPrincip /** * only InVM acceptors should allow this - * - * @return */ @Override public boolean isUnsecurable() { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/RemotingService.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/RemotingService.java index e2a6ae83399..3ffae9576ac 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/RemotingService.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/RemotingService.java @@ -35,9 +35,9 @@ public interface RemotingService { /** - * Remove a connection from the connections held by the remoting service. - * This method must be used only from the management API. - * RemotingConnections are removed from the remoting service when their connectionTTL is hit. + * Remove a connection from the connections held by the remoting service. This method must be used only from + * the management API. RemotingConnections are removed from the remoting service when their connectionTTL is + * hit. * * @param remotingConnectionID the ID of the RemotingConnection to removed * @return the removed RemotingConnection @@ -49,7 +49,7 @@ public interface RemotingService { Set getConnections(); /** - * @return the number of clients connected to this server. + * {@return the number of clients connected to this server} */ default int getConnectionCount() { final Set connections = getConnections(); @@ -57,7 +57,7 @@ default int getConnectionCount() { } /** - * @return the number of clients which have connected to this server since it was started. + * {@return the number of clients which have connected to this server since it was started} */ long getTotalConnectionCount(); @@ -89,8 +89,6 @@ default int getConnectionCount() { * Allow acceptors to use this as their default security Principal if applicable. *

            * Used by AS7 integration code. - * - * @param principal */ void allowInvmSecurityOverride(ActiveMQPrincipal principal); @@ -105,16 +103,13 @@ default int getConnectionCount() { boolean isPaused(); /** - * Freezes and then disconnects all connections except the given one and tells the client where else - * it might connect (only applicable if server is in a cluster and uses scaleDown-on-failover=true). - * - * @param scaleDownNodeID - * @param remotingConnection + * Freezes and then disconnects all connections except the given one and tells the client where else it might connect + * (only applicable if server is in a cluster and uses scaleDown-on-failover=true). */ void freeze(String scaleDownNodeID, CoreRemotingConnection remotingConnection); /** - * Returns the acceptor identified by its {@code name} or {@code null} if it does not exists. + * {@return the acceptor identified by its {@code name} or {@code null} if it does not exists} * * @param name the name of the acceptor */ @@ -131,15 +126,12 @@ default int getConnectionCount() { void loadProtocolServices(List protocolServices); /** - * Provides an entry point for protocol services offered by this service instance - * to react to configuration updates. If the service implementation does not have any - * managed services or its services do not respond to updates it can ignore this call. - * services added should be added to the provided protocolServices list, and any removed - * should be found and removed from the list. - * - * @param protocolServices - * The list of protocol services known to the broker. + * Provides an entry point for protocol services offered by this service instance to react to configuration updates. + * If the service implementation does not have any managed services or its services do not respond to updates it can + * ignore this call. services added should be added to the provided protocolServices list, and any removed should be + * found and removed from the list. * + * @param protocolServices The list of protocol services known to the broker. * @throws Exception if an error is thrown during the services updates. */ void updateProtocolServices(List protocolServices) throws Exception; 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 0cd34b386f0..a2ec85ddcd6 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 @@ -210,7 +210,7 @@ public synchronized void start() throws Exception { createAcceptor(info); } - /** + /* * Don't start the acceptors here. Only start the acceptors at the every end of the start-up process to avoid * race conditions. See {@link #startAcceptors()}. */ @@ -826,10 +826,6 @@ protected void updateProtocols() { /** * Locates protocols from the internal default map and moves them into the input protocol map. - * - * @param protocolList - * @param transportConfig - * @param protocolMap */ private void locateProtocols(String protocolList, Object transportConfig, @@ -849,8 +845,6 @@ private void locateProtocols(String protocolList, /** * Finds protocol support from a given classloader. - * - * @param loader */ private void resolveProtocols(ClassLoader loader) { ServiceLoader serviceLoader = ServiceLoader.load(ProtocolManagerFactory.class, loader); @@ -859,8 +853,6 @@ private void resolveProtocols(ClassLoader loader) { /** * Loads the protocols found into a map. - * - * @param protocolManagerFactoryCollection */ private void loadProtocolManagerFactories(Iterable protocolManagerFactoryCollection) { for (ProtocolManagerFactory next : protocolManagerFactoryCollection) { 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 b688272c602..c0cccaa66c3 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 @@ -40,10 +40,11 @@ import java.lang.invoke.MethodHandles; /** - * Used by the {@link org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager} to replicate journal calls. + * Used by the {@link org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager} to replicate + * journal calls. *

            - * This class wraps a {@link ReplicationManager} and the local {@link Journal}. Every call will be - * relayed to both instances. + * This class wraps a {@link ReplicationManager} and the local {@link Journal}. Every call will be relayed to both + * instances. * * @see org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager */ @@ -90,14 +91,6 @@ public Journal getLocalJournal() { return localJournal; } - /** - * @param id - * @param recordType - * @param record - * @param sync - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendAddRecord(long, byte, byte[], boolean) - */ @Override public void appendAddRecord(final long id, final byte recordType, @@ -119,14 +112,6 @@ public void appendAddRecord(final long id, replicationManager.appendUpdateRecord(journalID, ADD_OPERATION_TYPE.ADD, id, recordType, persister, record); } - /** - * @param id - * @param recordType - * @param record - * @param sync - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendAddRecord(long, byte, org.apache.activemq.artemis.core.journal.EncodingSupport, boolean) - */ @Override public void appendAddRecord(final long id, final byte recordType, @@ -155,14 +140,6 @@ public void appendAddEvent(long id, replicationManager.appendUpdateRecord(journalID, ADD_OPERATION_TYPE.EVENT, id, recordType, persister, record); } - /** - * @param txID - * @param id - * @param recordType - * @param record - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendAddRecordTransactional(long, long, byte, byte[]) - */ @Override public void appendAddRecordTransactional(final long txID, final long id, @@ -171,14 +148,6 @@ public void appendAddRecordTransactional(final long txID, this.appendAddRecordTransactional(txID, id, recordType, new ByteArrayEncoding(record)); } - /** - * @param txID - * @param id - * @param recordType - * @param record - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendAddRecordTransactional(long, long, byte, org.apache.activemq.artemis.core.journal.EncodingSupport) - */ @Override public void appendAddRecordTransactional(final long txID, final long id, @@ -192,12 +161,6 @@ public void appendAddRecordTransactional(final long txID, replicationManager.appendAddRecordTransactional(journalID, ADD_OPERATION_TYPE.ADD, txID, id, recordType, persister, record); } - /** - * @param txID - * @param sync - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendCommitRecord(long, boolean) - */ @Override public void appendCommitRecord(final long txID, final boolean sync) throws Exception { if (logger.isTraceEnabled()) { @@ -228,12 +191,6 @@ public void appendCommitRecord(long txID, replicationManager.appendCommitRecord(journalID, txID, sync, lineUpContext); } - /** - * @param id - * @param sync - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendDeleteRecord(long, boolean) - */ @Override public void appendDeleteRecord(final long id, final boolean sync) throws Exception { if (logger.isTraceEnabled()) { @@ -243,12 +200,6 @@ public void appendDeleteRecord(final long id, final boolean sync) throws Excepti replicationManager.appendDeleteRecord(journalID, id); } - /** - * @param id - * @param sync - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendDeleteRecord(long, boolean) - */ @Override public void tryAppendDeleteRecord(final long id, final JournalUpdateCallback updateCallback, final boolean sync) throws Exception { if (logger.isTraceEnabled()) { @@ -280,25 +231,12 @@ public void tryAppendDeleteRecord(final long id, localJournal.tryAppendDeleteRecord(id, sync, updateCallback, completionCallback); replicationManager.appendDeleteRecord(journalID, id); } - /** - * @param txID - * @param id - * @param record - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendDeleteRecordTransactional(long, long, byte[]) - */ + @Override public void appendDeleteRecordTransactional(final long txID, final long id, final byte[] record) throws Exception { this.appendDeleteRecordTransactional(txID, id, new ByteArrayEncoding(record)); } - /** - * @param txID - * @param id - * @param record - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendDeleteRecordTransactional(long, long, org.apache.activemq.artemis.core.journal.EncodingSupport) - */ @Override public void appendDeleteRecordTransactional(final long txID, final long id, @@ -310,12 +248,6 @@ public void appendDeleteRecordTransactional(final long txID, replicationManager.appendDeleteRecordTransactional(journalID, txID, id, record); } - /** - * @param txID - * @param id - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendDeleteRecordTransactional(long, long) - */ @Override public void appendDeleteRecordTransactional(final long txID, final long id) throws Exception { if (logger.isTraceEnabled()) { @@ -325,25 +257,11 @@ public void appendDeleteRecordTransactional(final long txID, final long id) thro replicationManager.appendDeleteRecordTransactional(journalID, txID, id); } - /** - * @param txID - * @param transactionData - * @param sync - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendPrepareRecord(long, byte[], boolean) - */ @Override public void appendPrepareRecord(final long txID, final byte[] transactionData, final boolean sync) throws Exception { this.appendPrepareRecord(txID, new ByteArrayEncoding(transactionData), sync); } - /** - * @param txID - * @param transactionData - * @param sync - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendPrepareRecord(long, org.apache.activemq.artemis.core.journal.EncodingSupport, boolean) - */ @Override public void appendPrepareRecord(final long txID, final EncodingSupport transactionData, @@ -367,12 +285,6 @@ public void appendPrepareRecord(final long txID, replicationManager.appendPrepareRecord(journalID, txID, transactionData); } - /** - * @param txID - * @param sync - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendRollbackRecord(long, boolean) - */ @Override public void appendRollbackRecord(final long txID, final boolean sync) throws Exception { if (logger.isTraceEnabled()) { @@ -391,14 +303,6 @@ public void appendRollbackRecord(final long txID, final boolean sync, final IOCo replicationManager.appendRollbackRecord(journalID, txID); } - /** - * @param id - * @param recordType - * @param record - * @param sync - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendUpdateRecord(long, byte, byte[], boolean) - */ @Override public void appendUpdateRecord(final long id, final byte recordType, @@ -418,14 +322,6 @@ public void tryAppendUpdateRecord(final long id, this.tryAppendUpdateRecord(id, recordType, new ByteArrayEncoding(record), updateCallback, sync, replaceableRecord); } - /** - * @param id - * @param recordType - * @param record - * @param sync - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendUpdateRecord(long, byte, org.apache.activemq.artemis.core.journal.EncodingSupport, boolean) - */ @Override public void appendUpdateRecord(final long id, final byte recordType, @@ -483,14 +379,6 @@ public void tryAppendUpdateRecord(final long id, replicationManager.appendUpdateRecord(journalID, ADD_OPERATION_TYPE.UPDATE, id, journalRecordType, persister, record); } - /** - * @param txID - * @param id - * @param recordType - * @param record - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendUpdateRecordTransactional(long, long, byte, byte[]) - */ @Override public void appendUpdateRecordTransactional(final long txID, final long id, @@ -499,14 +387,6 @@ public void appendUpdateRecordTransactional(final long txID, this.appendUpdateRecordTransactional(txID, id, recordType, new ByteArrayEncoding(record)); } - /** - * @param txID - * @param id - * @param recordType - * @param record - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#appendUpdateRecordTransactional(long, long, byte, org.apache.activemq.artemis.core.journal.EncodingSupport) - */ @Override public void appendUpdateRecordTransactional(final long txID, final long id, @@ -520,13 +400,6 @@ public void appendUpdateRecordTransactional(final long txID, replicationManager.appendAddRecordTransactional(journalID, ADD_OPERATION_TYPE.UPDATE, txID, id, recordType, persister, record); } - /** - * @param committedRecords - * @param preparedTransactions - * @param transactionFailure - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#load(java.util.List, java.util.List, org.apache.activemq.artemis.core.journal.TransactionFailureCallback) - */ @Override public JournalLoadInformation load(final List committedRecords, final List preparedTransactions, @@ -535,13 +408,6 @@ public JournalLoadInformation load(final List committedRecords, return localJournal.load(committedRecords, preparedTransactions, transactionFailure, fixbadTX); } - /** - * @param committedRecords - * @param preparedTransactions - * @param transactionFailure - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#load(java.util.List, java.util.List, org.apache.activemq.artemis.core.journal.TransactionFailureCallback) - */ @Override public JournalLoadInformation load(final SparseArrayLinkedList committedRecords, final List preparedTransactions, @@ -550,29 +416,16 @@ public JournalLoadInformation load(final SparseArrayLinkedList commi return localJournal.load(committedRecords, preparedTransactions, transactionFailure, fixbadTX); } - /** - * @param reloadManager - * @throws Exception - * @see org.apache.activemq.artemis.core.journal.Journal#load(org.apache.activemq.artemis.core.journal.LoaderCallback) - */ @Override public JournalLoadInformation load(final LoaderCallback reloadManager) throws Exception { return localJournal.load(reloadManager); } - /** - * @throws Exception - * @see org.apache.activemq.artemis.core.server.ActiveMQComponent#start() - */ @Override public void start() throws Exception { localJournal.start(); } - /** - * @throws Exception - * @see org.apache.activemq.artemis.core.server.ActiveMQComponent#stop() - */ @Override public void stop() throws Exception { localJournal.stop(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicatedLargeMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicatedLargeMessage.java index cea74a30b28..15a9f049fa3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicatedLargeMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicatedLargeMessage.java @@ -21,7 +21,8 @@ /** * {@link org.apache.activemq.artemis.core.server.LargeServerMessage} methods used by the {@link ReplicationEndpoint}. *

            - * In practice a subset of the methods necessary to have a {@link org.apache.activemq.artemis.core.server.LargeServerMessage} + * In practice a subset of the methods necessary to have a + * {@link org.apache.activemq.artemis.core.server.LargeServerMessage} * * @see org.apache.activemq.artemis.core.persistence.impl.journal.LargeServerMessageInSync */ 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 e6705f1518c..e65eb54ed3f 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 @@ -89,8 +89,8 @@ import java.lang.invoke.MethodHandles; /** - * Handles all the synchronization necessary for replication on the backup side (that is the - * backup's side of the "remote backup" use case). + * Handles all the synchronization necessary for replication on the backup side (that is the backup's side of the + * "remote backup" use case). */ public final class ReplicationEndpoint implements ChannelHandler, ActiveMQComponent { @@ -121,8 +121,8 @@ public interface ReplicationEndpointEventListener { private final Map> filesReservedForSync = new HashMap<>(); /** - * Used to hold the real Journals before the backup is synchronized. This field should be - * {@code null} on an up-to-date server. + * Used to hold the real Journals before the backup is synchronized. This field should be {@code null} on an + * up-to-date server. */ private Map journalsHolder = new HashMap<>(); @@ -274,18 +274,11 @@ public void endOfBatch() { } } - /** - * @param packet - */ private void handleFatalError(BackupReplicationStartFailedMessage packet) { ActiveMQServerLogger.LOGGER.errorStartingReplication(packet.getRegistrationProblem()); server.stopTheServer(false); } - /** - * @param packet - * @throws ActiveMQException - */ private void handlePrimaryStopping(ReplicationPrimaryIsStoppingMessage packet) throws ActiveMQException { eventListener.onPrimaryStopping(packet.isFinalMessage()); } @@ -491,9 +484,6 @@ private synchronized void finishSynchronization(String primaryID, long activatio /** * Receives 'raw' journal/page/large-message data from primary server for synchronization of logs. - * - * @param msg - * @throws Exception */ private void handleReplicationSynchronization(ReplicationSyncFileMessage msg) throws Exception { long id = msg.getId(); @@ -543,13 +533,11 @@ private void handleReplicationSynchronization(ReplicationSyncFileMessage msg) th } /** - * Reserves files (with the given fileID) in the specified journal, and places a - * {@link FileWrapperJournal} in place to store messages while synchronization is going on. + * Reserves files (with the given fileID) in the specified journal, and places a {@link FileWrapperJournal} in place + * to store messages while synchronization is going on. * - * @param packet * @return if the incoming packet indicates the synchronization is finished then return an acknowledgement otherwise * return an empty response - * @throws Exception */ private ReplicationResponseMessageV2 handleStartReplicationSynchronization(final ReplicationStartSyncMessage packet) throws Exception { logger.trace("handleStartReplicationSynchronization:: nodeID = {}", packet); @@ -595,7 +583,8 @@ private ReplicationResponseMessageV2 handleStartReplicationSynchronization(final FileWrapperJournal syncJournal = new FileWrapperJournal(journal); registerJournal(journalContent.typeByte, syncJournal); - /* We send a response now to avoid a situation where we handle votes during the deactivation of the primary + /* + * We send a response now to avoid a situation where we handle votes during the deactivation of the primary * during a failback. */ if (supportResponseBatching) { @@ -606,7 +595,8 @@ private ReplicationResponseMessageV2 handleStartReplicationSynchronization(final // This needs to be done after the response is sent to avoid voting shutting it down for any reason. if (packet.getNodeID() != null) { - /* At the start of replication we still do not know which is the nodeID that the primary uses. + /* + * At the start of replication we still do not know which is the nodeID that the primary uses. * This is the point where the backup gets this information. */ eventListener.onPrimaryNodeId(packet.getNodeID()); @@ -646,9 +636,6 @@ private void handleLargeMessageEnd(final ReplicationLargeMessageEndMessage packe } } - /** - * @param packet - */ private void handleLargeMessageWrite(final ReplicationLargeMessageWriteMessage packet) throws Exception { ReplicatedLargeMessage message = lookupLargeMessage(packet.getMessageId(), false, true); if (message != null) { @@ -687,9 +674,6 @@ private ReplicatedLargeMessage lookupLargeMessage(final long messageId, } - /** - * @param packet - */ private void handleLargeMessageBegin(final ReplicationLargeMessageBeginMessage packet) { final long id = packet.getMessageId(); createLargeMessage(id, false); @@ -716,9 +700,6 @@ private ReplicatedLargeMessage newLargeMessage(long id, boolean liveToBackupSync return msg; } - /** - * @param packet - */ private void handleCommitRollback(final ReplicationCommitMessage packet) throws Exception { Journal journalToUse = getJournal(packet.getJournalID()); if (packet.isRollback()) { @@ -728,34 +709,22 @@ private void handleCommitRollback(final ReplicationCommitMessage packet) throws } } - /** - * @param packet - */ private void handlePrepare(final ReplicationPrepareMessage packet) throws Exception { Journal journalToUse = getJournal(packet.getJournalID()); journalToUse.appendPrepareRecord(packet.getTxId(), packet.getRecordData(), noSync); } - /** - * @param packet - */ private void handleAppendDeleteTX(final ReplicationDeleteTXMessage packet) throws Exception { Journal journalToUse = getJournal(packet.getJournalID()); journalToUse.appendDeleteRecordTransactional(packet.getTxId(), packet.getId(), packet.getRecordData()); } - /** - * @param packet - */ private void handleAppendDelete(final ReplicationDeleteMessage packet) throws Exception { Journal journalToUse = getJournal(packet.getJournalID()); journalToUse.tryAppendDeleteRecord(packet.getId(), null, noSync); } - /** - * @param packet - */ private void handleAppendAddTXRecord(final ReplicationAddTXMessage packet) throws Exception { Journal journalToUse = getJournal(packet.getJournalID()); @@ -766,10 +735,6 @@ private void handleAppendAddTXRecord(final ReplicationAddTXMessage packet) throw } } - /** - * @param packet - * @throws Exception - */ private void handleAppendAddRecord(final ReplicationAddMessage packet) throws Exception { Journal journalToUse = getJournal(packet.getJournalID()); switch (packet.getRecord()) { @@ -794,9 +759,6 @@ private void handleAppendAddRecord(final ReplicationAddMessage packet) throws Ex } } - /** - * @param packet - */ private void handlePageEvent(final ReplicationPageEventMessage packet) throws Exception { ConcurrentMap pages = getPageMap(packet.getStoreName()); @@ -823,9 +785,6 @@ private void handlePageEvent(final ReplicationPageEventMessage packet) throws Ex } - /** - * @param packet - */ private void handlePageWrite(final ReplicationPageWriteMessage packet) throws Exception { PagedMessage pgdMessage = packet.getPagedMessage(); pgdMessage.initMessage(storageManager); @@ -859,11 +818,6 @@ private Page getPage(final SimpleString storeName, final long pageId) throws Exc return page; } - /** - * @param pageId - * @param map - * @return - */ private synchronized Page newPage(final long pageId, final SimpleString storeName, final ConcurrentMap map) throws Exception { @@ -878,10 +832,6 @@ private synchronized Page newPage(final long pageId, return page; } - /** - * @param journalID - * @return - */ private Journal getJournal(final byte journalID) { return journals[journalID]; } @@ -919,9 +869,6 @@ public String toString() { } } - /** - * @param executor2 - */ public void setExecutor(Executor executor2) { this.executor = executor2; } 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 5d61b35e8f3..20751e587de 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 @@ -183,9 +183,6 @@ private static final class ReplicatePacketRequest { private boolean isFlushing; private boolean awaitingResume; - /** - * @param remotingConnection - */ public ReplicationManager(ActiveMQServer server, CoreRemotingConnection remotingConnection, final long timeout, @@ -282,10 +279,6 @@ public void appendRollbackRecord(final byte journalID, final long txID) throws E } } - /** - * @param storeName - * @param pageNumber - */ public void pageClosed(final SimpleString storeName, final long pageNumber) { if (started) { sendReplicatePacket(new ReplicationPageEventMessage(storeName, pageNumber, false, remotingConnection.isVersionUsingLongOnPageReplication())); @@ -412,7 +405,8 @@ public void stop(boolean clearTokens) throws Exception { /** * Completes any pending operations. *

            - * This can be necessary in case the primary loses the connection to the backup (network failure, or backup crashing). + * This can be necessary in case the primary loses the connection to the backup (network failure, or backup + * crashing). */ public void clearReplicationTokens() { logger.trace("clearReplicationTokens initiating"); @@ -596,9 +590,9 @@ private boolean checkEventLoop() { } /** - * @throws IllegalStateException By default, all replicated packets generate a replicated - * response. If your packets are triggering this exception, it may be because the - * packets were not sent with {@link #sendReplicatePacket(Packet)}. + * @throws IllegalStateException By default, all replicated packets generate a replicated response. If your packets + * are triggering this exception, it may be because the packets were not sent with + * {@link #sendReplicatePacket(Packet)}. */ private void replicated() { assert checkEventLoop(); @@ -677,9 +671,6 @@ public int getEncodeSize() { /** * Sends the whole content of the file to be duplicated. - * - * @throws ActiveMQException - * @throws Exception */ public void syncJournalFile(JournalFile jf, AbstractJournalStorageManager.JournalContent content) throws Exception { if (!started) { @@ -712,9 +703,7 @@ public void syncPages(SequentialFile file, long id, SimpleString queueName) thro * @param content journal type or {@code null} for large-messages and pages * @param pageStore page store name for pages, or {@code null} otherwise * @param id journal file id or (large) message id - * @param file * @param maxBytesToSend maximum number of bytes to read and send from the file - * @throws Exception */ private void sendLargeFile(AbstractJournalStorageManager.JournalContent content, SimpleString pageStore, @@ -790,10 +779,6 @@ private void awaitFlushOfReplicationStream(ReusableLatch flushed) throws Excepti /** * Reserve the following fileIDs in the backup server. - * - * @param datafiles - * @param contentType - * @throws ActiveMQException */ public void sendStartSyncMessage(JournalFile[] datafiles, AbstractJournalStorageManager.JournalContent contentType, @@ -806,10 +791,8 @@ public void sendStartSyncMessage(JournalFile[] datafiles, /** * Informs backup that data synchronization is done. *

            - * So if 'live' fails, the (up-to-date) backup now may take over its duties. To do so, it must - * know which is the live's {@code nodeID}. - * - * @param nodeID + * So if 'live' fails, the (up-to-date) backup now may take over its duties. To do so, it must know which is the + * live's {@code nodeID}. */ public void sendSynchronizationDone(String nodeID, long initialReplicationSyncTimeout, IOCriticalErrorListener criticalErrorListener) throws ActiveMQReplicationTimeooutException { if (started) { @@ -854,10 +837,7 @@ public void sendSynchronizationDone(String nodeID, long initialReplicationSyncTi /** * Reserves several LargeMessage IDs in the backup. *

            - * Doing this before hand removes the need of synchronizing large-message deletes with the - * largeMessageSyncList. - * - * @param largeMessages + * Doing this before hand removes the need of synchronizing large-message deletes with the largeMessageSyncList. */ public void sendLargeMessageIdListMessage(Map> largeMessages) { List idsToSend; @@ -870,10 +850,8 @@ public void sendLargeMessageIdListMessage(Map> largeMes /** * Notifies the backup that the primary server is stopping. *

            - * This notification allows the backup to skip quorum voting (or any other measure to avoid - * 'split-brain') and do a faster fail-over. - * - * @return + * This notification allows the backup to skip quorum voting (or any other measure to avoid 'split-brain') and do a + * faster fail-over. */ public OperationContext sendPrimaryIsStopping(final PrimaryStopping finalMessage) { logger.debug("PRIMARY IS STOPPING?!? message={} enabled={}", finalMessage, started); @@ -893,9 +871,6 @@ public CoreRemotingConnection getBackupTransportConnection() { return remotingConnection; } - /** - * @return - */ public boolean isSynchronizing() { return inSync; } 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 5576eb95982..8587683426d 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 @@ -94,7 +94,7 @@ public class SecurityStoreImpl implements SecurityStore, HierarchicalRepositoryC /** - * @param notificationService can be null + * @param notificationService can be {@code null} */ public SecurityStoreImpl(final HierarchicalRepository> securityRepository, final ActiveMQSecurityManager securityManager, @@ -285,9 +285,7 @@ public void check(final SimpleString address, Set roles = securityRepository.getMatch(bareAddress.toString()); - /* - * If a valid queue is passed in and there's an exact match for the FQQN then use the FQQN instead of the address - */ + // If a valid queue is passed in and there's an exact match for the FQQN then use the FQQN instead of the address SimpleString fqqn = null; if (bareQueue != null) { fqqn = CompositeAddress.toFullyQualified(bareAddress, bareQueue); @@ -305,10 +303,10 @@ public void check(final SimpleString address, if (securityManager instanceof ActiveMQSecurityManager5 manager5) { Subject subject = getSubjectForAuthorization(session, manager5); - /** + /* * A user may authenticate successfully at first, but then later when their Subject is evicted from the - * local cache re-authentication may fail. This could happen, for example, if the user was removed - * from LDAP or the user's token expired. + * local cache re-authentication may fail. This could happen, for example, if the user was removed from LDAP + * or the user's token expired. * * If the subject is null then authorization will *always* fail. */ @@ -393,12 +391,11 @@ public String getCaller(String user, Subject subject) { } /** - * Get the cached Subject. If the Subject is not in the cache then authenticate again to retrieve - * it. + * Get the cached Subject. If the Subject is not in the cache then authenticate again to retrieve it. * * @param session contains the authentication data - * @return the authenticated Subject with all associated role principals or null if not - * authenticated or JAAS is not supported by the SecurityManager. + * @return the authenticated Subject with all associated role principals or null if not authenticated or JAAS is not + * supported by the SecurityManager. */ @Override public Subject getSessionSubject(SecurityAuth session) { @@ -437,7 +434,7 @@ private void authenticationFailed(String user, RemotingConnection connection) th /** * Get the cached Subject. If the Subject is not in the cache then authenticate again to retrieve it. * - * @param auth contains the authentication data + * @param auth contains the authentication data * @param securityManager used to authenticate the user if the Subject is not in the cache * @return the authenticated Subject with all associated role principals */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivateCallback.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivateCallback.java index c5e5d6ea024..111ca86ef23 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivateCallback.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivateCallback.java @@ -18,38 +18,39 @@ public interface ActivateCallback { - /* + /** * this is called before any services are started when the server first initialised */ default void preActivate() { } - /* - * this is called after most of the services have been started but before any cluster resources or JMS resources have been + /** + * this is called after most of the services have been started but before any cluster resources or JMS resources have + * been */ default void activated() { } - /* + /** * this is called when the server is stopping, after any network resources and clients are closed but before the rest * of the resources */ default void deActivate() { } - /* + /** * this is called when the server is stopping, before any resources or clients are closed/stopped */ default void preDeActivate() { } - /* + /** * this is called when all resources have been started including any JMS resources */ default void activationComplete() { } - /* + /** * This is called when the broker is stopped (no shutdown in place) */ default void stop(ActiveMQServer server) { @@ -57,6 +58,4 @@ default void stop(ActiveMQServer server) { default void shutdown(ActiveMQServer server) { } - - } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivationFailureListener.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivationFailureListener.java index 960394bcd35..3ae3ec67925 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivationFailureListener.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActivationFailureListener.java @@ -17,8 +17,8 @@ package org.apache.activemq.artemis.core.server; /** - * This interface represents a way users can be alerted to activation failures that don't necessarily constitute a - * fatal problem for the broker (e.g. the failure to start an acceptor) + * This interface represents a way users can be alerted to activation failures that don't necessarily constitute a fatal + * problem for the broker (e.g. the failure to start an acceptor) */ public interface ActivationFailureListener { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java index ff5d56dfb79..10783a770f1 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQMessageBundle.java @@ -263,25 +263,37 @@ public interface ActiveMQMessageBundle { IllegalArgumentException errorCreatingTransformerClass(String transformerClassName, Exception e); /** - * Message used on on {@link org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, String)} + * Message used on on + * {@link + * org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, + * String)} */ @Message(id = 229076, value = "Executing destroyConnection with {}={} through management's request") String destroyConnectionWithSessionMetadataHeader(String key, String value); /** - * Message used on on {@link org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, String)} + * Message used on on + * {@link + * org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, + * String)} */ @Message(id = 229077, value = "Closing connection {}") String destroyConnectionWithSessionMetadataClosingConnection(String serverSessionString); /** - * Exception used on on {@link org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, String)} + * Exception used on on + * {@link + * org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, + * String)} */ @Message(id = 229078, value = "Disconnected per admin's request on {}={}") ActiveMQDisconnectedException destroyConnectionWithSessionMetadataSendException(String key, String value); /** - * Message used on on {@link org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, String)} + * Message used on on + * {@link + * org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#destroyConnectionWithSessionMetadata(String, + * String)} */ @Message(id = 229079, value = "No session found with {}={}") String destroyConnectionWithSessionMetadataNoSessionFound(String key, String value); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java index d35cad4304e..8eda29c73c3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java @@ -86,8 +86,8 @@ import org.apache.activemq.artemis.utils.critical.CriticalAnalyzer; /** - * This interface defines the internal interface of the ActiveMQ Artemis Server exposed to other components - * of the server. + * This interface defines the internal interface of the ActiveMQ Artemis Server exposed to other components of the + * server. *

            * This is not part of our public API. */ @@ -95,21 +95,22 @@ public interface ActiveMQServer extends ServiceComponent { enum SERVER_STATE { /** - * start() has been called but components are not initialized. The whole point of this state, - * is to be in a state which is different from {@link SERVER_STATE#STARTED} and - * {@link SERVER_STATE#STOPPED}, so that methods testing for these two values such as - * {@link #stop(boolean)} worked as intended. + * {@link #start()} has been called but components are not initialized. This is an intermediate state between + * {@link SERVER_STATE#STARTED} and {@link SERVER_STATE#STOPPED} so that methods testing for these two values such + * as {@link #stop(boolean)} work as intended. */ - STARTING, /** - * server is started. {@code server.isStarted()} returns {@code true}, and all assumptions - * about it hold. + STARTING, + /** + * server is started. {@link #isStarted()} returns {@code true} and all assumptions about it hold. */ - STARTED, /** - * stop() was called but has not finished yet. Meant to avoids starting components while - * stop() is executing. + STARTED, + /** + * {@link #stop()} was called but has not finished yet. Meant to avoids starting components while {@link #stop()} + * is executing. */ - STOPPING, /** - * Stopped: either stop() has been called and has finished running, or start() has never been + STOPPING, + /** + * Stopped: either {@link #stop()} has been called and has finished running, or {@link #start()} has never been * called. */ STOPPED @@ -124,11 +125,10 @@ enum SERVER_STATE { /** * Sets the server identity. *

            - * The identity will be exposed on logs. It may help to debug issues on the log traces and - * debugs. + * The identity will be exposed on logs. It may help to debug issues on the log traces and debugs. *

            - * This method was created mainly for testing but it may be used in scenarios where you need to - * have more than one Server inside the same VM. + * This method was created mainly for testing but it may be used in scenarios where you need to have more than one + * Server inside the same VM. */ void setIdentity(String identity); @@ -142,8 +142,10 @@ enum SERVER_STATE { void installMirrorController(MirrorController mirrorController); - /** This method will scan all queues and addresses. - * it is supposed to be called before the mirrorController is started */ + /** + * This method will scan all queues and addresses. it is supposed to be called before the mirrorController is + * started + */ void scanAddresses(MirrorController mirrorController) throws Exception; MirrorController getMirrorController(); @@ -184,12 +186,14 @@ enum SERVER_STATE { */ void lockActivation(); - /** The server has a default listener that will propagate errors to registered listeners. - * This will return the main listener*/ + /** + * The server has a default listener that will propagate errors to registered listeners. This will return the main + * listener + */ IOCriticalErrorListener getIoCriticalErrorListener(); /** - * Returns the resource to manage this ActiveMQ Artemis server. + * {@return the resource to manage this ActiveMQ Artemis server} * * @throws IllegalStateException if the server is not properly started. */ @@ -202,14 +206,14 @@ enum SERVER_STATE { /** * Register a listener to detect problems during activation * - * @param listener @see org.apache.activemq.artemis.core.server.ActivationFailureListener + * @see org.apache.activemq.artemis.core.server.ActivationFailureListener */ void registerActivationFailureListener(ActivationFailureListener listener); /** * Register a listener to detect I/O Critical errors * - * @param listener @see org.apache.activemq.artemis.core.io.IOCriticalErrorListener + * @see org.apache.activemq.artemis.core.io.IOCriticalErrorListener */ void registerIOCriticalErrorListener(IOCriticalErrorListener listener); @@ -217,8 +221,6 @@ enum SERVER_STATE { /** * Remove a previously registered failure listener - * - * @param listener */ void unregisterActivationFailureListener(ActivationFailureListener listener); @@ -230,33 +232,39 @@ enum SERVER_STATE { void callActivationFailureListeners(Exception e); /** - * @param callback {@link org.apache.activemq.artemis.core.server.PostQueueCreationCallback} + * Register a {@link org.apache.activemq.artemis.core.server.PostQueueDeletionCallback} to be called after a queue is + * created. + * + * @param callback the {@link org.apache.activemq.artemis.core.server.PostQueueCreationCallback} to call after a + * queue is created */ void registerPostQueueCreationCallback(PostQueueCreationCallback callback); /** - * @param callback {@link org.apache.activemq.artemis.core.server.PostQueueCreationCallback} + * Unregister a {@link org.apache.activemq.artemis.core.server.PostQueueCreationCallback}. + * + * @param callback the {@link org.apache.activemq.artemis.core.server.PostQueueCreationCallback} to unregister */ void unregisterPostQueueCreationCallback(PostQueueCreationCallback callback); - /** - * @param queueName - */ void callPostQueueCreationCallbacks(SimpleString queueName) throws Exception; /** - * @param callback {@link org.apache.activemq.artemis.core.server.PostQueueDeletionCallback} + * Register a {@link org.apache.activemq.artemis.core.server.PostQueueDeletionCallback} to be called after a queue is + * deleted. + * + * @param callback the {@link org.apache.activemq.artemis.core.server.PostQueueDeletionCallback} to call after a + * queue is deleted */ void registerPostQueueDeletionCallback(PostQueueDeletionCallback callback); /** - * @param callback {@link org.apache.activemq.artemis.core.server.PostQueueDeletionCallback} + * Unregister a {@link org.apache.activemq.artemis.core.server.PostQueueDeletionCallback}. + * + * @param callback the {@link org.apache.activemq.artemis.core.server.PostQueueDeletionCallback} to unregister */ void unregisterPostQueueDeletionCallback(PostQueueDeletionCallback callback); - /** - * @param queueName - */ void callPostQueueDeletionCallbacks(SimpleString address, SimpleString queueName) throws Exception; void registerBrokerPlugin(ActiveMQServerBasePlugin plugin); @@ -366,7 +374,9 @@ ServerSession createSession(String name, String validatedUser, boolean isLegacyProducer) throws Exception; - /** This is to be used in places where security is bypassed, like internal sessions, broker connections, etc... */ + /** + * This is to be used in places where security is bypassed, like internal sessions, broker connections, etc... + */ ServerSession createInternalSession(String name, int minLargeMessageSize, RemotingConnection remotingConnection, @@ -382,12 +392,16 @@ ServerSession createInternalSession(String name, String securityDomain, boolean isLegacyProducer) throws Exception; - /** should the server rebuild page counters upon startup. - * this will be useful on testing or an embedded broker scenario */ + /** + * should the server rebuild page counters upon startup. this will be useful on testing or an embedded broker + * scenario + */ boolean isRebuildCounters(); - /** should the server rebuild page counters upon startup. - * this will be useful on testing or an embedded broker scenario */ + /** + * should the server rebuild page counters upon startup. this will be useful on testing or an embedded broker + * scenario + */ void setRebuildCounters(boolean rebuildCounters); SecurityStore getSecurityStore(); @@ -427,7 +441,7 @@ ServerSession createInternalSession(String name, List getSessions(String connectionID); /** - * @return a session containing the meta-key and meata-value + * {@return a session containing the meta-key and meata-value} */ ServerSession lookupSession(String metakey, String metavalue); @@ -442,35 +456,32 @@ ServerSession createInternalSession(String name, long getUptimeMillis(); /** - * Returns whether the initial replication synchronization process with the backup server is complete; applicable for - * either the primary or backup server. + * {@return whether the initial replication synchronization process with the backup server is complete; applicable + * for either the primary or backup server} */ boolean isReplicaSync(); /** * Wait for server initialization. * - * @param timeout - * @param unit - * @return {@code true} if the server was already initialized or if it was initialized within the - * timeout period, {@code false} otherwise. - * @throws InterruptedException + * @return {@code true} if the server was already initialized or if it was initialized within the timeout period, + * {@code false} otherwise. * @see java.util.concurrent.CountDownLatch#await(long, java.util.concurrent.TimeUnit) */ boolean waitForActivation(long timeout, TimeUnit unit) throws InterruptedException; /** - * Creates a transient queue. A queue that will exist as long as there are consumers. - * The queue will be deleted as soon as all the consumers are removed. + * Creates a transient queue. A queue that will exist as long as there are consumers. The queue will be deleted as + * soon as all the consumers are removed. *

            * Notice: the queue won't be deleted until the first consumer arrives. * - * @param address - * @param name - * @param filterString - * @param durable - * @throws org.apache.activemq.artemis.api.core.ActiveMQInvalidTransientQueueUseException if the shared queue already exists with a different {@code address} or {@code filterString} - * @throws NullPointerException if {@code address} is {@code null} + * @throws org.apache.activemq.artemis.api.core.ActiveMQInvalidTransientQueueUseException if the shared queue already + * exists with a different + * {@code address} or + * {@code filterString} + * @throws NullPointerException if {@code address} is + * {@code null} */ @Deprecated void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString name, SimpleString filterString, @@ -603,7 +614,7 @@ Queue createQueue(SimpleString address, RoutingType routingType, SimpleString qu * details on configuration specifics. *

            * Some dynamic defaults will be enforced via address-settings for the corresponding unset properties: - *

              + *
                *
              • {@code maxConsumers} *
              • {@code exclusive} *
              • {@code groupRebalance} @@ -621,36 +632,34 @@ Queue createQueue(SimpleString address, RoutingType routingType, SimpleString qu *
              • {@code autoDelete} (only set if queue was auto-created) *
              • {@code autoDeleteDelay} *
              • {@code autoDeleteMessageCount} - *

              + *

            * * @param queueConfiguration the configuration to use when creating the queue - * @param ignoreIfExists whether or not to simply return without an exception if the queue exists + * @param ignoreIfExists whether to simply return without an exception if the queue exists * @return the {@code Queue} instance that was created - * @throws Exception */ Queue createQueue(QueueConfiguration queueConfiguration, boolean ignoreIfExists) throws Exception; /** - * This method is essentially the same as {@link #createQueue(QueueConfiguration, boolean)} with a few key exceptions. + * This method is essentially the same as {@link #createQueue(QueueConfiguration, boolean)} with a few key + * exceptions. *

            * If {@code durable} is {@code true} then: - *

              + *
                *
              • {@code transient} will be forced to {@code false} *
              • {@code temporary} will be forced to {@code false} - *

              + *

            * If {@code durable} is {@code false} then: - *

              + *
                *
              • {@code transient} will be forced to {@code true} *
              • {@code temporary} will be forced to {@code true} - *

              + *

            > * In all instances {@code autoCreated} will be forced to {@code false} and {@code autoCreatedAddress} will be forced * to {@code true}. - * + *

            * The {@code boolean} passed to {@link #createQueue(QueueConfiguration, boolean)} will always be true; * * @see #createQueue(QueueConfiguration, boolean) - * - * @throws org.apache.activemq.artemis.api.core.ActiveMQInvalidTransientQueueUseException if the shared queue already exists with a different {@code address} or {@code filterString} */ void createSharedQueue(QueueConfiguration queueConfiguration) throws Exception; @@ -761,12 +770,10 @@ void destroyQueue(SimpleString queueName, void registerBrokerConnection(BrokerConnection brokerConnection); /** - * Removes the given broker connection from the tracked set of active broker - * connection entries. Unregistering the connection results in it being forgotten - * and the caller is responsible for stopping the connection. + * Removes the given broker connection from the tracked set of active broker connection entries. Unregistering the + * connection results in it being forgotten and the caller is responsible for stopping the connection. * - * @param brokerConnection - * The broker connection that should be forgotten. + * @param brokerConnection The broker connection that should be forgotten. */ void unregisterBrokerConnection(BrokerConnection brokerConnection); @@ -777,10 +784,7 @@ void destroyQueue(SimpleString queueName, Collection getBrokerConnections(); /** - * return true if there is a binding for this address (i.e. if there is a created queue) - * - * @param address - * @return + * {@return {@code true} if there is a binding for this address (i.e. if there is a created queue)} */ boolean isAddressBound(String address) throws Exception; @@ -858,7 +862,7 @@ Queue updateQueue(String name, * Update the queue named in the {@code QueueConfiguration} with the corresponding properties. Set only the * properties that you wish to change from their existing values. Only the following properties can actually be * updated: - *

              + *
                *
              • {@code routingType} *
              • {@code filter} *
              • {@code maxConsumers} @@ -878,28 +882,26 @@ Queue updateQueue(String name, * * @param queueConfiguration the {@code QueueConfiguration} to use * @return the updated {@code Queue} instance - * @throws Exception */ Queue updateQueue(QueueConfiguration queueConfiguration) throws Exception; /** + * Update a queue's configuration. + * * @param queueConfiguration the {@code QueueConfiguration} to use - * @param forceUpdate If true, no null check is performed and unset queueConfiguration values are reset to null + * @param forceUpdate If {@code true}, no {@code null} check is performed and unset queueConfiguration values + * are reset to {@code null} * @return the updated {@code Queue} instance - * @throws Exception * @see #updateQueue(QueueConfiguration) */ Queue updateQueue(QueueConfiguration queueConfiguration, boolean forceUpdate) throws Exception; - /* - * add a ProtocolManagerFactory to be used. Note if @see Configuration#isResolveProtocols is tur then this factory will - * replace any factories with the same protocol - * */ + /** + * add a ProtocolManagerFactory to be used. Note if {@link Configuration#isResolveProtocols} is true then this + * factory will replace any factories with the same protocol + */ void addProtocolManagerFactory(ProtocolManagerFactory factory); - /* - * add a ProtocolManagerFactory to be used. - * */ void removeProtocolManagerFactory(ProtocolManagerFactory factory); ReloadManager getReloadManager(); @@ -923,9 +925,11 @@ Queue updateQueue(String name, void setSecurityManager(ActiveMQSecurityManager securityManager); /** - * Adding external components is allowed only if the state - * isn't {@link SERVER_STATE#STOPPED} or {@link SERVER_STATE#STOPPING}.
                - * It atomically starts the {@code externalComponent} while being added if {@code start == true}.
                + * Adding external components is allowed only if the stateisn't {@link SERVER_STATE#STOPPED} or + * {@link SERVER_STATE#STOPPING}. + *

                + * It atomically starts the {@code externalComponent} while being added if {@code start == true}. + *

                * This atomicity is necessary to prevent {@link #stop()} to stop the component right after adding it, but before * starting it. * @@ -946,10 +950,9 @@ Queue updateQueue(String name, /** * Updates an {@code AddressInfo} on the broker with the specified routing types. * - * @param address the name of the {@code AddressInfo} to update + * @param address the name of the {@code AddressInfo} to update * @param routingTypes the routing types to update the {@code AddressInfo} with * @return {@code true} if the {@code AddressInfo} was updated, {@code false} otherwise - * @throws Exception */ boolean updateAddressInfo(SimpleString address, EnumSet routingTypes) throws Exception; @@ -961,7 +964,6 @@ Queue updateQueue(String name, * * @param addressInfo the {@code AddressInfo} to add * @return {@code true} if the {@code AddressInfo} was added, {@code false} otherwise - * @throws Exception */ boolean addAddressInfo(AddressInfo addressInfo) throws Exception; @@ -971,7 +973,6 @@ Queue updateQueue(String name, * * @param addressInfo the {@code AddressInfo} to add or the info used to update the existing {@code AddressInfo} * @return the resulting {@code AddressInfo} - * @throws Exception */ AddressInfo addOrUpdateAddressInfo(AddressInfo addressInfo) throws Exception; @@ -979,8 +980,7 @@ Queue updateQueue(String name, * Remove an {@code AddressInfo} from the broker. * * @param address the {@code AddressInfo} to remove - * @param auth authorization information; {@code null} is valid - * @throws Exception + * @param auth authorization information; {@code null} is valid */ void removeAddressInfo(SimpleString address, SecurityAuth auth) throws Exception; @@ -988,8 +988,7 @@ Queue updateQueue(String name, * Remove an {@code AddressInfo} from the broker. * * @param address the {@code AddressInfo} to remove - * @param auth authorization information; {@code null} is valid - * @throws Exception + * @param auth authorization information; {@code null} is valid */ void autoRemoveAddressInfo(SimpleString address, SecurityAuth auth) throws Exception; @@ -999,9 +998,8 @@ Queue updateQueue(String name, * Remove an {@code AddressInfo} from the broker. * * @param address the {@code AddressInfo} to remove - * @param auth authorization information; {@code null} is valid - * @param force It will disconnect everything from the address including queues and consumers - * @throws Exception + * @param auth authorization information; {@code null} is valid + * @param force It will disconnect everything from the address including queues and consumers */ void removeAddressInfo(SimpleString address, SecurityAuth auth, boolean force) throws Exception; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServers.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServers.java index 0cb1de17f8c..67379f3e93d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServers.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServers.java @@ -32,8 +32,8 @@ /** * ActiveMQServers is a factory class for instantiating ActiveMQServer instances. *

                - * This class should be used when you want to instantiate an ActiveMQServer instance for embedding in - * your own application, as opposed to directly instantiating an implementing instance. + * This class should be used when you want to instantiate an ActiveMQServer instance for embedding in your own + * application, as opposed to directly instantiating an implementing instance. */ public final class ActiveMQServers { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BrokerConnection.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BrokerConnection.java index a629ca80f1b..7f7deb9b172 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BrokerConnection.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/BrokerConnection.java @@ -19,8 +19,8 @@ import org.apache.activemq.artemis.core.config.brokerConnectivity.BrokerConnectConfiguration; /** - * A broker connection defines a server connection created to provide services - * between this server and another instance. + * A broker connection defines a server connection created to provide services between this server and another + * instance. */ public interface BrokerConnection extends ActiveMQComponent { @@ -33,22 +33,22 @@ default void shutdown() throws Exception { } /** - * @return the unique name of the broker connection + * {@return the unique name of the broker connection} */ String getName(); /** - * @return the protocol that underlies the broker connection implementation. + * {@return the protocol that underlies the broker connection implementation} */ String getProtocol(); /** - * @return true if the broker connection is currently connected to the remote. + * {@return {@code true} if the broker connection is currently connected to the remote} */ boolean isConnected(); /** - * @return the configuration that was used to create this broker connection. + * {@return the configuration that was used to create this broker connection} */ BrokerConnectConfiguration getConfiguration(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Consumer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Consumer.java index 933cf72a9d4..79b97b0834a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Consumer.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Consumer.java @@ -27,6 +27,7 @@ public interface Consumer extends PriorityAware { /** + * Whether this {@code Consumer} supports direct delivery. * * @see SessionCallback#supportsDirectDelivery() */ @@ -35,21 +36,19 @@ default boolean supportsDirectDelivery() { } /** - * There was a change on semantic during 2.3 here.
                + * There was a change on semantic during 2.3 here. + *

                * We now first accept the message, and the actual deliver is done as part of - * {@link #proceedDeliver(MessageReference)}. This is to avoid holding a lock on the queues while - * the delivery is being accomplished To avoid a lock on the queue in case of misbehaving - * consumers. + * {@link #proceedDeliver(MessageReference)}. This is to avoid holding a lock on the queues while the delivery is + * being accomplished To avoid a lock on the queue in case of misbehaving consumers. *

                * This should return busy if handle is called before proceed deliver is called - * - * @param reference - * @return - * @throws Exception */ HandleStatus handle(MessageReference reference) throws Exception; - /** wakes up internal threads to deliver more messages */ + /** + * wakes up internal threads to deliver more messages + */ default void promptDelivery() { } @@ -58,12 +57,9 @@ default boolean isClosed() { } /** - * This will proceed with the actual delivery. - * Notice that handle should hold a readLock and proceedDelivery should release the readLock - * any lock operation on Consumer should also get a writeLock on the readWriteLock - * to guarantee there are no pending deliveries - * - * @throws Exception + * This will proceed with the actual delivery. Notice that handle should hold a readLock and proceedDelivery should + * release the readLock any lock operation on Consumer should also get a writeLock on the readWriteLock to guarantee + * there are no pending deliveries */ void proceedDeliver(MessageReference reference) throws Exception; @@ -73,18 +69,13 @@ default Binding getBinding() { Filter getFilter(); - /** - * @return the list of messages being delivered - */ List getDeliveringMessages(); String debug(); /** - * This method will create a string representation meant for management operations. - * This is different from the toString method that's meant for debugging and will contain information that regular users won't understand well - * - * @return + * This method will create a string representation meant for management operations. This is different from the + * toString method that's meant for debugging and will contain information that regular users won't understand well */ String toManagementString(); @@ -95,7 +86,9 @@ default Binding getBinding() { void failed(Throwable t); - /** an unique sequential ID for this consumer */ + /** + * an unique sequential ID for this consumer + */ long sequentialID(); @Override diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ConsumerInfo.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ConsumerInfo.java index 3ac36b3ef71..7324128d233 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ConsumerInfo.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ConsumerInfo.java @@ -21,16 +21,24 @@ public interface ConsumerInfo { - /** an unique sequential ID for this consumer */ + /** + * an unique sequential ID for this consumer + */ long getSequentialID(); - /** @return name of the queue that is being consumed */ + /** + * {@return name of the queue that is being consumed} + */ SimpleString getQueueName(); - /** @return routing type of the queue that is being consumed */ + /** + * {@return routing type of the queue that is being consumed} + */ RoutingType getQueueType(); - /** @return address of the queue that is being consumed */ + /** + * {@return address of the queue that is being consumed} + */ SimpleString getQueueAddress(); SimpleString getFilterString(); @@ -40,73 +48,58 @@ public interface ConsumerInfo { String getConnectionClientID(); /** - * Returns the name of the protocol for this Remoting Connection - * @return the name of protocol + * {@return the name of the protocol for this Remoting Connection} */ String getConnectionProtocolName(); /** - * Returns a string representation of the local address this connection is - * connected to. This is useful when the server is configured at 0.0.0.0 (or - * multiple IPs). This will give you the actual IP that's being used. - * - * @return the local address + * {@return a string representation of the local IP address this connection is connected to; useful when the server + * is configured at {@code 0.0.0.0} (or multiple IPs)} */ String getConnectionLocalAddress(); /** - * Returns a string representation of the remote address this connection is - * connected to. - * - * @return the remote address + * {@return a string representation of the remote address this connection is connected to} */ String getConnectionRemoteAddress(); /** - * Returns how many messages are out for delivery but not yet acknowledged - * @return delivering count + * {@return how many messages are out for delivery but not yet acknowledged} */ int getMessagesInTransit(); /** - * Returns the combined size of all the messages out for delivery but not yet acknowledged - * @return the total size of all the messages + * {@return the combined size of all the messages out for delivery but not yet acknowledged} */ long getMessagesInTransitSize(); /** - * Returns The total number of messages sent to a consumer including redeliveries that have been acknowledged - * @return the total number of messages delivered. + * {@return the total number of messages sent to a consumer including redeliveries that have been acknowledged} */ long getMessagesDelivered(); /** - * Returns the total size of all the messages delivered to the consumer. This includes redelivered messages - * @return The total size of all the messages + * {@return the total size of all the messages delivered to the consumer including redelivered messages} */ long getMessagesDeliveredSize(); /** - * Returns the number of messages acknowledged by this consumer since it was created - * @return messages acknowledged + * {@return the number of messages acknowledged by this consumer since it was created} */ long getMessagesAcknowledged(); /** - * Returns the number of acknowledged messages that are awaiting commit in a transaction - * @return th eno acknowledgements awaiting commit + * {@return the number of acknowledged messages that are awaiting commit an a transaction} */ int getMessagesAcknowledgedAwaitingCommit(); /** - * Returns the time in milliseconds that the last message was delivered to a consumer - * @return the time of the last message delivered + * {@return the time in milliseconds that the last message was delivered to a consumer} */ long getLastDeliveredTime(); /** - * Returns the time in milliseconds that the last message was acknowledged by a consumer - * @return the time of the last message was acknowledged + * {@return the time in milliseconds that the last message was acknowledged by a consumer} */ long getLastAcknowledgedTime(); } \ No newline at end of file diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/CoreLargeServerMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/CoreLargeServerMessage.java index 7794228d9ae..de8427718e3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/CoreLargeServerMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/CoreLargeServerMessage.java @@ -18,8 +18,7 @@ package org.apache.activemq.artemis.core.server; /** - * This is a tagging interface, - * as we need to make sure the LargeMessage is a core large message is certain places. + * This is a tagging interface, as we need to make sure the LargeMessage is a core large message is certain places. */ public interface CoreLargeServerMessage extends LargeServerMessage { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/HandleStatus.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/HandleStatus.java index c5968f1872d..a765ae74e68 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/HandleStatus.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/HandleStatus.java @@ -18,11 +18,11 @@ /** * A HandleStatus - * + *

                * HANDLED means the MessageReference was handled - * + *

                * NO_MATCH means the MessageReference was rejected by a Filter - * + *

                * BUSY means the MessageReference was rejected since the ClientConsumer was busy */ public enum HandleStatus { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/LargeServerMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/LargeServerMessage.java index ed5220c0a4a..f61777b279e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/LargeServerMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/LargeServerMessage.java @@ -57,8 +57,6 @@ default void addBytes(ActiveMQBuffer bytes) throws Exception { /** * This will return the File suitable for appending the message - * @return - * @throws ActiveMQException */ SequentialFile getAppendFile() throws ActiveMQException; 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 d5739708477..0c081178f9c 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 @@ -24,8 +24,7 @@ /** * A memory usage watcher. *

                - * This class will run a thread monitoring memory usage and log warnings in case we are low on - * memory. + * This class will run a thread monitoring memory usage and log warnings in case we are low on memory. */ public class MemoryManager implements ActiveMQComponent { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/MessageReference.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/MessageReference.java index a803d88d9e9..1176436eee4 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/MessageReference.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/MessageReference.java @@ -16,7 +16,6 @@ */ package org.apache.activemq.artemis.core.server; - import java.util.function.Consumer; import org.apache.activemq.artemis.api.core.ActiveMQException; @@ -28,12 +27,13 @@ /** * A reference to a message. - * + *

                * Channels store message references rather than the messages themselves. */ public interface MessageReference { final class Factory { + public static MessageReference createReference(Message encode, final Queue queue) { return new MessageReferenceImpl(encode, queue); } @@ -54,39 +54,36 @@ default boolean skipDelivery() { SimpleString getLastValueProperty(); /** - * This is to be used in cases where a message delivery happens on an executor. - * Most MessageReference implementations will allow execution, and if it does, - * and the protocol requires an execution per message, this callback may be used. - * + * This is to be used in cases where a message delivery happens on an executor. Most MessageReference implementations + * will allow execution, and if it does, and the protocol requires an execution per message, this callback may be + * used. + *

                * At the time of this implementation only AMQP was used. */ void onDelivery(Consumer callback); /** - * We define this method aggregation here because on paging we need to hold the original estimate, - * so we need to perform some extra steps on paging. - * - * @return + * We define this method aggregation here because on paging we need to hold the original estimate, so we need to + * perform some extra steps on paging. */ int getMessageMemoryEstimate(); /** - * To be used on holding protocol specific data during the delivery. - * This will be only valid while the message is on the delivering queue at the consumer + * To be used on holding protocol specific data during the delivery. This will be only valid while the message is on + * the delivering queue at the consumer */ T getProtocolData(Class typeClass); /** - * To be used on holding protocol specific data during the delivery. - * This will be only valid while the message is on the delivering queue at the consumer + * To be used on holding protocol specific data during the delivery. This will be only valid while the message is on + * the delivering queue at the consumer */ void setProtocolData(Class typeClass, T data); MessageReference copy(Queue queue); /** - * @return The time in the future that delivery will be delayed until, or zero if - * no scheduled delivery will occur + * {@return The time in the future that delivery will be delayed until, or zero if no scheduled delivery will occur} */ long getScheduledDeliveryTime(); @@ -135,12 +132,9 @@ default boolean skipDelivery() { boolean isAlreadyAcked(); /** - * This is the size of the message when persisted on disk which is used for metrics tracking - * Note that even if the message itself is not persisted on disk (ie non-durable) this value is - * still used for metrics tracking for the amount of data on a queue - * - * @return - * @throws ActiveMQException + * This is the size of the message when persisted on disk which is used for metrics tracking Note that even if the + * message itself is not persisted on disk (ie non-durable) this value is still used for metrics tracking for the + * amount of data on a queue */ long getPersistentSize() throws ActiveMQException; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/NodeLocator.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/NodeLocator.java index 15fb10fde69..7e49a82e824 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/NodeLocator.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/NodeLocator.java @@ -25,7 +25,7 @@ /** * A class that will locate a particular server running in a cluster. How this server is chosen is a job for the * implementation. - * + *

                * This is used for replication (which needs a QuorumManager) and scaling-down (which does not need a QuorumManager). */ public abstract class NodeLocator implements ClusterTopologyListener { @@ -60,12 +60,12 @@ public NodeLocator() { public abstract void locateNode() throws ActiveMQException; /** - * Returns the current connector + * {@return the current connector} */ public abstract Pair getPrimaryConfiguration(); /** - * Returns the node id for the current connector + * {@return the node id for the current connector} */ public abstract String getNodeID(); 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 7ac6ab80690..e08b4023d26 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 @@ -120,8 +120,6 @@ public UUID getUUID() { * Sets the nodeID. *

                * Only used by replicating backups. - * - * @param nodeID */ public void setNodeID(String nodeID) { synchronized (nodeIDGuard) { @@ -130,9 +128,6 @@ public void setNodeID(String nodeID) { } } - /** - * @param generateUUID - */ protected void setUUID(UUID generateUUID) { synchronized (nodeIDGuard) { uuid = generateUUID; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java index 8df1f0d5cb3..061a32927b9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/Queue.java @@ -60,8 +60,10 @@ public interface Queue extends Bindable, CriticalComponent { void setRoutingType(RoutingType routingType); - /** the current queue and consumer settings will allow use of the Reference Execution and callback. - * This is because */ + /** + * the current queue and consumer settings will allow use of the Reference Execution and callback. + * This is because + */ boolean allowsReferenceCallback(); boolean isDurable(); @@ -74,16 +76,17 @@ public interface Queue extends Bindable, CriticalComponent { void refDown(MessageReference messageReference); - /** Remove item with a supplied non-negative {@literal (>= 0) } ID. - * If the idSupplier returns {@literal < 0} the ID is considered a non value (null) and it will be ignored. + /** + * Remove item with a supplied non-negative {@literal (>= 0) } ID. If the idSupplier returns {@literal < 0} the ID is + * considered a non value (null) and it will be ignored. * - * @see org.apache.activemq.artemis.utils.collections.LinkedList#setNodeStore(NodeStore) */ + * @see org.apache.activemq.artemis.utils.collections.LinkedList#setNodeStore(NodeStore) + */ MessageReference removeWithSuppliedID(String serverID, long id, NodeStoreFactory nodeStore); /** - * The queue definition could be durable, but the messages could eventually be considered non durable. - * (e.g. purgeOnNoConsumers) - * @return + * The queue definition could be durable, but the messages could eventually be considered non durable. (e.g. + * purgeOnNoConsumers) */ boolean isDurableMessage(); @@ -187,16 +190,16 @@ default boolean isMirrorController() { default void setMirrorController(boolean mirrorController) { } - /** - * This will hold a reference counter for every consumer present on the queue. - * The ReferenceCounter will know what to do when the counter became zeroed. - * This is used to control what to do with temporary queues, especially - * on shared subscriptions where the queue needs to be deleted when all the - * consumers are closed. + /** + * This will hold a reference counter for every consumer present on the queue. The ReferenceCounter will know what to + * do when the counter became zeroed. This is used to control what to do with temporary queues, especially on shared + * subscriptions where the queue needs to be deleted when all the consumers are closed. */ ReferenceCounter getConsumersRefCount(); - /* Called when a message is cancelled back into the queue */ + /** + * Called when a message is cancelled back into the queue + */ void addSorted(List refs, boolean scheduling); void reload(MessageReference ref); @@ -212,7 +215,9 @@ default void flushOnIntermediate(Runnable runnable) { void addHead(MessageReference ref, boolean scheduling); - /* Called when a message is cancelled back into the queue */ + /** + * Called when a message is cancelled back into the queue + */ void addSorted(MessageReference ref, boolean scheduling); void addHead(List refs, boolean scheduling); @@ -248,7 +253,9 @@ default void flushOnIntermediate(Runnable runnable) { void deleteQueue(boolean removeConsumers) throws Exception; - /** This method will push a removeAddress call into server's remove address */ + /** + * This method will push a removeAddress call into server's remove address + */ void removeAddress() throws Exception; void destroyPaging() throws Exception; @@ -256,9 +263,9 @@ default void flushOnIntermediate(Runnable runnable) { long getMessageCount(); /** - * This is the size of the messages in the queue when persisted on disk which is used for metrics tracking - * to give an idea of the amount of data on the queue to be consumed - * + * This is the size of the messages in the queue when persisted on disk which is used for metrics tracking to give an + * idea of the amount of data on the queue to be consumed + *

                * Note that this includes all messages on the queue, even messages that are non-durable which may only be in memory */ long getPersistentSize(); @@ -294,10 +301,8 @@ default void flushOnIntermediate(Runnable runnable) { List getScheduledMessages(); /** - * Return a Map consisting of consumer.toString and its messages - * Delivering message is a property of the consumer, this method will aggregate the results per Server's consumer object - * - * @return + * Return a Map consisting of consumer.toString and its messages. Delivering message is a property of the consumer. + * This method will aggregate the results per Server's consumer object. */ Map> getDeliveringMessages(); @@ -351,11 +356,7 @@ default void expireReferences() { int sendMessagesToDeadLetterAddress(Filter filter) throws Exception; /** - * - * @param tx - * @param ref - * @return whether or not the message was actually sent to a DLA with bindings - * @throws Exception + * {@return whether the message was actually sent to a DLA with bindings} */ boolean sendToDeadLetterAddress(Transaction tx, MessageReference ref) throws Exception; @@ -408,20 +409,13 @@ default int retryMessages(Filter filter, Integer expectedHits) throws Exception int getGroupCount(); /** - * - * @param ref - * @param timeBase - * @param ignoreRedeliveryDelay - * @return a Pair of Booleans: the first indicates whether or not redelivery happened; the second indicates whether - * or not the message was actually sent to a DLA with bindings - * @throws Exception + * {@return a Pair of Booleans: the first indicates whether redelivery happened; the second indicates whether or not + * the message was actually sent to a DLA with bindings} */ Pair checkRedelivery(MessageReference ref, long timeBase, boolean ignoreRedeliveryDelay) throws Exception; /** * It will iterate through memory only (not paging) - * - * @return */ LinkedListIterator iterator(); @@ -450,38 +444,27 @@ default MessageReference peekFirstScheduledMessage() { SimpleString getDeadLetterAddress(); /** - * Pauses the queue. It will receive messages but won't give them to the consumers until resumed. - * If a queue is paused, pausing it again will only throw a warning. - * To check if a queue is paused, invoke isPaused() + * Pauses the queue. It will receive messages but won't give them to the consumers until resumed. If a queue is + * paused, pausing it again will only throw a warning. To check if a queue is paused, invoke isPaused() */ void pause(); /** - * Pauses the queue. It will receive messages but won't give them to the consumers until resumed. - * If a queue is paused, pausing it again will only throw a warning. - * To check if a queue is paused, invoke isPaused() + * Pauses the queue. It will receive messages but won't give them to the consumers until resumed. If a queue is + * paused, pausing it again will only throw a warning. To check if a queue is paused, invoke {@link #isPaused()}. */ void pause(boolean persist); void reloadPause(long recordID); /** - * Resumes the delivery of message for the queue. - * If a queue is resumed, resuming it again will only throw a warning. - * To check if a queue is resumed, invoke isPaused() + * Resumes the delivery of message for the queue. If a queue is resumed, resuming it again will only throw a warning. + * To check if a queue is resumed, invoke {@link #isPaused()}. */ void resume(); - /** - * @return true if paused, false otherwise. - */ boolean isPaused(); - /** - * if the pause was persisted - * - * @return - */ boolean isPersistedPause(); Executor getExecutor(); @@ -498,8 +481,6 @@ default MessageReference peekFirstScheduledMessage() { /** * We can't send stuff to DLQ on queues used on clustered-bridge-communication - * - * @return */ boolean isInternalQueue(); @@ -534,17 +515,13 @@ default MessageReference peekFirstScheduledMessage() { void postAcknowledge(MessageReference ref, AckReason reason, boolean delivering); - /** - * @return the user associated with this queue - */ SimpleString getUser(); - /** - * @param user the user associated with this queue - */ void setUser(SimpleString user); - /** This is to perform a check on the counter again */ + /** + * This is to perform a check on the counter again + */ void recheckRefCount(OperationContext context); default void errorProcessing(Consumer consumer, Throwable t, MessageReference messageReference) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/QueueConfig.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/QueueConfig.java index 2b8ebb82565..1d902f5bb46 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/QueueConfig.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/QueueConfig.java @@ -256,11 +256,11 @@ public Builder routingType(RoutingType routingType) { /** * Returns a new {@link QueueConfig} using the parameters configured on the {@link Builder}. - *
                + *

                * The reference parameters aren't defensively copied from the {@link Builder} to the {@link QueueConfig}. - *
                - * This method creates a new {@link PageSubscription} only if {@link #pagingManager} is not {@code null} and - * if {@link FilterUtils#isTopicIdentification} returns {@code false} on {@link #filter}. + *

                + * This method creates a new {@link PageSubscription} only if {@link #pagingManager} is not {@code null} and if + * {@link FilterUtils#isTopicIdentification} returns {@code false} on {@link #filter}. * * @throws IllegalStateException if the creation of {@link PageSubscription} fails */ @@ -288,10 +288,10 @@ public QueueConfig build() { } /** - * Returns a new {@link Builder} of a durable, not temporary and autoCreated {@link QueueConfig} with the given {@code id} and {@code name}. - *
                - * The {@code address} is defaulted to the {@code name} value. - * The reference parameters aren't defensively copied. + * Returns a new {@link Builder} of a durable, not temporary and autoCreated {@link QueueConfig} with the given + * {@code id} and {@code name}. + *

                + * The {@code address} is defaulted to the {@code name} value. The reference parameters aren't defensively copied. * * @param id the id of the queue to be created * @param name the name of the queue to be created @@ -302,8 +302,9 @@ public static Builder builderWith(final long id, final SimpleString name) { } /** - * Returns a new {@link Builder} of a durable, not temporary and autoCreated {@link QueueConfig} with the given {@code id}, {@code name} and {@code address}. - *
                + * Returns a new {@link Builder} of a durable, not temporary and autoCreated {@link QueueConfig} with the given + * {@code id}, {@code name} and {@code address}. + *

                * The reference parameters aren't defensively copied. * * @param id the id of the queue to be created diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/QueueFactory.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/QueueFactory.java index b8fd8345934..76992c2f07c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/QueueFactory.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/QueueFactory.java @@ -24,8 +24,8 @@ /** * A QueueFactory *

                - * Implementations of this class know how to create queues with the correct attribute values - * based on default and overrides + * Implementations of this class know how to create queues with the correct attribute values based on default and + * overrides */ public interface QueueFactory { @@ -33,8 +33,6 @@ public interface QueueFactory { /** * This is required for delete-all-reference to work correctly with paging - * - * @param postOffice */ void setPostOffice(PostOffice postOffice); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/RemoteBrokerConnection.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/RemoteBrokerConnection.java index 3bbea387e27..3924683dd54 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/RemoteBrokerConnection.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/RemoteBrokerConnection.java @@ -17,8 +17,7 @@ package org.apache.activemq.artemis.core.server; /** - * A remote broker connection defines a view of the remote end of an active - * {@link BrokerConnection}. + * A remote broker connection defines a view of the remote end of an active {@link BrokerConnection}. */ public interface RemoteBrokerConnection { @@ -37,21 +36,19 @@ public interface RemoteBrokerConnection { void shutdown() throws Exception; /** - * Returns the name of the broker connection as defined on the remote server. This value - * is unique on the remote server but is only unique on the local end when combined with - * the unique node Id from which the broker connection was initiated. - * - * @return the unique name of the remote broker connection. + * {@return the name of the broker connection as defined on the remote server; this value is unique on the remote + * server but is only unique on the local end when combined with the unique node Id from which the broker connection + * was initiated} */ String getName(); /** - * @return the node Id of the remote broker that created the incoming connection. + * {@return the node Id of the remote broker that created the incoming connection} */ String getNodeId(); /** - * @return the protocol that underlies the broker connection implementation. + * {@return the protocol that underlies the broker connection implementation} */ String getProtocol(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/RoutingContext.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/RoutingContext.java index 000ede4d37c..44101dc8f6e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/RoutingContext.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/RoutingContext.java @@ -53,7 +53,9 @@ public interface RoutingContext { boolean isMirrorIndividualRoute(); - /** return true if every queue routed is internal */ + /** + * return true if every queue routed is internal + */ boolean isInternal(); MirrorController getMirrorSource(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/SecuritySettingPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/SecuritySettingPlugin.java index 5a287d31761..3a7d7d9eb3a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/SecuritySettingPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/SecuritySettingPlugin.java @@ -30,10 +30,12 @@ default void setInit(Map props) { } /** - * Initialize the plugin with the given configuration options. This method is called by the broker when the file-based - * configuration is read (see {@code org.apache.activemq.artemis.core.deployers.impl.FileConfigurationParser#parseSecurity(org.w3c.dom.Element, org.apache.activemq.artemis.core.config.Configuration)}. - * If you're creating/configuring the plugin programmatically then the recommended approach is to simply use the plugin's - * getters/setters rather than this method. + * Initialize the plugin with the given configuration options. This method is called by the broker when the + * file-based configuration is read (see + * {@code org.apache.activemq.artemis.core.deployers.impl.FileConfigurationParser#parseSecurity(org.w3c.dom.Element, + * org.apache.activemq.artemis.core.config.Configuration)}. If you're creating/configuring the plugin + * programmatically then the recommended approach is to simply use the plugin's getters/setters rather than this + * method. * * @param options name/value pairs used to configure the SecuritySettingPlugin instance * @return {@code this} instance @@ -50,8 +52,8 @@ default void setInit(Map props) { /** * Fetch the security role information from the external environment (e.g. file, LDAP, etc.) and return it. * - * @return the Map's key corresponds to the "match" for the security setting and the corresponding value is the set of - * {@code org.apache.activemq.artemis.core.security.Role} objects defining the appropriate authorization + * @return the Map's key corresponds to the "match" for the security setting and the corresponding value is the set + * of {@code org.apache.activemq.artemis.core.security.Role} objects defining the appropriate authorization */ Map> getSecurityRoles(); @@ -59,8 +61,6 @@ default void setInit(Map props) { * This method is called by the broker during the start-up process. It's for plugins that might need to modify the * security settings during runtime (e.g. LDAP plugin that uses a listener to receive updates, etc.). Any changes * made to this {@code HierarchicalRepository} will be reflected in the broker. - * - * @param securityRepository */ void setSecurityRepository(HierarchicalRepository> securityRepository); } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerConsumer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerConsumer.java index 646df6a7873..cc0bc74083f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerConsumer.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerConsumer.java @@ -21,9 +21,6 @@ import org.apache.activemq.artemis.core.transaction.Transaction; -/** - * A ServerConsumer - */ public interface ServerConsumer extends Consumer, ConsumerInfo { void setlowConsumerDetection(SlowConsumerDetectionListener listener); @@ -32,8 +29,9 @@ public interface ServerConsumer extends Consumer, ConsumerInfo { void fireSlowConsumer(); - /** the current queue settings will allow use of the Reference Execution and callback. - * This is because */ + /** + * The current queue settings will allow use of the Reference Execution and callback. + */ boolean allowReferenceCallback(); /** @@ -46,15 +44,10 @@ public interface ServerConsumer extends Consumer, ConsumerInfo { */ void setProtocolData(Object protocolData); - /** - * @param protocolContext - * @see #getProtocolContext() - */ void setProtocolContext(Object protocolContext); /** - * An object set by the Protocol implementation. - * it could be anything pre-determined by the implementation + * An object set by the Protocol implementation. it could be anything pre-determined by the implementation */ Object getProtocolContext(); @@ -65,11 +58,8 @@ public interface ServerConsumer extends Consumer, ConsumerInfo { void close(boolean failed) throws Exception; /** - * This method is just to remove itself from Queues. - * If for any reason during a close an exception occurred, the exception treatment - * will call removeItself what should take the consumer out of any queues. - * - * @throws Exception + * This method is just to remove itself from Queues. If for any reason during a close an exception occurred, the + * exception treatment will call removeItself what should take the consumer out of any queues. */ void removeItself() throws Exception; @@ -84,8 +74,8 @@ public interface ServerConsumer extends Consumer, ConsumerInfo { MessageReference removeReferenceByID(long messageID) throws Exception; /** - * Some protocols may choose to send the message back to delivering instead of redeliver. - * For example openwire will redeliver through the client, so messages will go back to delivering list after rollback. + * Some protocols may choose to send the message back to delivering instead of redeliver. For example openwire will + * redeliver through the client, so messages will go back to delivering list after rollback. */ void backToDelivering(MessageReference reference); @@ -113,7 +103,8 @@ List scanDeliveringReferences(boolean remove, /** * This is needed when some protocols (OW) handle the acks themselves and need to update the metrics - * @param ref the message reference + * + * @param ref the message reference * @param transaction the tx */ void metricsAcknowledge(MessageReference ref, Transaction transaction); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerMessage.java index 8e5665a5fe5..095865fda7a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerMessage.java @@ -29,10 +29,8 @@ public interface ServerMessage extends MessageInternal { MessageReference createReference(Queue queue); /** - * This will force encoding of the address, and will re-check the buffer - * This is to avoid setMessageTransient which set the address without changing the buffer - * - * @param address + * This will force encoding of the address, and will re-check the buffer. This is to avoid setMessageTransient which + * set the address without changing the buffer */ void forceAddress(SimpleString address); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerSession.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerSession.java index 9357138b1f4..c50a5d49843 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerSession.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServerSession.java @@ -50,8 +50,8 @@ public interface ServerSession extends SecurityAuth { Executor getSessionExecutor(); /** - * Certain protocols may create an internal session that shouldn't go through security checks. - * make sure you don't expose this property through any protocol layer as that would be a security breach + * Certain protocols may create an internal session that shouldn't go through security checks. Make sure you don't + * expose this property through any protocol layer as that would be a security breach */ void enableSecurity(); @@ -122,7 +122,7 @@ ServerConsumer createConsumer(long consumerID, boolean supportLargeMessage, Integer credits) throws Exception; - /** + /** * To be used by protocol heads that needs to control the transaction outside the session context. */ void resetTX(Transaction transaction); @@ -144,14 +144,6 @@ Queue createQueue(AddressInfo address, /** * Create queue with default delivery mode - * - * @param address - * @param name - * @param filterString - * @param temporary - * @param durable - * @return - * @throws Exception */ @Deprecated Queue createQueue(SimpleString address, @@ -282,7 +274,7 @@ Queue createQueue(AddressInfo addressInfo, /** * This method invokes {@link ActiveMQServer#createQueue(QueueConfiguration)} with a few client-specific additions: - *

                  + *
                    *
                  • set the routing type based on the prefixes configured on the acceptor used by the client *
                  • strip any prefixes from the address and queue names (if applicable) *
                  • check authorization based on the client's credentials @@ -292,7 +284,6 @@ Queue createQueue(AddressInfo addressInfo, * * @param queueConfiguration the configuration to use when creating the queue * @return the {@code Queue} instance that was created - * @throws Exception */ Queue createQueue(QueueConfiguration queueConfiguration) throws Exception; @@ -387,11 +378,7 @@ RoutingStatus doSend(Transaction tx, Map getMetaData(); /** - * Add all the producers detail to the JSONArray object. - * This is a method to be used by the management layer. - * - * @param objs - * @throws Exception + * Add all the producers detail to the JSONArray object. This is a method to be used by the management layer. */ void describeProducersInfo(JsonArrayBuilder objs) throws Exception; @@ -510,7 +497,7 @@ SimpleString getMatchingQueue(SimpleString address, * * @param addressInfo the address to inspect * @return a {@code org.apache.activemq.artemis.api.core.Pair} representing the canonical (i.e. non-prefixed) address - * name and the {@code org.apache.activemq.artemis.api.core.RoutingType} corresponding to the that prefix. + * name and the {@code org.apache.activemq.artemis.api.core.RoutingType} corresponding to the that prefix. */ AddressInfo getAddressAndRoutingType(AddressInfo addressInfo); @@ -519,12 +506,12 @@ SimpleString getMatchingQueue(SimpleString address, /** * Get the canonical (i.e. non-prefixed) address and the corresponding routing-type. * - * @param address the address to inspect + * @param address the address to inspect * @param defaultRoutingTypes a the {@code java.util.Set} of {@code org.apache.activemq.artemis.api.core.RoutingType} * objects to return if no prefix match is found. * @return a {@code org.apache.activemq.artemis.api.core.Pair} representing the canonical (i.e. non-prefixed) address - * name and the {@code java.util.Set} of {@code org.apache.activemq.artemis.api.core.RoutingType} objects - * corresponding to the that prefix. + * name and the {@code java.util.Set} of {@code org.apache.activemq.artemis.api.core.RoutingType} objects + * corresponding to the that prefix. */ Pair> getAddressAndRoutingTypes(SimpleString address, EnumSet defaultRoutingTypes); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServiceRegistry.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServiceRegistry.java index c567abd068b..b8972bc444d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServiceRegistry.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ServiceRegistry.java @@ -35,8 +35,10 @@ public interface ServiceRegistry { ExecutorService getPageExecutorService(); - /** Notice that if you want to provide your own PageExecutor, you should limit the number of threads to the number of - * parallel reads you want to perform on paging */ + /** + * Notice that if you want to provide your own PageExecutor, you should limit the number of threads to the number of + * parallel reads you want to perform on paging + */ void setPageExecutorService(ExecutorService executorService); ExecutorService getExecutorService(); @@ -51,17 +53,13 @@ public interface ServiceRegistry { void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService); - void addConnectorService(ConnectorServiceFactory connectorServiceFactory, - ConnectorServiceConfiguration configuration); + void addConnectorService(ConnectorServiceFactory connectorServiceFactory, ConnectorServiceConfiguration configuration); void removeConnectorService(ConnectorServiceConfiguration configuration); /** * Get a collection of paired org.apache.activemq.artemis.core.server.ConnectorServiceFactory and * org.apache.activemq.artemis.core.config.ConnectorServiceConfiguration instances. - * - * @param configs - * @return */ Collection> getConnectorServices(List configs); @@ -69,7 +67,7 @@ void addConnectorService(ConnectorServiceFactory connectorServiceFactory, * Get connector service for a given configuration. * * @param configuration The connector service configuration. - * @return an instance of the connector service factory. + * @return an instance of the connector service factory */ ConnectorServiceFactory getConnectorService(ConnectorServiceConfiguration configuration); @@ -77,9 +75,6 @@ void addConnectorService(ConnectorServiceFactory connectorServiceFactory, /** * Get a list of org.apache.activemq.artemis.api.core.BaseInterceptor instances - * - * @param classNames - * @return */ List getIncomingInterceptors(List classNames); @@ -87,18 +82,14 @@ void addConnectorService(ConnectorServiceFactory connectorServiceFactory, /** * Get a list of org.apache.activemq.artemis.api.core.BaseInterceptor instances - * - * @param classNames - * @return */ List getOutgoingInterceptors(List classNames); /** * Get an instance of org.apache.activemq.artemis.core.server.transformer.Transformer for a divert * - * @param name the name of divert for which the transformer will be used + * @param name the name of divert for which the transformer will be used * @param transformerConfiguration the transformer configuration - * @return */ Transformer getDivertTransformer(String name, TransformerConfiguration transformerConfiguration); @@ -109,9 +100,8 @@ void addConnectorService(ConnectorServiceFactory connectorServiceFactory, /** * Get an instance of org.apache.activemq.artemis.core.server.transformer.Transformer for a bridge * - * @param name the name of bridge for which the transformer will be used + * @param name the name of bridge for which the transformer will be used * @param transformerConfiguration the transformer configuration - * @return */ Transformer getBridgeTransformer(String name, TransformerConfiguration transformerConfiguration); @@ -120,9 +110,8 @@ void addConnectorService(ConnectorServiceFactory connectorServiceFactory, /** * Get an instance of org.apache.activemq.artemis.core.server.transformer.Transformer for federation * - * @param name the name of bridge for which the transformer will be used + * @param name the name of bridge for which the transformer will be used * @param transformerConfiguration the transformer configuration - * @return */ Transformer getFederationTransformer(String name, TransformerConfiguration transformerConfiguration); @@ -133,7 +122,6 @@ void addConnectorService(ConnectorServiceFactory connectorServiceFactory, * * @param name the name of acceptor for which the factory will be used * @param className the fully qualified name of the factory implementation (can be null) - * @return */ AcceptorFactory getAcceptorFactory(String name, String className); 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 64568af2dd3..0257daec7da 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 @@ -42,9 +42,10 @@ 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. -* */ +/** + * This 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(MethodHandles.lookup().lookupClass()); @@ -74,16 +75,19 @@ public BackupManager(ActiveMQServer server, this.clusterManager = clusterManager; } - /** This is meant for testing and assertions, please don't do anything stupid with it! - * I mean, please don't use it outside of testing context */ + /** + * This is meant for testing and assertions, please don't do anything stupid with it! I mean, please don't use it + * outside of testing context + */ public List getBackupConnectors() { return backupConnectors; } - /* - * Start the backup manager if not already started. This entails deploying a backup connector based on a cluster - * configuration, informing the cluster manager so that it can add it to its topology and announce itself to the cluster. - * */ + /** + * Start the backup manager if not already started. This entails deploying a backup connector based on a cluster + * configuration, informing the cluster manager so that it can add it to its topology and announce itself to the + * cluster. + */ @Override public synchronized void start() throws Exception { if (started) @@ -107,9 +111,9 @@ public synchronized void start() throws Exception { started = true; } - /* - * stop all the connectors - * */ + /** + * stop all the connectors + */ @Override public synchronized void stop() { if (!started) @@ -120,18 +124,18 @@ public synchronized void stop() { started = false; } - /* - * announce the fact that we are a backup server ready to fail over if required. - */ + /** + * announce the fact that we are a backup server ready to fail over if required. + */ public void announceBackup() { for (BackupConnector backupConnector : backupConnectors) { backupConnector.announceBackup(); } } - /* - * create the connectors using the cluster configurations - * */ + /** + * create the connectors using the cluster configurations + */ private void deployBackupConnector(final ClusterConnectionConfiguration config) throws Exception { if (!config.validateConfiguration()) { return; @@ -160,9 +164,9 @@ private void deployBackupConnector(final ClusterConnectionConfiguration config) } } - /* - * called to notify us that we have been activated so the connectors are no longer needed. - * */ + /** + * called to notify us that we have been activated so the connectors are no longer needed. + */ public void activated() { for (BackupConnector backupConnector : backupConnectors) { backupConnector.close(); @@ -183,9 +187,9 @@ public boolean isBackupAnnounced() { return true; } - /* - * A backup connector will connect to the cluster and announce that we are a backup server ready to fail over. - * */ + /** + * A backup connector will connect to the cluster and announce that we are a backup server ready to fail over. + */ public abstract class BackupConnector { private volatile ServerLocatorInternal backupServerLocator; @@ -215,19 +219,21 @@ private BackupConnector(ClusterConnectionConfiguration config, this.clusterManager = clusterManager; } - /* - * used to create the server locator needed, will be connectors or discovery - * */ + /** + * used to create the server locator needed, will be connectors or discovery + */ abstract ServerLocatorInternal createServerLocator(Topology topology); - /** This is for test assertions, please be careful, don't use outside of testing! */ + /** + * This is for test assertions, please be careful, don't use outside of testing! + */ public ServerLocator getBackupServerLocator() { return backupServerLocator; } - /* - * start the connector by creating the server locator to use. - * */ + /** + * start the connector by creating the server locator to use. + */ void start() { stopping = false; backupAnnounced = false; @@ -245,9 +251,9 @@ void start() { } } - /* - * this connects to the cluster and announces that we are a backup - * */ + /** + * this connects to the cluster and announces that we are a backup + */ public void announceBackup() { //this has to be done in a separate thread executor.execute(() -> { @@ -294,21 +300,20 @@ public void announceBackup() { }); } - /** it will re-schedule the connection after a timeout, using a scheduled executor */ + /** + * it will re-schedule the connection after a timeout, using a scheduled executor + */ protected void retryConnection() { scheduledExecutor.schedule(this::announceBackup, config.getRetryInterval(), TimeUnit.MILLISECONDS); } - /* - * called to notify the cluster manager about the backup - * */ + /** + * called to notify the cluster manager about the backup + */ public void informTopology() { clusterManager.informClusterOfBackup(config.getName()); } - /* - * close everything - * */ public void close() { stopping = true; if (announcingBackup) { @@ -338,9 +343,6 @@ private void closeLocator(ServerLocatorInternal backupServerLocator) { } } - /* - * backup connector using static connectors - * */ private final class StaticBackupConnector extends BackupConnector { private final TransportConfiguration[] tcConfigs; @@ -378,9 +380,6 @@ public String toString() { } - /* - * backup connector using discovery - * */ private final class DiscoveryBackupConnector extends BackupConnector { private final DiscoveryGroupConfiguration discoveryGroupConfiguration; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/Bridge.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/Bridge.java index 9cd1e3cb0c8..4ba4c926a63 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/Bridge.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/Bridge.java @@ -47,8 +47,8 @@ public interface Bridge extends Consumer, ActiveMQComponent { void resume() throws Exception; /** - * To be called when the server sent a disconnect to the client. - * Basically this is for cluster bridges being disconnected + * To be called when the server sent a disconnect to the client. Basically this is for cluster bridges being + * disconnected */ @Override void disconnect(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterConnection.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterConnection.java index 9212bbabb9e..28e53ee7fe1 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterConnection.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterConnection.java @@ -49,7 +49,7 @@ void nodeAnnounced(long eventUID, /** * This is needed on replication, however we don't need it on shared storage. - * */ + */ void setSplitBrainDetection(boolean splitBrainDetection); boolean isSplitBrainDetection(); @@ -77,9 +77,7 @@ void nodeAnnounced(long eventUID, /** * Verifies whether user and password match the ones configured for this ClusterConnection. * - * @param clusterUser - * @param clusterPassword - * @return {@code true} if username and password match, {@code false} otherwise. + * @return {@code true} if username and password match, {@code false} otherwise */ boolean verify(String clusterUser, String clusterPassword); @@ -95,16 +93,11 @@ void nodeAnnounced(long eventUID, /** * The metric for this cluster connection - * - * @return */ ClusterConnectionMetrics getMetrics(); /** - * Returns the BridgeMetrics for the bridge to the given node if exists - * - * @param nodeId - * @return + * {@return the BridgeMetrics for the bridge to the given node if exists} */ BridgeMetrics getBridgeMetrics(String nodeId); } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterControl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterControl.java index 673a8848682..ce359789b5f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterControl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterControl.java @@ -67,8 +67,8 @@ public Optional getClusterChannel() { } /** - * authorise this cluster control so it can communicate with the cluster, it will set the cluster channel on a successful - * authentication. + * authorise this cluster control so it can communicate with the cluster, it will set the cluster channel on a + * successful authentication. * * @throws ActiveMQException if authorisation wasn't successful. */ @@ -85,12 +85,10 @@ public void authorize() throws ActiveMQException { } /** - * XXX HORNETQ-720 + * Announce replicating backup to primary server. * - * @param attemptingFailBack if {@code true} then this server wants to trigger a fail-back when - * up-to-date, that is it wants to take over the role of 'live' from the current 'live' - * server. - * @throws ActiveMQException + * @param attemptingFailBack if {@code true} then this server wants to trigger a fail-back when up-to-date, that is + * it wants to take over the role of 'live' from the current 'live' server. */ public void announceReplicatingBackupToPrimary(final boolean attemptingFailBack, String replicationClusterName) throws ActiveMQException { @@ -112,7 +110,7 @@ public void announceReplicatingBackupToPrimary(final boolean attemptingFailBack, } /** - * announce this node to the cluster. + * Announce this node to the cluster. * * @param currentEventID used if multiple announcements about this node are made. * @param nodeID the node id if the announcing node @@ -132,28 +130,15 @@ public void sendNodeAnnounce(final long currentEventID, clusterChannel.send(new NodeAnnounceMessage(currentEventID, nodeID, backupGroupName, scaleDownGroupName, isBackup, config, backupConfig)); } - /** - * create a replication channel - * - * @return the replication channel - */ public Channel createReplicationChannel() { CoreRemotingConnection connection = (CoreRemotingConnection) sessionFactory.getConnection(); return connection.getChannel(ChannelImpl.CHANNEL_ID.REPLICATION.id, -1); } - /** - * get the session factory used to connect to the cluster - * - * @return the session factory - */ public ClientSessionFactoryInternal getSessionFactory() { return sessionFactory; } - /** - * close this cluster control and its resources - */ @Override public void close() { sessionFactory.close(); 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 970ed9865db..00c725b78bc 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 @@ -57,7 +57,7 @@ import java.lang.invoke.MethodHandles; /** - * used for creating and managing cluster control connections for each cluster connection and the replication connection + * Used for creating and managing cluster control connections for each cluster connection and the replication connection */ public class ClusterController implements ActiveMQComponent { @@ -82,7 +82,9 @@ public class ClusterController implements ActiveMQComponent { private boolean started; private SimpleString replicatedClusterName; - /** For tests only */ + /** + * For tests only + */ public ServerLocator getDefaultLocator() { return defaultLocator; } @@ -194,10 +196,10 @@ public void setDefaultClusterConnectionName(SimpleString defaultClusterConnectio /** * add a locator for a cluster connection. * - * @param name the cluster connection name - * @param dg the discovery group to use - * @param config the cluster connection config - * @param connector the cluster connector configuration + * @param name the cluster connection name + * @param dg the discovery group to use + * @param config the cluster connection config + * @param connector the cluster connector configuration */ public void addClusterConnection(SimpleString name, DiscoveryGroupConfiguration dg, @@ -249,42 +251,22 @@ private void configAndAdd(SimpleString name, locators.put(name, serverLocator); } - /** - * add a cluster listener - * - * @param listener - */ public void addClusterTopologyListenerForReplication(ClusterTopologyListener listener) { if (replicationLocator != null) { replicationLocator.addClusterTopologyListener(listener); } } - /** - * add a cluster listener - * - * @param listener - */ public void removeClusterTopologyListenerForReplication(ClusterTopologyListener listener) { if (replicationLocator != null) { replicationLocator.removeClusterTopologyListener(listener); } } - /** - * add an interceptor - * - * @param interceptor - */ public void addIncomingInterceptorForReplication(Interceptor interceptor) { replicationLocator.addIncomingInterceptor(interceptor); } - /** - * remove an interceptor - * - * @param interceptor - */ public void removeIncomingInterceptorForReplication(Interceptor interceptor) { replicationLocator.removeIncomingInterceptor(interceptor); } @@ -294,7 +276,6 @@ public void removeIncomingInterceptorForReplication(Interceptor interceptor) { * * @param transportConfiguration the configuration of the node to connect to. * @return the Cluster Control - * @throws Exception */ public ClusterControl connectToNode(TransportConfiguration transportConfiguration) throws Exception { ClientSessionFactoryInternal sessionFactory = (ClientSessionFactoryInternal) defaultLocator.createSessionFactory(transportConfiguration, 0, false); @@ -307,7 +288,6 @@ public ClusterControl connectToNode(TransportConfiguration transportConfiguratio * * @param transportConfiguration the configuration of the node to connect to. * @return the Cluster Control - * @throws Exception */ public ClusterControl connectToNodeInReplicatedCluster(TransportConfiguration transportConfiguration) throws Exception { ClientSessionFactoryInternal sessionFactory = (ClientSessionFactoryInternal) replicationLocator.createSessionFactory(transportConfiguration, 0, false); @@ -337,8 +317,6 @@ public long getRetryIntervalForReplicatedCluster() { /** * wait until we have connected to the cluster. - * - * @throws InterruptedException */ public void awaitConnectionToReplicationCluster() throws InterruptedException { replicationClusterConnectedLatch.await(); @@ -350,7 +328,6 @@ public void awaitConnectionToReplicationCluster() throws InterruptedException { * @param channel the channel to set the handler * @param acceptorUsed the acceptor used for connection * @param remotingConnection the connection itself - * @param activation */ public void addClusterChannelHandler(Channel channel, Acceptor acceptorUsed, 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 990ffeaf215..4d86c25c2f5 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 @@ -72,9 +72,9 @@ /** * A ClusterManager manages {@link ClusterConnection}s, {@link BroadcastGroup}s and {@link Bridge}s. *

                    - * Note that {@link org.apache.activemq.artemis.core.server.cluster.impl.ClusterConnectionBridge}s extend Bridges but are controlled over through - * {@link ClusterConnectionImpl}. As a node is discovered a new {@link org.apache.activemq.artemis.core.server.cluster.impl.ClusterConnectionBridge} is - * deployed. + * Note that {@link org.apache.activemq.artemis.core.server.cluster.impl.ClusterConnectionBridge}s extend Bridges but + * are controlled over through {@link ClusterConnectionImpl}. As a node is discovered a new + * {@link org.apache.activemq.artemis.core.server.cluster.impl.ClusterConnectionBridge} is deployed. */ public class ClusterManager implements ActiveMQComponent { @@ -131,11 +131,10 @@ enum State { */ STOPPING, /** - * Deployed means {@link ClusterManager#deploy()} was called but - * {@link ClusterManager#start()} was not called. + * Deployed means {@link ClusterManager#deploy()} was called but {@link ClusterManager#start()} was not called. *

                    - * We need the distinction if {@link ClusterManager#stop()} is called before 'start'. As - * otherwise we would leak locators. + * We need the distinction if {@link ClusterManager#stop()} is called before 'start'. As otherwise we would leak + * locators. */ DEPLOYED, STARTED, } @@ -249,9 +248,7 @@ public synchronized void deploy() throws Exception { deployClusterConnection(config); } - /* - * only start if we are actually in a cluster - * */ + // only start if we are actually in a cluster clusterController.start(); } @@ -498,10 +495,6 @@ public static class IncomingInterceptorLookingForExceptionMessage implements Int private final ClusterManager manager; private final Executor executor; - /** - * @param manager - * @param executor - */ public IncomingInterceptorLookingForExceptionMessage(ClusterManager manager, Executor executor) { this.manager = manager; this.executor = executor; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ColocatedHAManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ColocatedHAManager.java index 4c92d26acae..ef44c16309a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ColocatedHAManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ColocatedHAManager.java @@ -50,9 +50,6 @@ public ColocatedHAManager(ColocatedPolicy haPolicy, ActiveMQServer activeMQServe server = activeMQServer; } - /** - * starts the HA manager. - */ @Override public void start() { if (started) @@ -63,9 +60,6 @@ public void start() { started = true; } - /** - * stop any backups - */ @Override public void stop() { for (ActiveMQServer activeMQServer : backupServers.values()) { @@ -100,11 +94,6 @@ public synchronized boolean activateBackup(int backupSize, } } - /** - * return the current backup servers - * - * @return the backups - */ @Override public Map getBackupServers() { return backupServers; @@ -115,9 +104,7 @@ public Map getBackupServers() { * * @param connectorPair the connector for the node to request a backup from * @param backupSize the current size of the requested nodes backups - * @param replicated - * @return true if the request wa successful. - * @throws Exception + * @return true if the request wa successful */ public boolean requestBackup(Pair connectorPair, int backupSize, @@ -165,12 +152,11 @@ private synchronized boolean activateSharedStoreBackup(String journalDirectory, /** * activate a backup server replicating from a specified node. - * + *

                    * decline and the requesting server can cast a re vote * * @param nodeID the id of the node to replicate from * @return true if the server was created and started - * @throws Exception */ private synchronized boolean activateReplicatedBackup(SimpleString nodeID) throws Exception { final TopologyMember member; @@ -208,15 +194,10 @@ private synchronized boolean activateReplicatedBackup(SimpleString nodeID) throw /** * update the backups configuration * - * @param backupConfiguration the configuration to update - * @param name the new name of the backup - * @param portOffset the offset for the acceptors and any connectors that need changing - * @param remoteConnectors the connectors that don't need off setting, typically remote - * @param journalDirectory - * @param bindingsDirectory - * @param largeMessagesDirectory - * @param pagingDirectory - * @param fullServer + * @param backupConfiguration the configuration to update + * @param name the new name of the backup + * @param portOffset the offset for the acceptors and any connectors that need changing + * @param remoteConnectors the connectors that don't need off setting, typically remote */ private static void updateSharedStoreConfiguration(Configuration backupConfiguration, String name, @@ -281,12 +262,13 @@ private static void updateAcceptorsAndConnectors(Configuration backupConfigurati } /** - * Offset the port for Netty connector/acceptor (unless HTTP upgrade is enabled) and the server ID for invm connector/acceptor. - * - * The port is not offset for Netty connector/acceptor when HTTP upgrade is enabled. In this case, the app server that - * embed ActiveMQ is "owning" the port and is charge to delegate the HTTP upgrade to the correct broker (that can be - * the main one or any colocated backup hosted on the main broker). Delegation to the correct broker is done by looking at the - * {@link TransportConstants#ACTIVEMQ_SERVER_NAME} property [ARTEMIS-803] + * Offset the port for Netty connector/acceptor (unless HTTP upgrade is enabled) and the server ID for invm + * connector/acceptor. + *

                    + * The port is not offset for Netty connector/acceptor when HTTP upgrade is enabled. In this case, the app server + * that embed ActiveMQ is "owning" the port and is charge to delegate the HTTP upgrade to the correct broker (that + * can be the main one or any colocated backup hosted on the main broker). Delegation to the correct broker is done + * by looking at the {@link TransportConstants#ACTIVEMQ_SERVER_NAME} property [ARTEMIS-803] */ private static void updatebackupParams(String name, int portOffset, Map params) { if (params != null) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/HAManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/HAManager.java index d32d829a72a..200372371bb 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/HAManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/HAManager.java @@ -21,9 +21,9 @@ import org.apache.activemq.artemis.core.server.ActiveMQComponent; import org.apache.activemq.artemis.core.server.ActiveMQServer; -/* -* An HAManager takes care of any colocated backups in a VM. -* */ +/** + * An HAManager takes care of any colocated backups in a VM. + */ public interface HAManager extends ActiveMQComponent { /** diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/HAPolicy.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/HAPolicy.java index 9a838e62d56..bc7a6e1462f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/HAPolicy.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/HAPolicy.java @@ -24,14 +24,15 @@ import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl; /** - * Every active server will have an HAPolicy that configures the type of server that it should be either primary, backup or - * colocated (both). It also configures how, if colocated, it should react to sending and receiving requests for backups. + * Every active server will have an HAPolicy that configures the type of server that it should be either primary, backup + * or colocated (both). It also configures how, if colocated, it should react to sending and receiving requests for + * backups. */ public interface HAPolicy { - /* - * created the Activation associated with this policy. - * */ + /** + * created the Activation associated with this policy. + */ T createActivation(ActiveMQServerImpl server, boolean wasPrimary, Map activationParams, @@ -47,9 +48,7 @@ default boolean isWaitForActivation() { boolean canScaleDown(); - /* - * todo These 3 methods could probably be moved as they are specific to the activation however they are needed for certain packets. - * */ + // todo These 3 methods could probably be moved as they are specific to the activation however they are needed for certain packets. String getBackupGroupName(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicaPolicy.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicaPolicy.java index d98250f6df0..55bd7da367a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicaPolicy.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicaPolicy.java @@ -40,14 +40,10 @@ public class ReplicaPolicy extends BackupPolicy { private long initialReplicationSyncTimeout = ActiveMQDefaultConfiguration.getDefaultInitialReplicationSyncTimeout(); - /* - * what quorum size to use for voting - * */ + // what quorum size to use for voting private int quorumSize; - /* - * whether this broker should vote to remain active - * */ + // whether this broker should vote to remain active private boolean voteOnReplicationFailure; private ReplicatedPolicy replicatedPolicy; @@ -147,9 +143,6 @@ public void setReplicatedPolicy(ReplicatedPolicy replicatedPolicy) { this.replicatedPolicy = replicatedPolicy; } - /* - * these 2 methods are the same, leaving both as the second is correct but the first is needed until more refactoring is done - * */ @Override public String getBackupGroupName() { return groupName; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicatedPolicy.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicatedPolicy.java index 65ec72406d7..6f83d2a8e86 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicatedPolicy.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicatedPolicy.java @@ -38,19 +38,15 @@ public class ReplicatedPolicy implements HAPolicy { private long initialReplicationSyncTimeout = ActiveMQDefaultConfiguration.getDefaultInitialReplicationSyncTimeout(); /* - * these are only set by the ReplicaPolicy after failover to decide if the primary server can failback, these should - * not be exposed in configuration. - * */ + * these are only set by the ReplicaPolicy after failover to decide if the primary server can failback, these should + * not be exposed in configuration. + */ private boolean allowAutoFailBack = ActiveMQDefaultConfiguration.isDefaultAllowAutoFailback(); - /* - * whether this broker should vote to remain active - * */ + // whether this broker should vote to remain active private boolean voteOnReplicationFailure; - /* - * what quorum size to use for voting - * */ + // what quorum size to use for voting private int quorumSize; private int voteRetries; @@ -59,9 +55,7 @@ public class ReplicatedPolicy implements HAPolicy { private long retryReplicationWait; - /* - * this is only used as the policy when the server is started as a backup after a failover - * */ + // this is only used as the policy when the server is started as a backup after a failover private ReplicaPolicy replicaPolicy; private final NetworkHealthCheck networkHealthCheck; @@ -184,9 +178,6 @@ public void setReplicaPolicy(ReplicaPolicy replicaPolicy) { this.replicaPolicy = replicaPolicy; } - /* - * these 2 methods are the same, leaving both as the second is correct but the first is needed until more refactoring is done - * */ @Override public String getBackupGroupName() { return groupName; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicationPrimaryPolicy.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicationPrimaryPolicy.java index 1de2dee57f1..8d7af9cf51a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicationPrimaryPolicy.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicationPrimaryPolicy.java @@ -80,7 +80,8 @@ static ReplicationPrimaryPolicy failoverPolicy(long initialReplicationSyncTimeou } /** - * It creates a primary policy that never allow auto fail-back.
                    + * It creates a primary policy that never allow auto fail-back. + *

                    * It's meant to be used for natural-born primary brokers: its backup policy is set to always try to fail-back. */ public static ReplicationPrimaryPolicy with(ReplicationPrimaryPolicyConfiguration configuration) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/StandaloneHAManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/StandaloneHAManager.java index 3fe192e717a..edf6554f1a5 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/StandaloneHAManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/StandaloneHAManager.java @@ -21,9 +21,9 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer; -/* -* this implementation doesn't really do anything at the minute but this may change so Im leaving it here, Andy... -* */ +/** + * This implementation doesn't really do anything at the minute but this may change so I'm leaving it here, Andy... + */ public class StandaloneHAManager implements HAManager { Map servers = new HashMap<>(); 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 9cf99949b2b..ea372448f13 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 @@ -210,9 +210,6 @@ public ServerLocatorInternal getServerLocator() { return serverLocator; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.server.Consumer#getDeliveringMessages() - */ @Override public List getDeliveringMessages() { synchronized (refs) { @@ -359,8 +356,8 @@ public boolean isConnected() { } /** - * The cluster manager needs to use the same executor to close the serverLocator, otherwise the stop will break. - * This method is intended to expose this executor to the ClusterManager + * The cluster manager needs to use the same executor to close the serverLocator, otherwise the stop will break. This + * method is intended to expose this executor to the ClusterManager */ public Executor getExecutor() { return executor; @@ -510,7 +507,9 @@ public void failed(Throwable t) { } } - /* Hook for processing message before forwarding */ + /** + * Hook for processing message before forwarding + */ protected Message beforeForward(Message message, final SimpleString forwardingAddress) { message = message.copy(); ((RefCountMessage)message).setParentRef((RefCountMessage)message); @@ -518,8 +517,9 @@ protected Message beforeForward(Message message, final SimpleString forwardingAd return beforeForwardingNoCopy(message, forwardingAddress); } - /** ClusterConnectionBridge already makes a copy of the message. - * So I needed I hook where the message is not copied. */ + /** + * ClusterConnectionBridge already makes a copy of the message. So I needed I hook where the message is not copied. + */ protected Message beforeForwardingNoCopy(Message message, SimpleString forwardingAddress) { if (configuration.isUseDuplicateDetection()) { // We keep our own DuplicateID for the Bridge, so bouncing back and forth will work fine @@ -853,7 +853,9 @@ protected void fail(final boolean permanently, boolean scaleDown) { } } - /* Hook for doing extra stuff after connection */ + /** + * Hook for doing extra stuff after connection + */ protected void afterConnect() throws Exception { if (disconnectedAndDown && targetNodeID != null && targetNode != null) { serverLocator.notifyNodeUp(System.currentTimeMillis(), targetNodeID, targetNode.getBackupGroupName(), targetNode.getScaleDownGroupName(), @@ -868,7 +870,9 @@ protected void afterConnect() throws Exception { } } - /* Hook for creating session factory */ + /** + * Hook for creating session factory + */ protected ClientSessionFactoryInternal createSessionFactory() throws Exception { if (targetNodeID != null && (this.configuration.getReconnectAttemptsOnSameNode() < 0 || retryCount <= this.configuration.getReconnectAttemptsOnSameNode())) { csf = reconnectOnOriginalNode(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeMetrics.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeMetrics.java index d8689b6abcd..21a72f3cb88 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeMetrics.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeMetrics.java @@ -42,22 +42,16 @@ public void incrementMessagesAcknowledged() { MESSAGES_ACKNOWLEDGED_UPDATER.incrementAndGet(this); } - /** - * @return the messagesPendingAcknowledgement - */ public long getMessagesPendingAcknowledgement() { return messagesPendingAcknowledgement; } - /** - * @return the messagesAcknowledged - */ public long getMessagesAcknowledged() { return messagesAcknowledged; } /** - * @return New map containing the Bridge metrics + * {@return new {@code Map} containing the Bridge metrics} */ public Map convertToMap() { final Map metrics = new HashMap<>(); 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 e41e8780b99..a35ed4c2913 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 @@ -41,11 +41,11 @@ import java.lang.invoke.MethodHandles; /** - *

                    This class will use the {@link BroadcastEndpoint} to send periodical updates on the list for connections - * used by this server.

                    - * - *

                    This is totally generic to the mechanism used on the transmission. It originally only had UDP but this got refactored - * into sub classes of {@link BroadcastEndpoint}

                    + * This class will use the {@link BroadcastEndpoint} to send periodical updates on the list for connections used by this + * server. + *

                    + * This is totally generic to the mechanism used on the transmission. It originally only had UDP but this got refactored + * into sub classes of {@link BroadcastEndpoint} */ public class BroadcastGroupImpl implements BroadcastGroup, Runnable { @@ -211,7 +211,7 @@ public void run() { broadcastConnectors(); loggedBroadcastException = false; } catch (Exception e) { - // only log the exception at ERROR level once, even if it fails multiple times in a row - HORNETQ-919 + // only log the exception at ERROR level once, even if it fails multiple times in a row if (!loggedBroadcastException) { ActiveMQServerLogger.LOGGER.errorBroadcastingConnectorConfigs(e); loggedBroadcastException = true; 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 3012b03e09e..fc6f272b258 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 @@ -307,12 +307,9 @@ private void setupNotificationConsumer() throws Exception { } } - /** * Takes in a string of an address filter or comma separated list and generates an appropriate JMS selector for * filtering queues. - * - * @param address */ public static String createSelectorFromAddress(String address) { StringBuilder stringBuilder = new StringBuilder(); @@ -388,9 +385,8 @@ private String appendIgnoresToFilter(String filterString) { } /** - * Create a filter rule,in addition to SESSION_CREATED notifications, all other notifications using managementNotificationAddress - * as the routing address will be filtered. - * @return + * Create a filter rule,in addition to SESSION_CREATED notifications, all other notifications using + * managementNotificationAddress as the routing address will be filtered. */ private String createPermissiveManagementNotificationToFilter() { StringBuilder filterBuilder = new StringBuilder(ManagementHelper.HDR_NOTIFICATION_TYPE).append(" = '") 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 9a0bd8ea6cc..9ba6b838fe9 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 @@ -85,9 +85,8 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn private static final String SN_PREFIX = "sf."; /** - * When getting member on node-up and down we have to remove the name from the transport config - * as the setting we build here doesn't need to consider the name, so use the same name on all - * the instances. + * When getting member on node-up and down we have to remove the name from the transport config as the setting we + * build here doesn't need to consider the name, so use the same name on all the instances. */ private static final String TRANSPORT_CONFIG_NAME = "topology-member"; @@ -132,8 +131,8 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn private final int producerWindowSize; /** - * Guard for the field {@link #records}. Note that the field is {@link ConcurrentHashMap}, - * however we need the guard to synchronize multiple step operations during topology updates. + * Guard for the field {@link #records}. Note that the field is {@link ConcurrentHashMap}, however we need the guard + * to synchronize multiple step operations during topology updates. */ private final Object recordsGuard = new Object(); @@ -184,8 +183,9 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn private final String clientId; - - /** For tests only */ + /** + * For tests only + */ public ServerLocatorInternal getServerLocator() { return serverLocator; } @@ -481,9 +481,6 @@ public void stop() throws Exception { started = false; } - /** - * @param locator - */ private void closeLocator(final ServerLocatorInternal locator) { if (locator != null) locator.close(); @@ -530,12 +527,8 @@ public void nodeAnnounced(final long uniqueEventID, } } - /** This is the implementation of TopologyManager. It is used to reject eventual updates from a split brain server. - * - * @param uniqueEventID - * @param nodeId - * @param memberInput - * @return + /** + * This is the implementation of TopologyManager. It is used to reject eventual updates from a split brain server. */ @Override public boolean updateMember(long uniqueEventID, String nodeId, TopologyMemberImpl memberInput) { @@ -554,9 +547,6 @@ public boolean updateMember(long uniqueEventID, String nodeId, TopologyMemberImp /** * From topologyManager - * @param uniqueEventID - * @param nodeId - * @return */ @Override public boolean removeMember(final long uniqueEventID, final String nodeId, final boolean disconnect) { @@ -741,9 +731,9 @@ public TransportConfiguration getConnector() { @Override public void nodeDown(final long eventUID, final String nodeID) { /* - * we dont do anything when a node down is received. The bridges will take care themselves when they should disconnect - * and/or clear their bindings. This is to avoid closing a record when we don't want to. - * */ + * we dont do anything when a node down is received. The bridges will take care themselves when they should disconnect + * and/or clear their bindings. This is to avoid closing a record when we don't want to. + */ } @Override @@ -970,9 +960,6 @@ private MessageFlowRecordImpl(final ServerLocatorInternal targetLocator, this.eventUID = eventUID; } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { return "MessageFlowRecordImpl [nodeID=" + targetNodeID + @@ -999,37 +986,22 @@ public String getAddress() { return address != null ? address.toString() : ""; } - /** - * @return the eventUID - */ public long getEventUID() { return eventUID; } - /** - * @return the nodeID - */ public String getTargetNodeID() { return targetNodeID; } - /** - * @return the connector - */ public TransportConfiguration getConnector() { return connector; } - /** - * @return the queueName - */ public SimpleString getQueueName() { return queueName; } - /** - * @return the queue - */ public Queue getQueue() { return queue; } @@ -1040,9 +1012,9 @@ public int getMaxHops() { } /* - * we should only ever close a record when the node itself has gone down or in the case of scale down where we know + * We should only ever close a record when the node itself has gone down or in the case of scale down where we know * the node is being completely destroyed and in this case we will migrate to another server/Bridge. - * */ + */ @Override public void close() throws Exception { logger.trace("Stopping bridge {}", bridge); @@ -1170,9 +1142,9 @@ private void handleNotificationMessage(ClientMessage message) throws Exception { } } - /* - * Inform the grouping handler of a proposal - * */ + /** + * Inform the grouping handler of a proposal + */ private synchronized void doProposalReceived(final ClientMessage message) throws Exception { if (!message.containsProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID)) { throw new IllegalStateException("proposal type is null"); @@ -1195,9 +1167,9 @@ private synchronized void doProposalReceived(final ClientMessage message) throws } } - /* - * Inform the grouping handler of a proposal(groupid) being removed - * */ + /** + * Inform the grouping handler of a proposal(groupid) being removed + */ private synchronized void doUnProposalReceived(final ClientMessage message) throws Exception { if (!message.containsProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID)) { throw new IllegalStateException("proposal type is null"); @@ -1217,10 +1189,9 @@ private synchronized void doUnProposalReceived(final ClientMessage message) thro } - /* - * Inform the grouping handler of a response from a proposal - * - * */ + /** + * Inform the grouping handler of a response from a proposal + */ private synchronized void doProposalResponseReceived(final ClientMessage message) throws Exception { if (!message.containsProperty(ManagementHelper.HDR_PROPOSAL_GROUP_ID)) { throw new IllegalStateException("proposal type is null"); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionMetrics.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionMetrics.java index 5b9e0842247..b51bc8af481 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionMetrics.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionMetrics.java @@ -27,32 +27,22 @@ public class ClusterConnectionMetrics { private final long messagesPendingAcknowledgement; private final long messagesAcknowledged; - /** - * @param messagesPendingAcknowledgement - * @param messagesAcknowledged - */ public ClusterConnectionMetrics(long messagesPendingAcknowledgement, long messagesAcknowledged) { super(); this.messagesPendingAcknowledgement = messagesPendingAcknowledgement; this.messagesAcknowledged = messagesAcknowledged; } - /** - * @return the messagesPendingAcknowledgement - */ public long getMessagesPendingAcknowledgement() { return messagesPendingAcknowledgement; } - /** - * @return the messagesAcknowledged - */ public long getMessagesAcknowledged() { return messagesAcknowledged; } /** - * @return New map containing the Cluster Connection metrics + * {@return New map containing the Cluster Connection metrics} */ public Map convertToMap() { final Map metrics = new HashMap<>(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/Redistributor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/Redistributor.java index 0044ca58482..607f89553e9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/Redistributor.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/Redistributor.java @@ -155,9 +155,6 @@ private void ackRedistribution(final MessageReference reference, final Transacti tx.commit(); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.server.Consumer#getDeliveringMessages() - */ @Override public List getDeliveringMessages() { return Collections.emptyList(); 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 5680d7aa54b..6eda81f6cfb 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 @@ -320,10 +320,8 @@ public void close() throws Exception { } /** - * This will add routing information to the message. - * This will be later processed during the delivery between the nodes. Because of that this has to be persisted as a property on the message. - * - * @param message + * This will add routing information to the message. This will be later processed during the delivery between the + * nodes. Because of that this has to be persisted as a property on the message. */ private void addRouteContextToMessage(final Message message) { byte[] ids = message.getExtraBytesProperty(idsHeaderName); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/Quorum.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/Quorum.java index 494ae23c402..30089591791 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/Quorum.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/Quorum.java @@ -19,8 +19,8 @@ import org.apache.activemq.artemis.core.client.impl.Topology; /** - * A quorum can be registered with the {@link QuorumManager} to receive notifications about the state of a cluster. - * It can then use the {@link QuorumManager} for the quorum within a cluster to vote on a specific outcome. + * A quorum can be registered with the {@link QuorumManager} to receive notifications about the state of a cluster. It + * can then use the {@link QuorumManager} for the quorum within a cluster to vote on a specific outcome. */ public interface Quorum { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumManager.java index bb7deb5407a..ef8a132fda9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumManager.java @@ -48,9 +48,10 @@ import static org.apache.activemq.artemis.utils.Preconditions.checkNotNull; /** - * A QourumManager can be used to register a {@link org.apache.activemq.artemis.core.server.cluster.quorum.Quorum} to receive notifications - * about changes to the cluster. A {@link org.apache.activemq.artemis.core.server.cluster.quorum.Quorum} can then issue a vote to the - * remaining nodes in a cluster for a specific outcome + * A QourumManager can be used to register a {@link org.apache.activemq.artemis.core.server.cluster.quorum.Quorum} to + * receive notifications about changes to the cluster. A + * {@link org.apache.activemq.artemis.core.server.cluster.quorum.Quorum} can then issue a vote to the remaining nodes in + * a cluster for a specific outcome */ public final class QuorumManager implements ClusterTopologyListener, ActiveMQComponent { @@ -102,8 +103,6 @@ public QuorumManager(ExecutorService threadPool, ClusterController clusterContro /** * we start by simply creating the server locator and connecting in a separate thread - * - * @throws Exception */ @Override public void start() throws Exception { @@ -114,8 +113,6 @@ public void start() throws Exception { /** * stops the server locator - * - * @throws Exception */ @Override public void stop() throws Exception { @@ -137,8 +134,6 @@ public void stop() throws Exception { /** * are we started - * - * @return */ @Override public boolean isStarted() { @@ -146,9 +141,8 @@ public boolean isStarted() { } /** - * registers a {@link org.apache.activemq.artemis.core.server.cluster.quorum.Quorum} so that it can be notified of changes in the cluster. - * - * @param quorum + * registers a {@link org.apache.activemq.artemis.core.server.cluster.quorum.Quorum} so that it can be notified of + * changes in the cluster. */ public void registerQuorum(Quorum quorum) { quorums.put(quorum.getName(), quorum); @@ -157,20 +151,19 @@ public void registerQuorum(Quorum quorum) { /** * unregisters a {@link org.apache.activemq.artemis.core.server.cluster.quorum.Quorum}. - * - * @param quorum */ public void unRegisterQuorum(Quorum quorum) { quorums.remove(quorum.getName()); } /** - * called by the {@link org.apache.activemq.artemis.core.client.impl.ServerLocatorInternal} when the topology changes. we update the - * {@code maxClusterSize} if needed and inform the {@link org.apache.activemq.artemis.core.server.cluster.quorum.Quorum}'s. + * called by the {@link org.apache.activemq.artemis.core.client.impl.ServerLocatorInternal} when the topology + * changes. we update the {@code maxClusterSize} if needed and inform the + * {@link org.apache.activemq.artemis.core.server.cluster.quorum.Quorum}'s. * * @param topologyMember the topolgy changed - * @param last if the whole cluster topology is being transmitted (after adding the listener to - * the cluster connection) this parameter will be {@code true} for the last topology + * @param last if the whole cluster topology is being transmitted (after adding the listener to the cluster + * connection) this parameter will be {@code true} for the last topology */ @Override public void nodeUP(TopologyMember topologyMember, boolean last) { @@ -184,7 +177,6 @@ public void nodeUP(TopologyMember topologyMember, boolean last) { /** * notify the {@link org.apache.activemq.artemis.core.server.cluster.quorum.Quorum} of a topology change. * - * @param eventUID * @param nodeID the id of the node leaving the cluster */ @Override @@ -240,9 +232,7 @@ private boolean awaitVoteComplete(QuorumVoteServerConnect quorumVote, int voteTi } /** - * returns the maximum size this cluster has been. - * - * @return max size + * {@return the maximum size this cluster has been} */ public int getMaxClusterSize() { return maxClusterSize; @@ -431,8 +421,8 @@ private static QuorumVoteReplyMessage voteFormerVersions(SimpleString handler, } /** - * this will connect to a node and then cast a vote. whether or not this vote is asked of the target node is dependent - * on {@link org.apache.activemq.artemis.core.server.cluster.quorum.Vote#isRequestServerVote()} + * this will connect to a node and then cast a vote. whether this vote is asked of the target node is dependent on + * {@link org.apache.activemq.artemis.core.server.cluster.quorum.Vote#isRequestServerVote()} */ private final class VoteRunnable implements Runnable { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVote.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVote.java index b553bea4175..537e856cf3d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVote.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVote.java @@ -34,25 +34,26 @@ public QuorumVote(SimpleString name, SimpleString oldName) { } /** - * called by the {@link org.apache.activemq.artemis.core.server.cluster.quorum.QuorumManager} when one of the nodes in the quorum is - * successfully connected to. The QuorumVote can then decide whether or not a decision can be made with just that information. + * called by the {@link org.apache.activemq.artemis.core.server.cluster.quorum.QuorumManager} when one of the nodes + * in the quorum is successfully connected to. The QuorumVote can then decide whether a decision can be made with + * just that information. * * @return the vote to use */ public abstract Vote connected(); /** - * called by the {@link org.apache.activemq.artemis.core.server.cluster.quorum.QuorumManager} fails to connect to a node in the quorum. - * The QuorumVote can then decide whether or not a decision can be made with just that information however the node - * cannot cannot be asked. + * called by the {@link org.apache.activemq.artemis.core.server.cluster.quorum.QuorumManager} fails to connect to a + * node in the quorum. The QuorumVote can then decide whether a decision can be made with just that information + * however the node cannot cannot be asked. * * @return the vote to use */ public abstract Vote notConnected(); /** - * called by the {@link org.apache.activemq.artemis.core.server.cluster.quorum.QuorumManager} when a vote can be made, either from the - * cluster or decided by itself. + * called by the {@link org.apache.activemq.artemis.core.server.cluster.quorum.QuorumManager} when a vote can be + * made, either from the cluster or decided by itself. * * @param vote the vote to make. */ @@ -66,14 +67,16 @@ public QuorumVote(SimpleString name, SimpleString oldName) { public abstract T getDecision(); /** - * called by the {@link org.apache.activemq.artemis.core.server.cluster.quorum.QuorumManager} when all the votes have been cast and received. + * called by the {@link org.apache.activemq.artemis.core.server.cluster.quorum.QuorumManager} when all the votes have + * been cast and received. * * @param voteTopology the topology of where the votes were sent. */ public abstract void allVotesCast(Topology voteTopology); /** - * the name of this quorum vote, used for identifying the correct {@link org.apache.activemq.artemis.core.server.cluster.quorum.QuorumVoteHandler} + * the name of this quorum vote, used for identifying the correct + * {@link org.apache.activemq.artemis.core.server.cluster.quorum.QuorumVoteHandler} * * @return the name of the wuorum vote */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVoteHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVoteHandler.java index c989a43c88e..3c668e5972e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVoteHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVoteHandler.java @@ -24,17 +24,8 @@ */ public interface QuorumVoteHandler { - /** - * @param vote - * @return - */ Vote vote(Vote vote); - /** - * the name of the quorum vote - * - * @return the name - */ SimpleString getQuorumName(); Vote decode(ActiveMQBuffer voteBuffer); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVoteServerConnect.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVoteServerConnect.java index c009927869e..fe3504e9808 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVoteServerConnect.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumVoteServerConnect.java @@ -28,9 +28,10 @@ */ public class QuorumVoteServerConnect extends QuorumVote { - - /** NOTE: The following String is used to identify the targetNode implementation at other servers. - * Renaming such string would cause incompatibility changes. */ + /** + * NOTE: The following String is used to identify the targetNode implementation at other servers. Renaming such + * string would cause incompatibility changes. + */ public static final SimpleString PRIMARY_FAILOVER_VOTE = SimpleString.of("PrimaryFailoverQuorumVote"); public static final SimpleString OLD_PRIMARY_FAILOVER_VOTE = SimpleString.of("LiveFailoverQuorumVote"); @@ -78,8 +79,6 @@ public QuorumVoteServerConnect(int size, String targetNodeId) { } /** * if we can connect to a node - * - * @return */ @Override public Vote connected() { @@ -87,8 +86,6 @@ public Vote connected() { } /** * if we cant connect to the node - * - * @return */ @Override public Vote notConnected() { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/SharedNothingBackupQuorum.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/SharedNothingBackupQuorum.java index 0a5607d4071..3f34c51a2a0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/SharedNothingBackupQuorum.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/SharedNothingBackupQuorum.java @@ -78,8 +78,8 @@ public enum BACKUP_ACTIVATION { private final boolean failback; /** - * This is a safety net in case the primary sends the first {@link ReplicationPrimaryIsStoppingMessage} - * with code {@link ReplicationPrimaryIsStoppingMessage.PrimaryStopping#STOP_CALLED} and crashes before sending the second with + * This is a safety net in case the primary sends the first {@link ReplicationPrimaryIsStoppingMessage} with code + * {@link ReplicationPrimaryIsStoppingMessage.PrimaryStopping#STOP_CALLED} and crashes before sending the second with * {@link ReplicationPrimaryIsStoppingMessage.PrimaryStopping#FAIL_OVER}. *

                    * If the second message does come within this dead line, we fail over anyway. @@ -133,7 +133,8 @@ private void onConnectionFailure() { signal = BACKUP_ACTIVATION.FAIL_OVER; } - /* use NetworkHealthCheck to determine if node is isolated + /* + * use NetworkHealthCheck to determine if node is isolated * if there are no addresses/urls configured then ignore and rely on quorum vote only */ if (networkHealthCheck != null && !networkHealthCheck.isEmpty()) { @@ -161,10 +162,6 @@ public void setQuorumManager(QuorumManager quorumManager) { /** * if the node going down is the node we are replicating from then decide on an action. - * - * @param topology - * @param eventUID - * @param nodeID */ @Override public void nodeDown(Topology topology, long eventUID, String nodeID) { @@ -219,8 +216,8 @@ public void setSessionFactory(final ClientSessionFactoryInternal sessionFactory) /** * Releases the latch, causing the backup activation thread to fail-over. *

                    - * The use case is for when the 'live' has an orderly shutdown, in which case it informs the - * backup that it should fail-over. + * The use case is for when the 'live' has an orderly shutdown, in which case it informs the backup that it should + * fail-over. */ public synchronized void failOver(ReplicationPrimaryIsStoppingMessage.PrimaryStopping finalMessage) { removeListeners(); @@ -255,8 +252,7 @@ private void removeListeners() { } /** - * Called by the replicating backup (i.e. "SharedNothing" backup) to wait for the signal to - * fail-over or to stop. + * Called by the replicating backup (i.e. "SharedNothing" backup) to wait for the signal to fail-over or to stop. * * @return signal, indicating whether to stop or to fail-over */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/Vote.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/Vote.java index df35e898319..a8c4d28e707 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/Vote.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/Vote.java @@ -21,9 +21,6 @@ import org.apache.activemq.artemis.api.core.ActiveMQBuffer; -/** - * the vote itself - */ public abstract class Vote { public Map getVoteMap() { @@ -35,14 +32,11 @@ public Map getVoteMap() { public abstract void decode(ActiveMQBuffer buff); - //whether or note we should ask the target server for an answer or decide ourselves, for instance if we couldn't - //connect to the node in the first place. - public abstract boolean isRequestServerVote(); - /** - * return the vote - * - * @return the vote + * Whether we should ask the target server for an answer or decide ourselves, for instance if we couldn't connect to + * the node in the first place */ + public abstract boolean isRequestServerVote(); + public abstract T getVote(); } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/embedded/EmbeddedActiveMQ.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/embedded/EmbeddedActiveMQ.java index 65c65f46140..46b8c770880 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/embedded/EmbeddedActiveMQ.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/embedded/EmbeddedActiveMQ.java @@ -46,8 +46,6 @@ public class EmbeddedActiveMQ { /** * Classpath resource for activemq server config. Defaults to 'broker.xml'. - * - * @param filename */ public EmbeddedActiveMQ setConfigResourcePath(String filename) { configResourcePath = filename; @@ -56,8 +54,6 @@ public EmbeddedActiveMQ setConfigResourcePath(String filename) { /** * Classpath resource for broker properties file. Defaults to 'broker.properties'. - * - * @param filename */ public EmbeddedActiveMQ setPropertiesResourcePath(String filename) { propertiesResourcePath = filename; @@ -65,9 +61,8 @@ public EmbeddedActiveMQ setPropertiesResourcePath(String filename) { } /** - * Set the activemq security manager. This defaults to org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl - * - * @param securityManager + * Set the activemq security manager. This defaults to + * org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl */ public EmbeddedActiveMQ setSecurityManager(ActiveMQSecurityManager securityManager) { this.securityManager = securityManager; @@ -81,7 +76,6 @@ public EmbeddedActiveMQ setSecurityManager(ActiveMQSecurityManager securityManag * @param unit unit of time to wait * @param iterations number of iterations * @param servers number of minimal servers - * @return */ public boolean waitClusterForming(long timeWait, TimeUnit unit, int iterations, int servers) throws Exception { if (activeMQServer.getClusterManager().getClusterConnections() == null || activeMQServer.getClusterManager().getClusterConnections().isEmpty()) { @@ -102,8 +96,6 @@ public boolean waitClusterForming(long timeWait, TimeUnit unit, int iterations, /** * Use this mbean server to register management beans. If not set, no mbeans will be registered. - * - * @param mbeanServer */ public EmbeddedActiveMQ setMbeanServer(MBeanServer mbeanServer) { this.mbeanServer = mbeanServer; @@ -113,8 +105,6 @@ public EmbeddedActiveMQ setMbeanServer(MBeanServer mbeanServer) { /** * Set this object if you are not using file-based configuration. The default implementation will load * configuration from a file. - * - * @param configuration */ public EmbeddedActiveMQ setConfiguration(Configuration configuration) { this.configuration = configuration; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/Federation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/Federation.java index f327598f16f..a65364347d9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/Federation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/Federation.java @@ -43,11 +43,11 @@ enum State { STOPPED, STOPPING, /** - * Deployed means {@link FederationManager#deploy()} was called but - * {@link FederationManager#start()} was not called. + * Deployed means {@link FederationManager#deploy()} was called but {@link FederationManager#start()} was not + * called. *

                    - * We need the distinction if {@link FederationManager#stop()} is called before 'start'. As - * otherwise we would leak locators. + * We need the distinction if {@link FederationManager#stop()} is called before 'start'. As otherwise we would + * leak locators. */ DEPLOYED, STARTED, } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederationManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederationManager.java index 9e213590cfb..ee3534d4009 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederationManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederationManager.java @@ -35,11 +35,11 @@ enum State { STOPPED, STOPPING, /** - * Deployed means {@link FederationManager#deploy()} was called but - * {@link FederationManager#start()} was not called. + * Deployed means {@link FederationManager#deploy()} was called but {@link FederationManager#start()} was not + * called. *

                    - * We need the distinction if {@link FederationManager#stop()} is called before 'start'. As - * otherwise we would leak locators. + * We need the distinction if {@link FederationManager#stop()} is called before 'start'. As otherwise we would + * leak locators. */ DEPLOYED, STARTED, } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/address/FederatedAddress.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/address/FederatedAddress.java index 0f868254489..fe89279b7c3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/address/FederatedAddress.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/address/FederatedAddress.java @@ -58,13 +58,11 @@ /** * Federated Address, replicate messages from the remote brokers address to itself. - * + *

                    * Only when a queue exists on the local broker do we replicate, this is to avoid un-needed replication - * - * All messages are replicated, this is on purpose so should a number queues exist with different filters - * we dont have have a consumer per queue filter. - * - * + *

                    + * All messages are replicated, this is on purpose so should a number queues exist with different filters we dont have + * have a consumer per queue filter. */ public class FederatedAddress extends FederatedAbstract implements ActiveMQServerBindingPlugin, ActiveMQServerAddressPlugin, Serializable { 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 caf3876ce5a..960a5ab32eb 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,10 +45,9 @@ /** * Federated Queue, connect to upstream queues routing them to the local queue when a local consumer exist. - * - * By default we connect to -1 the current consumer priority on the remote broker, so that if consumers also exist on the remote broker they a dispatched to first. - * This though is configurable to change this behaviour. - * + *

                    + * By default we connect to -1 the current consumer priority on the remote broker, so that if consumers also exist on + * the remote broker they a dispatched to first. This though is configurable to change this behaviour. */ public class FederatedQueue extends FederatedAbstract implements ActiveMQServerConsumerPlugin, Serializable { @@ -171,9 +170,6 @@ private boolean match(ServerConsumer consumer) { /** * Before a consumer is closed - * - * @param consumer - * @param failed */ @Override public synchronized void beforeCloseConsumer(ServerConsumer consumer, boolean failed) { 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 08c2f57b4dc..892075c3938 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 @@ -28,9 +28,8 @@ import java.lang.invoke.MethodHandles; /** - * Used to move files away. - * Each time a backup starts its formeter data will be moved to a backup folder called bkp.1, bkp.2, ... etc - * We may control the maximum number of folders so we remove old ones. + * Used to move files away. Each time a backup starts its formeter data will be moved to a backup folder called bkp.1, + * bkp.2, ... etc We may control the maximum number of folders so we remove old ones. */ public class FileMoveManager { 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 5e2f73edcee..e88ca614a9c 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 @@ -33,11 +33,11 @@ import org.slf4j.LoggerFactory; /** - * This will keep a list of fileStores. It will make a comparison on all file stores registered. if any is over the limit, - * all Callbacks will be called with over. - * - * For instance: if Large Messages folder is registered on a different folder and it's over capacity, - * the whole system will be waiting it to be released. + * This will keep a list of fileStores. It will make a comparison on all file stores registered. if any is over the + * limit, all Callbacks will be called with over. + *

                    + * For instance: if Large Messages folder is registered on a different folder and it's over capacity, the whole system + * will be waiting it to be released. */ public class FileStoreMonitor extends ActiveMQScheduledComponent { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/GroupingHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/GroupingHandler.java index 0ebb80ff20b..664c4c97532 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/GroupingHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/GroupingHandler.java @@ -47,8 +47,8 @@ public interface GroupingHandler extends NotificationListener, ActiveMQComponent void awaitBindings() throws Exception; /** - * this will force a removal of the group everywhere with an unproposal (dinstance=0). - * This is for the case where a node goes missing + * this will force a removal of the group everywhere with an unproposal (dinstance=0). This is for the case where a + * node goes missing */ void forceRemove(SimpleString groupid, SimpleString clusterName) throws Exception; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/GroupBinding.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/GroupBinding.java index d65c954a5da..c2fec476412 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/GroupBinding.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/GroupBinding.java @@ -18,9 +18,6 @@ import org.apache.activemq.artemis.api.core.SimpleString; -/** - * A group binding - */ public class GroupBinding { private long id; 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 378ad48390c..c224d7e7bb9 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 @@ -67,9 +67,8 @@ public final class LocalGroupingHandler extends GroupHandlingAbstract { private final Condition awaitCondition = lock.newCondition(); /** - * This contains a list of expected bindings to be loaded - * when the group is waiting for them. - * During a small window between the server is started and the wait wasn't called yet, this will contain bindings that were already added + * This contains a list of expected bindings to be loaded when the group is waiting for them. During a small window + * between the server is started and the wait wasn't called yet, this will contain bindings that were already added */ private List expectedBindings = new LinkedList<>(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/RemoteGroupingHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/RemoteGroupingHandler.java index c80f6125da6..c5f733c682c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/RemoteGroupingHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/group/impl/RemoteGroupingHandler.java @@ -41,8 +41,8 @@ /** * A remote Grouping handler. *

                    - * This will use management notifications to communicate with the node that has the Local Grouping - * handler to make proposals. + * This will use management notifications to communicate with the node that has the Local Grouping handler to make + * proposals. */ public final class RemoteGroupingHandler extends GroupHandlingAbstract { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AbstractProtocolReference.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AbstractProtocolReference.java index 9fcfcb9607f..d5aa89bab3f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AbstractProtocolReference.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AbstractProtocolReference.java @@ -23,9 +23,10 @@ import org.apache.activemq.artemis.core.server.MessageReference; import org.apache.activemq.artemis.utils.collections.LinkedListImpl; -/** I need to store protocol specific data on the references. The same need exists in both PagedReference and MessageReferenceImpl. - * This class will serve the purpose to keep the specific protocol data for either reference. - * */ +/** + * I need to store protocol specific data on the references. The same need exists in both PagedReference and + * MessageReferenceImpl. This class will serve the purpose to keep the specific protocol data for either reference. + */ public abstract class AbstractProtocolReference extends LinkedListImpl.Node implements MessageReference { private Map protocolDataMap; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/Activation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/Activation.java index 87ac47c79fe..32956532963 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/Activation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/Activation.java @@ -41,57 +41,57 @@ public abstract class Activation implements Runnable { public abstract void close(boolean permanently, boolean restarting) throws Exception; - /* - * freeze the connection but allow the Activation to over ride this and decide if any connections should be left open. - * */ + /** + * freeze the connection but allow the Activation to over ride this and decide if any connections should be left open. + */ public void freezeConnections(RemotingService remotingService) { if (remotingService != null) { remotingService.freeze(null, null); } } - /* - * allow the activation to override this if it needs to tidy up after freezing the connection. it's a different method as - * it's called outside of the lock that the previous method is. - * */ + /** + * allow the activation to override this if it needs to tidy up after freezing the connection. it's a different + * method as it's called outside of the lock that the previous method is. + */ public void postConnectionFreeze() { } - /* - * called before the server is closing the journals so the activation can tidy up stuff - * */ + /** + * called before the server is closing the journals so the activation can tidy up stuff + */ public void preStorageClose() throws Exception { } - /* - * called by the server to notify the Activation that the server is stopping - * */ + /** + * called by the server to notify the Activation that the server is stopping + */ public void sendPrimaryIsStopping() { } - /* - * called by the ha manager to notify the Activation that HA is now active - * */ + /** + * called by the ha manager to notify the Activation that HA is now active + */ public void haStarted() { } - /* - * allows the Activation to register a channel handler so it can handle any packets that are unique to the Activation - * */ + /** + * allows the Activation to register a channel handler so it can handle any packets that are unique to the Activation + */ public ChannelHandler getActivationChannelHandler(Channel channel, Acceptor acceptorUsed) { return null; } - /* - * returns the HA manager used for this Activation - * */ + /** + * {@return the HA manager used for this Activation} + */ public HAManager getHAManager() { return new StandaloneHAManager(); } - /* - * create the Journal loader needed for this Activation. - * */ + /** + * create the Journal loader needed for this Activation. + */ public JournalLoader createJournalLoader(PostOffice postOffice, PagingManager pagingManager, StorageManager storageManager, @@ -104,9 +104,7 @@ public JournalLoader createJournalLoader(PostOffice postOffice, return new PostOfficeJournalLoader(postOffice, pagingManager, storageManager, queueFactory, nodeManager, managementService, groupingHandler, configuration); } - /* - * todo, remove this, its only needed for JMSServerManagerImpl, it should be sought elsewhere - * */ + // todo, remove this, its only needed for JMSServerManagerImpl, it should be sought elsewhere public ReplicationManager getReplicationManager() { return null; } 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 ea4d02523d9..8803bb1253c 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 @@ -245,11 +245,10 @@ public class ActiveMQServerImpl implements ActiveMQServer { public static final String INTERNAL_NAMING_PREFIX = "$.artemis.internal"; /** - * JMS Topics (which are outside of the scope of the core API) will require a dumb subscription - * with a dummy-filter at this current version as a way to keep its existence valid and TCK - * tests. That subscription needs an invalid filter, however paging needs to ignore any - * subscription with this filter. For that reason, this filter needs to be rejected on paging or - * any other component on the system, and just be ignored for any purpose It's declared here as + * JMS Topics (which are outside of the scope of the core API) will require a dumb subscription with a dummy-filter + * at this current version as a way to keep its existence valid and TCK tests. That subscription needs an invalid + * filter, however paging needs to ignore any subscription with this filter. For that reason, this filter needs to be + * rejected on paging or any other component on the system, and just be ignored for any purpose It's declared here as * this filter is considered a global ignore * * @deprecated Replaced by {@link org.apache.activemq.artemis.core.filter.Filter#GENERIC_IGNORED_FILTER} @@ -294,19 +293,19 @@ public class ActiveMQServerImpl implements ActiveMQServer { private ReplayManager replayManager; - /** Certain management operations shouldn't use more than one thread. - * this semaphore is used to guarantee a single thread used. */ + /** + * Certain management operations shouldn't use more than one thread. this semaphore is used to guarantee a single + * thread used. + */ private final ReentrantLock managementLock = new ReentrantLock(); /** - * This is a thread pool for io tasks only. - * We can't use the same global executor to avoid starvations. + * This is a thread pool for io tasks only. We can't use the same global executor to avoid starvations. */ protected volatile ExecutorFactory ioExecutorFactory; /** - * This is a thread pool for page only tasks only. - * This is because we have to limit parallel reads on paging. + * This is a thread pool for page only tasks only. This is because we have to limit parallel reads on paging. */ protected volatile ExecutorFactory pageExecutorFactory; @@ -558,7 +557,6 @@ public void registerRecordsLoader(Consumer recordsLoader) { /** * A Callback for tests - * @return */ public Runnable getAfterActivationCreated() { return afterActivationCreated; @@ -566,8 +564,6 @@ public Runnable getAfterActivationCreated() { /** * A Callback for tests - * @param afterActivationCreated - * @return */ public ActiveMQServerImpl setAfterActivationCreated(Runnable afterActivationCreated) { this.afterActivationCreated = afterActivationCreated; @@ -593,9 +589,7 @@ private void clearJdbcNetworkTimeout() { } } - /* - * Can be overridden for tests - */ + // Can be overridden for tests protected NodeManager createNodeManager(final File directory, boolean replicatingBackup) { NodeManager manager; if (!configuration.isPersistenceEnabled()) { @@ -804,7 +798,8 @@ protected void initializeCriticalAnalyzer() throws Exception { this.analyzer = analyzer; } - /* Calling this for cases where the server was stopped and now is being restarted... failback, etc...*/ + /* + * Calling this for cases where the server was stopped and now is being restarted... failback, etc...*/ analyzer.clear(); analyzer.setCheckTime(configuration.getCriticalAnalyzerCheckPeriod(), TimeUnit.MILLISECONDS).setTimeout(configuration.getCriticalAnalyzerTimeout(), TimeUnit.MILLISECONDS); @@ -3053,8 +3048,6 @@ public String toString() { /** * For tests only, don't use this method as it's not part of the API - * - * @param factory */ public void replaceQueueFactory(QueueFactory factory) { this.queueFactory = factory; @@ -3138,7 +3131,8 @@ private void callActivationCompleteCallbacks() { * Sets up ActiveMQ Artemis Executor Services. */ private void initializeExecutorServices() { - /* We check to see if a Thread Pool is supplied in the InjectedObjectRegistry. If so we created a new Ordered + /* + * We check to see if a Thread Pool is supplied in the InjectedObjectRegistry. If so we created a new Ordered * Executor based on the provided Thread pool. Otherwise we create a new ThreadPool. */ if (serviceRegistry.getExecutorService() == null) { @@ -3190,7 +3184,8 @@ public ThreadFactory run() { this.pageExecutorFactory = new OrderedExecutorFactory(pageExecutorPool); } - /* We check to see if a Scheduled Executor Service is provided in the InjectedObjectRegistry. If so we use this + /* + * We check to see if a Scheduled Executor Service is provided in the InjectedObjectRegistry. If so we use this * Scheduled ExecutorService otherwise we create a new one. */ if (serviceRegistry.getScheduledExecutorService() == null) { @@ -3218,10 +3213,7 @@ public ServiceRegistry getServiceRegistry() { /** * Starts everything apart from RemotingService and loading the data. *

                    - * After optional intermediary steps, Part 1 is meant to be followed by part 2 - * {@link #initialisePart2(boolean)}. - * - * @param scalingDown + * After optional intermediary steps, this is meant to be followed by {@link #initialisePart2(boolean)}. */ synchronized boolean initialisePart1(boolean scalingDown) throws Exception { if (state == SERVER_STATE.STOPPED) @@ -3265,7 +3257,7 @@ synchronized boolean initialisePart1(boolean scalingDown) throws Exception { resourceManager = new ResourceManagerImpl(this, (int) (configuration.getTransactionTimeout() / 1000), configuration.getTransactionTimeoutScanPeriod(), scheduledPool); - /** + /* * If there is no plugin configured we don't want to instantiate a MetricsManager. This keeps the dependency * on Micrometer as "optional" in the Maven pom.xml. This is particularly beneficial because optional dependencies * are not required to be included in the OSGi bundle and the Micrometer jars apparently don't support OSGi. @@ -3458,7 +3450,7 @@ public void removeMirrorControl() { postOffice.setMirrorControlSource(null); } - /* + /** * Load the data, and start remoting service so clients can connect */ synchronized void initialisePart2(boolean scalingDown) throws Exception { @@ -3614,7 +3606,8 @@ private void updateProtocolServices() throws Exception { } /** - * This method exists for a possibility of test cases replacing the FileStoreMonitor for an extension that would for instance pretend a disk full on certain tests. + * This method exists for a possibility of test cases replacing the FileStoreMonitor for an extension that would for + * instance pretend a disk full on certain tests. */ public void injectMonitor(FileStoreMonitor storeMonitor) throws Exception { try { @@ -3880,9 +3873,6 @@ private JournalLoadInformation[] loadJournals(Set storedLargeMessages) thr return journalInfo; } - /** - * @throws Exception - */ private void recoverStoredConfigs() throws Exception { recoverStoredAddressSettings(); recoverStoredSecuritySettings(); @@ -3951,7 +3941,9 @@ public void autoRemoveAddressInfo(SimpleString address, SecurityAuth auth) throw removeAddressInfo(address, auth); } - /** Register a queue on the management registry */ + /** + * Register a queue on the management registry + */ @Override public void registerQueueOnManagement(Queue queue) throws Exception { managementService.registerQueue(queue, queue.getAddress(), storageManager); 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 a66e3647cf3..caf17c74a82 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 @@ -109,22 +109,12 @@ public AddressInfo(SimpleString name) { this(name, createEmptySet()); } - /** - * Creates an AddressInfo object with a Set of routing types - * @param name - * @param routingTypes - */ public AddressInfo(SimpleString name, EnumSet routingTypes) { this.name = CompositeAddress.extractAddressName(name); this.createdTimestamp = System.currentTimeMillis(); setRoutingTypes(routingTypes); } - /** - * Creates an AddressInfo object with a single RoutingType associated with it. - * @param name - * @param routingType - */ public AddressInfo(SimpleString name, RoutingType routingType) { this.name = CompositeAddress.extractAddressName(name); this.createdTimestamp = System.currentTimeMillis(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AnyNodeLocatorForReplication.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AnyNodeLocatorForReplication.java index a0debce502b..6446f5eb509 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AnyNodeLocatorForReplication.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AnyNodeLocatorForReplication.java @@ -32,8 +32,8 @@ import org.apache.activemq.artemis.utils.ConcurrentUtil; /** - * This implementation looks for any available node, once tried with no success it is marked as - * tried and the next available is used. + * This implementation looks for any available node, once tried with no success it is marked as tried and the next + * available is used. */ public class AnyNodeLocatorForReplication extends NodeLocator { @@ -99,8 +99,7 @@ public void nodeUP(TopologyMember topologyMember, boolean last) { } /** - * if a node goes down we try all the connectors again as one may now be available for - * replication + * if a node goes down we try all the connectors again as one may now be available for replication *

                    * TODO: there will be a better way to do this by finding which nodes backup has gone down. */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/BackupRecoveryJournalLoader.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/BackupRecoveryJournalLoader.java index 957a7a49b3d..86476a241f0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/BackupRecoveryJournalLoader.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/BackupRecoveryJournalLoader.java @@ -40,10 +40,11 @@ import org.apache.activemq.artemis.core.server.management.ManagementService; import org.apache.activemq.artemis.core.transaction.ResourceManager; -/* -* Instead of loading into its own post office this will use its parent server (the active server) and load into that. -* Since the server is already running we have to make sure we don't route any message that may subsequently get deleted or acked. -* */ +/** + * Instead of loading into its own post office this will use its parent server (the active server) and load into that. + * Since the server is already running we have to make sure we don't route any message that may subsequently get deleted + * or acked. + */ public class BackupRecoveryJournalLoader extends PostOfficeJournalLoader { private ActiveMQServer parentServer; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/BucketMessageGroups.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/BucketMessageGroups.java index 15f7e14e389..fc199d105bc 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/BucketMessageGroups.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/BucketMessageGroups.java @@ -24,19 +24,22 @@ import org.apache.activemq.artemis.api.core.SimpleString; /** - * BucketMessageGroups, stores values against a bucket, where the bucket used is based on the provided key objects hash. - * + * BucketMessageGroups, stores values against a bucket, where the bucket used is based on the provided key objects + * hash. + *

                    * As such where keys compute to the same bucket they will act on that stored value, not the unique specific key. - * + *

                    * The number of buckets is provided at construction. */ public class BucketMessageGroups implements MessageGroups { - //This _AMQ_GROUP_BUCKET_INT_KEY uses the post-fixed value after this key, as an int, it is used for a few cases: - //1) For the admin screen we need to show a group key so we have to map back from int to something, as it expects SimpleString. - //2) Admin users still need to interact with a specific bucket/group e.g. they may need to reset a bucket. - //3) Choice of key is we want to avoid risk of clashing with users groups keys. - //4) Actually makes testing a little easier as we know how the parsed int will hash. + /* + * This _AMQ_GROUP_BUCKET_INT_KEY uses the post-fixed value after this key, as an int, it is used for a few cases: + * 1) For the admin screen we need to show a group key so we have to map back from int to something, as it expects SimpleString. + * 2) Admin users still need to interact with a specific bucket/group e.g. they may need to reset a bucket. + * 3) Choice of key is we want to avoid risk of clashing with users groups keys. + * 4) Actually makes testing a little easier as we know how the parsed int will hash. + */ private static SimpleString _AMQ_GROUP_BUCKET_INT_KEY = SimpleString.of("_AMQ_GROUP_BUCKET_INT_KEY_"); private final int bucketCount; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/CleaningActivateCallback.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/CleaningActivateCallback.java index f02e30eb10c..703a21f2ac0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/CleaningActivateCallback.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/CleaningActivateCallback.java @@ -20,7 +20,9 @@ import org.apache.activemq.artemis.core.server.ActivateCallback; import org.apache.activemq.artemis.core.server.ActiveMQServer; -/** This is an abstract ActivateCallback that will cleanup itself when the broker is shutodwn */ +/** + * This is an abstract ActivateCallback that will cleanup itself when the broker is shutodwn + */ public abstract class CleaningActivateCallback implements ActivateCallback { public CleaningActivateCallback() { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ConnectorsService.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ConnectorsService.java index c9fb20060a1..ac826c28f64 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ConnectorsService.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ConnectorsService.java @@ -37,11 +37,11 @@ import org.apache.activemq.artemis.utils.ConfigurationHelper; /** - * ConnectorsService will pool some resource for updates, e.g. Twitter, then the changes are picked - * and converted into a ServerMessage for a given destination (queue). + * ConnectorsService will pool some resource for updates, e.g. Twitter, then the changes are picked and converted into a + * ServerMessage for a given destination (queue). *

                    - * It may also listen to a queue, and forward them (e.g. messages arriving at the queue are picked - * and tweeted to some Twitter account). + * It may also listen to a queue, and forward them (e.g. messages arriving at the queue are picked and tweeted to some + * Twitter account). */ public final class ConnectorsService implements ActiveMQComponent { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DisabledMessageGroups.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DisabledMessageGroups.java index 06b098c92fe..50e5d5cdf17 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DisabledMessageGroups.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/DisabledMessageGroups.java @@ -19,7 +19,8 @@ import org.apache.activemq.artemis.utils.collections.NoOpMap; /** - * Implementation of MessageGroups that simply uses a NoOpMap, and in essence disables message grouping for queues that use it. + * Implementation of MessageGroups that simply uses a NoOpMap, and in essence disables message grouping for queues that + * use it. * * @param the value type. */ 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 7132bb65459..8890e400e4a 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 @@ -228,9 +228,6 @@ public void setRoutingType(ComponentConfigurationRoutingType routingType) { this.routingType = routingType; } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { return "DivertImpl [routingName=" + routingName + 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 99adbdfc640..c95d059b01a 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 @@ -57,9 +57,10 @@ public FileBasedNodeManager(boolean replicatedBackup, File directory) { } /** - * If {@code createIfNotExists} and activation sequence file doesn't exist yet, it returns {@code null}, - * otherwise it opens it.
                    - * if {@code !createIfNotExists} it just open to create it. + * If {@code createIfNotExists} and activation sequence file doesn't exist yet, it returns {@code null}, otherwise it + * opens it. + *

                    + * If {@code !createIfNotExists} it just open to create it. */ private FileChannel useActivationSequenceChannel(final boolean createIfNotExists) throws IOException { FileChannel channel = this.activationSequenceChannel; @@ -147,9 +148,7 @@ protected synchronized void setUpServerLockFile() throws IOException { ActiveMQServerLogger.LOGGER.nodeManagerCantOpenFile(serverLockFile, e); throw e; } catch (IOException e) { - /* - * on some OS's this may fail weirdly even tho the parent dir exists, retrying will work, some weird timing issue i think - * */ + // on some OS's this may fail weirdly even tho the parent dir exists, retrying will work, some weird timing issue i think if (count < 5) { try { Thread.sleep(100); 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 34b59fe4a58..682c3484c04 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 @@ -318,10 +318,6 @@ private void setPaused() throws NodeManagerException { writeFileLockStatus(PAUSED); } - /** - * @param status - * @throws NodeManagerException - */ private void writeFileLockStatus(byte status) throws NodeManagerException { if (replicatedBackup && channel == null) { return; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/GroupFirstMessageReference.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/GroupFirstMessageReference.java index 6d0de9dc606..dfcaa60764d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/GroupFirstMessageReference.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/GroupFirstMessageReference.java @@ -26,10 +26,9 @@ import org.apache.activemq.artemis.core.transaction.Transaction; /** - * This MessageReference should only be created the first time a group is assigned to a consumer, - * it allows us to make a copy of the message to add the property safely as a delivery semantic, - * without affecting the underlying message. - * + * This MessageReference should only be created the first time a group is assigned to a consumer, it allows us to make a + * copy of the message to add the property safely as a delivery semantic, without affecting the underlying message. + *

                    * The overhead is low, as noted above only should be created on first message in a group to a consumer. */ public class GroupFirstMessageReference implements MessageReference { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java index d0d2a8cbfb6..3b9eb58047a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java @@ -31,9 +31,9 @@ /** * NodeManager used to run multiple servers in the same VM. *

                    - * We use the {@link org.apache.activemq.artemis.core.server.impl.InVMNodeManager} instead of {@link org.apache.activemq.artemis.core.server.impl.FileLockNodeManager} when - * multiple servers are run inside the same VM and File Locks can not be shared in the - * same VM (it would cause a shared lock violation). + * We use the {@link org.apache.activemq.artemis.core.server.impl.InVMNodeManager} instead of + * {@link org.apache.activemq.artemis.core.server.impl.FileLockNodeManager} when multiple servers are run inside the + * same VM and File Locks can not be shared in the same VM (it would cause a shared lock violation). */ public final class InVMNodeManager extends FileBasedNodeManager { 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 2373a67c8aa..f05018cdb6b 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,11 +42,11 @@ /** * A queue that will discard messages if a newer message with the same - * {@link org.apache.activemq.artemis.core.message.impl.CoreMessage#HDR_LAST_VALUE_NAME} property value. In other words it only retains the last - * value + * {@link org.apache.activemq.artemis.core.message.impl.CoreMessage#HDR_LAST_VALUE_NAME} property value. In other words + * it only retains the last value *

                    - * This is useful for example, for stock prices, where you're only interested in the latest value - * for a particular stock + * This is useful for example, for stock prices, where you're only interested in the latest value for a particular + * stock */ @SuppressWarnings("ALL") public class LastValueQueue extends QueueImpl { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/MapMessageGroups.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/MapMessageGroups.java index 6269abf7edc..8c042485cb3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/MapMessageGroups.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/MapMessageGroups.java @@ -22,7 +22,8 @@ import org.apache.activemq.artemis.api.core.SimpleString; /** - * This is abstract implementation of MessageGroups that simply wraps the MessageGroup interface around the passed in map. + * This is abstract implementation of MessageGroups that simply wraps the MessageGroup interface around the passed in + * map. */ abstract class MapMessageGroups implements MessageGroups { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/MessageReferenceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/MessageReferenceImpl.java index 370e5087908..b542601f404 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/MessageReferenceImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/MessageReferenceImpl.java @@ -126,7 +126,8 @@ public void onDelivery(Consumer onDelivery) { } /** - * It will call {@link Consumer#accept(Object)} on {@code this} of the {@link Consumer} registered in {@link #onDelivery(Consumer)}, if any. + * It will call {@link Consumer#accept(Object)} on {@code this} of the {@link Consumer} registered in + * {@link #onDelivery(Consumer)}, if any. */ @Override public void run() { @@ -140,19 +141,11 @@ public void run() { } } - - - /** - * @return the persistedCount - */ @Override public int getPersistedCount() { return persistedCount; } - /** - * @param persistedCount the persistedCount to set - */ @Override public void setPersistedCount(int persistedCount) { this.persistedCount = persistedCount; 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 08e8af6958d..50dc36a5ce6 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 @@ -330,9 +330,6 @@ public void handlePreparedTransaction(Transaction tx, /** * This method will recover the counters after failures making sure the page counter doesn't get out of sync - * - * @param pendingNonTXPageCounter - * @throws Exception */ @Override public void recoverPendingPageCounters(List pendingNonTXPageCounter) throws Exception { @@ -437,12 +434,6 @@ public void cleanUp() { /** * This generates a map for use on the recalculation and recovery of pending maps after reloading it - * - * @param queues - * @param pendingNonTXPageCounter - * @param txRecoverCounter - * @return - * @throws Exception */ private Map>>> generateMapsOnPendingCount(Map queues, List pendingNonTXPageCounter, diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConfigurationUtils.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConfigurationUtils.java index e701a0ce71d..c90ebca8f77 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConfigurationUtils.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConfigurationUtils.java @@ -23,11 +23,13 @@ public class QueueConfigurationUtils { /** - * This method inspects the {@code QueueConfiguration} and applies default values to it based on the {@code - * AddressSettings} as well as {@code static} defaults. The {@code static} values are applied only after the values - * from the {@code AddressSettings} are applied. Values are only changed to defaults if they are {@code null}. + * This method inspects the {@code QueueConfiguration} and applies default values to it based on the + * {@code AddressSettings} as well as {@code static} defaults. The {@code static} values are applied only after the + * values from the {@code AddressSettings} are applied. Values are only changed to defaults if they are + * {@code null}. + * * @param config the {@code QueueConfiguration} to modify with default values - * @param as the {@code AddressSettings} to use when applying dynamic default values + * @param as the {@code AddressSettings} to use when applying dynamic default values */ public static void applyDefaults(final QueueConfiguration config, AddressSettings as) { applyDynamicDefaults(config, as); @@ -35,10 +37,11 @@ public static void applyDefaults(final QueueConfiguration config, AddressSetting } /** - * This method inspects the {@code QueueConfiguration} and applies default values to it based on the {@code - * AddressSettings}. Values are only changed to defaults if they are {@code null}. + * This method inspects the {@code QueueConfiguration} and applies default values to it based on the + * {@code AddressSettings}. Values are only changed to defaults if they are {@code null}. + * * @param config the {@code QueueConfiguration} to modify with default values - * @param as the {@code AddressSettings} to use when applying dynamic default values + * @param as the {@code AddressSettings} to use when applying dynamic default values */ public static void applyDynamicDefaults(final QueueConfiguration config, AddressSettings as) { if (config.getMaxConsumers() == null) { @@ -100,10 +103,11 @@ public static void applyDynamicDefaults(final QueueConfiguration config, Address /** * This method inspects the {@code QueueConfiguration} and applies default values to it based on the {@code static} * defaults. Values are only changed to defaults if they are {@code null}. - *
                    + *

                    * Static defaults are not applied directly in {@code QueueConfiguration} because {@code null} values allow us to * determine whether the fields have actually been set. This allows us, for example, to omit unset fields from JSON * payloads during queue-related management operations. + * * @param config the {@code QueueConfiguration} to modify with default values */ public static void applyStaticDefaults(final QueueConfiguration config) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConsumersImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConsumersImpl.java index 7f16ceea3af..dba916413ab 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConsumersImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueConsumersImpl.java @@ -31,19 +31,19 @@ /** * This class's purpose is to hold the consumers. - * - * CopyOnWriteArraySet is used as the underlying collection to the PriorityCollection, as it is concurrent safe, - * but also lock less for a read path, which is our HOT path. - * Also it was the underlying collection previously used in QueueImpl, before we abstracted it out to support priority consumers. - * - * There can only be one resettable iterable view, - * A new iterable view is created on modification, this is to keep the read HOT path performent, BUT - * the iterable view changes only after reset so changes in the underlying collection are only seen after a reset, - * + *

                    + * CopyOnWriteArraySet is used as the underlying collection to the PriorityCollection, as it is concurrent safe, but + * also lock less for a read path, which is our HOT path. Also it was the underlying collection previously used in + * QueueImpl, before we abstracted it out to support priority consumers. + *

                    + * There can only be one resettable iterable view, A new iterable view is created on modification, this is to keep the + * read HOT path performent, BUT the iterable view changes only after reset so changes in the underlying collection are + * only seen after a reset, + *

                    * All other iterators created by iterators() method are not reset-able and are created on delegating iterator(). * - * @param The type this class may hold, this is generic as can be anything that extends PriorityAware, - * but intent is this is the QueueImpl:ConsumerHolder. + * @param The type this class may hold, this is generic as can be anything that extends PriorityAware, but intent is + * this is the QueueImpl:ConsumerHolder. */ public class QueueConsumersImpl implements QueueConsumers { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java index 570fe68f372..dd8c5459cae 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueFactoryImpl.java @@ -34,9 +34,6 @@ import org.apache.activemq.artemis.core.settings.impl.AddressSettings; import org.apache.activemq.artemis.utils.ExecutorFactory; -/** - * A QueueFactoryImpl - */ public class QueueFactoryImpl implements QueueFactory { protected final HierarchicalRepository addressSettingsRepository; 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 064dd136b17..4fd88a48fad 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 @@ -156,8 +156,8 @@ public class QueueImpl extends CriticalComponentImpl implements Queue { public static final int CHECK_QUEUE_SIZE_PERIOD = 1000; /** - * If The system gets slow for any reason, this is the maximum time a Delivery or - * or depage executor should be hanging on + * If The system gets slow for any reason, this is the maximum time a Delivery or or depage executor should be + * hanging on */ public static final int DELIVERY_TIMEOUT = 1000; @@ -169,19 +169,20 @@ public class QueueImpl extends CriticalComponentImpl implements Queue { private volatile boolean queueDestroyed = false; - // Variable to control if we should print a flow controlled message or not. - // Once it was flow controlled, we will stop warning until it's cleared once again + // Variable to control if we should print a flow controlled message or not. Once it was flow controlled, we will stop + // warning until it's cleared once again private volatile boolean pageFlowControlled = false; private volatile long pageFlowControlledLastLog = 0; - // It is not expected to have an user really changing this. This is a system property now in case users disagree and find value on changing it. - // In case there is in fact value on changing it we may consider bringing it as an address-settings or broker.xml + // It is not expected to have a user really changing this. This is a system property now in case users disagree and + // find value on changing it. In case there is in fact value on changing it we may consider bringing it as an + // address-settings in broker.xml private static final long PAGE_FLOW_CONTROL_PRINT_INTERVAL = Long.parseLong(System.getProperty("ARTEMIS_PAGE_FLOW_CONTROL_PRINT_INTERVAL", "60000")); - // once we delivered messages from paging, we need to call asyncDelivery upon acks - // if we flow control paging, ack more messages will open the space to deliver more messages - // hence we will need this flag to determine if it was paging before. + // Once we delivered messages from paging we need to call asyncDelivery upon acks if we flow control paging, ack more + // messages will open the space to deliver more messages hence we will need this flag to determine if it was paging + // before. private volatile boolean pageDelivered = false; private final PagingStore pagingStore; @@ -198,9 +199,8 @@ public class QueueImpl extends CriticalComponentImpl implements Queue { private volatile boolean hasUnMatchedPending = false; - // Messages will first enter intermediateMessageReferences - // Before they are added to messageReferences - // This is to avoid locking the queue on the producer + // Messages will first enter intermediateMessageReferences before they are added to messageReferences. This is to + // avoid locking the queue on the producer private final MpscUnboundedArrayQueue intermediateMessageReferences; // This is where messages are stored @@ -331,8 +331,8 @@ public void setSwept(boolean swept) { } /** - * This is to avoid multi-thread races on calculating direct delivery, - * to guarantee ordering will be always be correct + * This is to avoid multi-thread races on calculating direct delivery, to guarantee ordering will be always be + * correct */ private final Object directDeliveryGuard = new Object(); @@ -824,7 +824,6 @@ public void unproposed(final SimpleString groupID) { } } - /* Called when a message is cancelled back into the queue */ @Override public void addHead(final MessageReference ref, boolean scheduling) { if (logger.isTraceEnabled()) { @@ -850,7 +849,6 @@ public void addHead(final MessageReference ref, boolean scheduling) { } } - /* Called when a message is cancelled back into the queue */ @Override public void addSorted(final MessageReference ref, boolean scheduling) { if (logger.isTraceEnabled()) { @@ -875,7 +873,6 @@ public void addSorted(final MessageReference ref, boolean scheduling) { } } - /* Called when a message is cancelled back into the queue */ @Override public void addHead(final List refs, boolean scheduling) { try (ArtemisCloseable metric = measureCritical(CRITICAL_PATH_ADD_HEAD)) { @@ -891,7 +888,6 @@ public void addHead(final List refs, boolean scheduling) { } } - /* Called when a message is cancelled back into the queue */ @Override public void addSorted(final List refs, boolean scheduling) { if (refs.size() > MAX_DELIVERIES_IN_LOOP) { @@ -1099,7 +1095,7 @@ public ArtemisExecutor getExecutor() { } } - /* Only used on tests */ + // Only used on tests public void deliverNow() { deliverAsync(); @@ -1641,9 +1637,11 @@ public void acknowledge(final Transaction tx, final MessageReference ref) throws acknowledge(tx, ref, AckReason.NORMAL, null, true); } - /** The parameter delivering can be sent as false in situation where the ack is coming outside of the context of delivering. - * Example: Mirror replication will call the ack here without any consumer involved. On that case no previous delivery happened, - * hence no information about delivering statistics should be updated. */ + /** + * The parameter delivering can be sent as false in situation where the ack is coming outside of the context of + * delivering. Example: Mirror replication will call the ack here without any consumer involved. On that case no + * previous delivery happened, hence no information about delivering statistics should be updated. + */ @Override public void acknowledge(final Transaction tx, final MessageReference ref, final AckReason reason, final ServerConsumer consumer, boolean delivering) throws Exception { final boolean transactional = tx != null; @@ -1743,7 +1741,6 @@ public void reacknowledge(final Transaction tx, final MessageReference ref) thro getRefsOperation(tx, AckReason.NORMAL).addAck(ref); - // https://issues.jboss.org/browse/HORNETQ-609 incDelivering(ref); messagesAcknowledged.incrementAndGet(); @@ -1804,9 +1801,11 @@ public void expire(final MessageReference ref) throws Exception { expire(ref, null, true); } - /** The parameter delivering can be sent as false in situation where the ack is coming outside of the context of delivering. - * Example: Mirror replication will call the ack here without any consumer involved. On that case no previous delivery happened, - * hence no information about delivering statistics should be updated. */ + /** + * The parameter delivering can be sent as false in situation where the ack is coming outside of the context of + * delivering. Example: Mirror replication will call the ack here without any consumer involved. On that case no + * previous delivery happened, hence no information about delivering statistics should be updated. + */ @Override public void expire(final MessageReference ref, final ServerConsumer consumer, boolean delivering) throws Exception { expire(null, ref, consumer, delivering); @@ -1999,14 +1998,8 @@ public boolean actMessage(Transaction tx, MessageReference ref) throws Exception } /** - * This is a generic method for any method interacting on the Queue to move or delete messages - * Instead of duplicate the feature we created an abstract class where you pass the logic for - * each message. - * - * @param filter1 - * @param messageAction - * @return - * @throws Exception + * This is a generic method for any method interacting on the Queue to move or delete messages Instead of duplicate + * the feature we created an abstract class where you pass the logic for each message. */ private int iterQueue(final int flushLimit, final Filter filter1, @@ -2720,17 +2713,11 @@ public boolean isDirectDeliver() { return directDeliver && supportsDirectDeliver; } - /** - * @return if queue is internal - */ @Override public boolean isInternalQueue() { return queueConfiguration.isInternal(); } - /** - * @param internalQueue the internalQueue to set - */ @Override public void setInternalQueue(boolean internalQueue) { queueConfiguration.setInternal(internalQueue); @@ -2769,11 +2756,8 @@ private synchronized void internalAddTail(final MessageReference ref) { } /** - * The caller of this method requires synchronized on the queue. - * I'm not going to add synchronized to this method just for a precaution, - * as I'm not 100% sure this won't cause any extra runtime. - * - * @param ref + * The caller of this method requires synchronized on the queue. I'm not going to add synchronized to this method + * just for a precaution, as I'm not 100% sure this won't cause any extra runtime. */ private void internalAddHead(final MessageReference ref) { if (RefCountMessage.isRefTraceEnabled()) { @@ -2791,11 +2775,8 @@ private void internalAddHead(final MessageReference ref) { } /** - * The caller of this method requires synchronized on the queue. - * I'm not going to add synchronized to this method just for a precaution, - * as I'm not 100% sure this won't cause any extra runtime. - * - * @param ref + * The caller of this method requires synchronized on the queue. I'm not going to add synchronized to this method + * just for a precaution, as I'm not 100% sure this won't cause any extra runtime. */ private void internalAddSorted(final MessageReference ref) { if (RefCountMessage.isRefTraceEnabled()) { @@ -2849,10 +2830,11 @@ synchronized void doInternalPoll() { } } - /** This method is to only be used during deliveryAsync when the queue was destroyed - and the async process left more messages to be delivered - This is a race between destroying the queue and async sends that came after - the deleteQueue already happened. */ + /** + * This method is to only be used during deliveryAsync when the queue was destroyed and the async process left more + * messages to be delivered. This is a race between destroying the queue and async sends that came after the + * deleteQueue already happened. + */ private void removeMessagesWhileDelivering() throws Exception { assert queueDestroyed : "Method to be used only when the queue was destroyed"; Transaction tx = new TransactionImpl(storageManager); @@ -3107,10 +3089,7 @@ private void checkDepage() { } /** - * * This is a check on page sizing. - * - * @return */ private boolean needsDepage() { final int maxReadMessages = pageSubscription.getPagingStore().getMaxPageReadMessages(); @@ -3494,7 +3473,8 @@ private boolean moveBetweenSnFQueues(final SimpleString queueSuffix, RoutingContext routingContext = new RoutingContextImpl(tx); - /* this algorithm will look at the old route and find the new remote queue bindings where the messages should go + /* + * this algorithm will look at the old route and find the new remote queue bindings where the messages should go * and route them there directly */ while (oldBuffer.hasRemaining()) { @@ -3711,9 +3691,7 @@ private void createResources(String address, boolean isAutoCreate, SimpleString } } - /* - * This method delivers the reference on the callers thread - this can give us better latency in the case there is nothing in the queue - */ + // This method delivers the reference on the callers thread - this can give us better latency in the case there is nothing in the queue private boolean deliverDirect(final MessageReference ref) { //The order to enter the deliverLock re QueueImpl::this lock is very important: //- acquire deliverLock::lock @@ -3836,7 +3814,9 @@ private void proceedDeliver(Consumer consumer, MessageReference reference) { } } - /** This will print errors and decide what to do with the errored consumer from the protocol layer. */ + /** + * This will print errors and decide what to do with the errored consumer from the protocol layer. + */ @Override public void errorProcessing(Consumer consumer, Throwable t, MessageReference reference) { ActiveMQServerLogger.LOGGER.removingBadConsumer(consumer, reference, t); @@ -3894,9 +3874,11 @@ public void postAcknowledge(final MessageReference ref, AckReason reason) { postAcknowledge(ref, reason, true); } - /** The parameter delivering can be sent as false in situation where the ack is coming outside of the context of delivering. - * Example: Mirror replication will call the ack here without any consumer involved. On that case no previous delivery happened, - * hence no information about delivering statistics should be updated. */ + /** + * The parameter delivering can be sent as false in situation where the ack is coming outside of the context of + * delivering. Example: Mirror replication will call the ack here without any consumer involved. On that case no + * previous delivery happened, hence no information about delivering statistics should be updated. + */ @Override public void postAcknowledge(final MessageReference ref, AckReason reason, boolean delivering) { QueueImpl queue = (QueueImpl) ref.getQueue(); @@ -4150,9 +4132,10 @@ public void run() { } /** - * There's no need of having multiple instances of this class. a Single instance per QueueImpl should be more than sufficient. - * previous versions of this class were using a synchronized object. The current version is using the deliverRunner - * instance, and to avoid confusion on the implementation I'm requesting to keep this single instanced per QueueImpl. + * There's no need of having multiple instances of this class. a Single instance per QueueImpl should be more than + * sufficient. previous versions of this class were using a synchronized object. The current version is using the + * deliverRunner instance, and to avoid confusion on the implementation I'm requesting to keep this single instanced + * per QueueImpl. */ private final class DeliverRunner implements Runnable { @@ -4201,11 +4184,11 @@ abstract class QueueIterateAction { } /** + * The custom action to take on the message from the queue iterator. * - * @param tx the transaction which the message action should participate in - * @param ref the message reference which the action should act upon - * @return true if the action should result in the removal of the message from the queue; false otherwise - * @throws Exception + * @param tx the transaction which the message action should participate in + * @param ref the message reference which the action should act upon + * @return true if the action should result in the removal of the message from the queue; false otherwise */ public abstract boolean actMessage(Transaction tx, MessageReference ref) throws Exception; @@ -4214,7 +4197,7 @@ public boolean expectedHitsReached(int currentHits) { } } - /* For external use we need to use a synchronized version since the list is not thread safe */ + // For external use we need to use a synchronized version since the list is not thread safe private class SynchronizedIterator implements LinkedListIterator { private final LinkedListIterator iter; @@ -4413,8 +4396,7 @@ public void incDelivering(MessageReference ref) { public void decDelivering(final MessageReference reference) { deliveringMetrics.decrementMetrics(reference); if (pageDelivered) { - /* we check for async delivery after acks - in case paging stopped for lack of space */ + // We check for async delivery after acks in case paging stopped for lack of space deliverAsync(); } } 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 28f7599be93..3bad2004be5 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 @@ -137,15 +137,10 @@ public int getNonPagedMessageCount() { return messageCount; } - /** - * @return the messageCount - */ public int getMessageCount() { return messageCount + messageCountPaged; } - /** - * @return the persistentSize - */ + public long getPersistentSize() { return persistentSize + persistentSizePaged; } @@ -158,9 +153,6 @@ public long getNonPagedDurablePersistentSize() { return durablePersistentSize; } - /** - * @return the durableMessageCount - */ public int getDurableMessageCount() { return durableMessageCount + durableMessageCountPaged; } @@ -169,9 +161,6 @@ public int getNonPagedDurableMessageCount() { return durableMessageCount; } - /** - * @return the durablePersistentSize - */ public long getDurablePersistentSize() { return durablePersistentSize + durablePersistentSizePaged; } @@ -187,5 +176,4 @@ private static long getPersistentSize(final MessageReference reference) { return size; } - } 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 9478084100f..8ef9afffcab 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 @@ -49,8 +49,7 @@ public class RefsOperation extends TransactionOperationAbstract { List pagedMessagesToPostACK = null; /** - * It will ignore redelivery check, which is used during consumer.close - * to not perform reschedule redelivery check + * It will ignore redelivery check, which is used during consumer.close to not perform reschedule redelivery check */ protected boolean ignoreRedeliveryCheck = false; 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 44a93837d3a..71383b4b674 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 @@ -49,8 +49,8 @@ import static org.apache.activemq.artemis.core.server.impl.quorum.ActivationSequenceStateMachine.tryActivate; /** - * This activation can be used by a primary while trying to fail-back ie {@code failback == true} or - * by a natural-born backup ie {@code failback == false}.
                    + * This activation can be used by a primary while trying to fail-back ie {@code failback == true} or by a natural-born + * backup ie {@code failback == false}. */ public final class ReplicationBackupActivation extends Activation implements DistributedLockManager.UnavailableManagerListener { @@ -117,9 +117,9 @@ public void onUnavailableManagerEvent() { } /** - * This util class exists because {@link NodeLocator} need a {@link NodeLocator.BackupRegistrationListener} - * to forward backup registration failure events: this is used to switch on/off backup registration event listening - * on an existing locator. + * This util class exists because {@link NodeLocator} need a {@link NodeLocator.BackupRegistrationListener} to + * forward backup registration failure events: this is used to switch on/off backup registration event listening on + * an existing locator. */ private static final class RegistrationFailureForwarder implements NodeLocator.BackupRegistrationListener, AutoCloseable { 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 6b1c4e091be..558aa75271a 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 @@ -32,9 +32,10 @@ /** * Stops the backup in case of an error at the start of Replication. *

                    - * Using an interceptor for the task to avoid a server reference inside of the 'basic' channel-0 - * handler at {@link org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager.Channel0Handler}. As {@link org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager} - * is also shipped in the activemq-core-client JAR (which does not include {@link org.apache.activemq.artemis.core.server.ActiveMQServer}). + * Using an interceptor for the task to avoid a server reference inside of the 'basic' channel-0 handler at + * {@link org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager.Channel0Handler}. As + * {@link org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQClientProtocolManager} is also shipped in the + * activemq-core-client JAR (which does not include {@link org.apache.activemq.artemis.core.server.ActiveMQServer}). */ final class ReplicationError implements Interceptor { 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 beefcb3263a..f5b7c75a480 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 @@ -264,7 +264,8 @@ public void onRemoteBackupUpToDate(String nodeId, long activationSequence) { primaryID = nodeId; } if (activationSequence <= 0) { - /* NOTE: activationSequence == 0 is still illegal because the primary has to increase the sequence before + /* + * NOTE: activationSequence == 0 is still illegal because the primary has to increase the sequence before * replicating. */ stopForcedFailoverAfterDelay(); 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 502aac86ee5..9d683d7c825 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 @@ -57,8 +57,8 @@ import static org.apache.activemq.artemis.core.server.impl.quorum.ActivationSequenceStateMachine.tryActivate; /** - * This is going to be {@link #run()} just by natural born primary, at the first start. - * Both during a failover or a failback, {@link #run()} isn't going to be used, but only {@link #getActivationChannelHandler(Channel, Acceptor)}. + * This is going to be {@link #run()} just by natural born primary, at the first start. Both during a failover or a + * failback, {@link #run()} isn't going to be used, but only {@link #getActivationChannelHandler(Channel, Acceptor)}. */ public class ReplicationPrimaryActivation extends PrimaryActivation implements DistributedLock.UnavailableLockListener { @@ -272,8 +272,8 @@ private void replicate(final ReplicationManager replicationManager, } /** - * This is handling awaiting backup announcement before trying to failover. - * This broker is an active backup broker ready to restart as passive. + * This is handling awaiting backup announcement before trying to failover. This broker is an active backup broker + * ready to restart as passive. */ private void awaitBackupAnnouncementOnFailbackRequest(ClusterConnection clusterConnection) throws Exception { final String nodeID = activeMQServer.getNodeID().toString(); 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 3edfe8ce9f8..3898248a0c8 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 @@ -52,7 +52,7 @@ public class RoutingContextImpl implements RoutingContext { // if we wanted to bypass the load balancing configured elsewhere private MessageLoadBalancingType loadBalancingType; - /* To be set by the Mirror target on the server, to avoid ping pongs or reflections of messages between mirrors */ + // To be set by the Mirror target on the server, to avoid ping pongs or reflections of messages between mirrors private MirrorController mirrorControllerSource; private RoutingType routingType; 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 c89450faa92..2ffe947afbc 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 @@ -269,7 +269,8 @@ private long scaleDownSNF(final SimpleString address, MessageReference messageRef = messagesIterator.next(); Message message = messageRef.getMessage().copy(); - /* Here we are taking messages out of a store-and-forward queue and sending them to the corresponding + /* + * Here we are taking messages out of a store-and-forward queue and sending them to the corresponding * address on the scale-down target server. However, we have to take the existing _AMQ_ROUTE_TOsf.* * property and put its value into the _AMQ_ROUTE_TO property so the message is routed properly. */ @@ -419,7 +420,6 @@ public void scaleDownDuplicateIDs(Map>> du String password) throws Exception { try (ClientSession session = sessionFactory.createSession(user, password, true, false, false, false, 0); ClientProducer producer = session.createProducer(managementAddress)) { - //todo - https://issues.jboss.org/browse/HORNETQ-1336 for (Map.Entry>> entry : duplicateIDMap.entrySet()) { ClientMessage message = session.createMessage(false); List> list = entry.getValue(); @@ -435,9 +435,9 @@ public void scaleDownDuplicateIDs(Map>> du } /** - * Get the ID of the queues involved so the message can be routed properly. This is done because we cannot - * send directly to a queue, we have to send to an address instead but not all the queues related to the - * address may need the message + * Get the ID of the queues involved so the message can be routed properly. This is done because we cannot send + * directly to a queue, we have to send to an address instead but not all the queues related to the address may need + * the message */ private long createQueueWithRoutingTypeIfNecessaryAndGetID(ClientSession session, Queue queue, @@ -516,8 +516,7 @@ private void ackMessageOnQueue(Transaction tx, Queue queue, MessageReference mes } /** - * this class will control iterations while - * looking over for messages relations + * this class will control iterations while looking over for messages relations */ private class QueuesXRefInnerManager { 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 685e6182a14..d8b76a8b075 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 @@ -85,7 +85,6 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - private final long id; private final long sequentialID; @@ -129,8 +128,8 @@ public String debug() { } /** - * if we are a browse only consumer we don't need to worry about acknowledgements or being - * started/stopped by the session. + * if we are a browse only consumer we don't need to worry about acknowledgements or being started/stopped by the + * session. */ private final boolean browseOnly; @@ -397,10 +396,6 @@ public List getDeliveringMessages() { } } - /** i - * - * @see SessionCallback#supportsDirectDelivery() - */ @Override public boolean supportsDirectDelivery() { return callback.supportsDirectDelivery(); @@ -612,7 +607,6 @@ public synchronized void close(final boolean failed) throws Exception { props.putIntProperty(ManagementHelper.HDR_CONSUMER_COUNT, messageQueue.getConsumerCount()); - // HORNETQ-946 props.putSimpleStringProperty(ManagementHelper.HDR_USER, SimpleString.of(session.getUsername())); props.putSimpleStringProperty(ManagementHelper.HDR_REMOTE_ADDRESS, SimpleString.of(session.getRemotingConnection().getRemoteAddress())); @@ -672,8 +666,8 @@ public void removeItself() throws Exception { /** * Prompt delivery and send a "forced delivery" message to the consumer. *

                    - * When the consumer receives such a "forced delivery" message, it discards it and knows that - * there are no other messages to be delivered. + * When the consumer receives such a "forced delivery" message, it discards it and knows that there are no other + * messages to be delivered. */ @Override public void forceDelivery(final long sequence) { @@ -693,7 +687,7 @@ public void forceDelivery(final long sequence) { public synchronized void forceDelivery(final long sequence, final Runnable r) { promptDelivery(); - // JBPAPP-6030 - Using the executor to avoid distributed dead locks + // Using the executor to avoid distributed dead locks messageQueue.getExecutor().execute(() -> { try { // We execute this on the same executor to make sure the force delivery message is written after @@ -863,11 +857,11 @@ public Queue getQueue() { } /** - * Remove references based on the protocolData. - * there will be an interval defined between protocolDataStart and protocolDataEnd. - * This method will fetch the delivering references, remove them from the delivering list and return a list. - * - * This will be useful for other protocols that will need this such as openWire or MQTT. + * Remove references based on the protocolData. There will be an interval defined between protocolDataStart and + * protocolDataEnd. This method will fetch the delivering references, remove them from the delivering list and return + * a list. + *

                    + * This will be useful for other protocols that will need this such as OpenWire or MQTT. */ @Override public synchronized List scanDeliveringReferences(boolean remove, @@ -1145,9 +1139,6 @@ public AtomicInteger getAvailableCredits() { return availableCredits; } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { return "ServerConsumerImpl [id=" + id + ", filter=" + filter + ", binding=" + binding + ", closed=" + isClosed + "]"; @@ -1223,7 +1214,7 @@ private void deliverStandardMessage(final MessageReference ref) { } private void applyPrefixForLegacyConsumer(Message message) { - /** + /* * check to see if: * 1) This is a "core" connection * 2) The "core" connection belongs to a JMS client @@ -1261,8 +1252,8 @@ public void setPreAcknowledge(boolean preAcknowledge) { } /** - * Internal encapsulation of the logic on sending LargeMessages. - * This Inner class was created to avoid a bunch of loose properties about the current LargeMessage being sent + * Internal encapsulation of the logic on sending LargeMessages. This Inner class was created to avoid a bunch of + * loose properties about the current LargeMessage being sent */ private final class CoreLargeMessageDeliverer { @@ -1621,8 +1612,9 @@ public SessionCallback getCallback() { static class ServerConsumerMetrics extends TransactionOperationAbstract { /** - * Since messages can be delivered (incremented) and acknowledged (decremented) at the same time we have to protect - * the encode size and make it atomic. The other fields are ok since they are only accessed from a single thread. + * Since messages can be delivered (incremented) and acknowledged (decremented) at the same time we have to + * protect the encode size and make it atomic. The other fields are ok since they are only accessed from a single + * thread. */ private static final AtomicLongFieldUpdater messagesInTransitSizeUpdater = AtomicLongFieldUpdater.newUpdater(ServerConsumerMetrics.class, "messagesInTransitSize"); 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 a543e766709..46b29a6519c 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 @@ -149,8 +149,10 @@ public class ServerSessionImpl implements ServerSession, FailureListener { protected volatile Transaction tx; - /** This will store the Transaction between xaEnd and xaPrepare or xaCommit. - * in a failure scenario (client is gone), this will be held between xaEnd and xaCommit. */ + /** + * This will store the Transaction between xaEnd and xaPrepare or xaCommit. In a failure scenario (client is gone), + * this will be held between xaEnd and xaCommit. + */ protected volatile Transaction pendingTX; protected boolean xa; @@ -337,9 +339,6 @@ public boolean isClosed() { return closed; } - /** - * @return the sessionContext - */ @Override public OperationContext getSessionContext() { return context; @@ -437,7 +436,6 @@ protected void doClose(final boolean failed) throws Exception { } //putting closing of consumers outside the sync block - //https://issues.jboss.org/browse/HORNETQ-1141 Set consumersClone = new HashSet<>(consumers.values()); for (ServerConsumer consumer : consumersClone) { @@ -608,7 +606,6 @@ public ServerConsumer createConsumer(final long consumerID, props.putIntProperty(ManagementHelper.HDR_CONSUMER_COUNT, theQueue.getConsumerCount()); - // HORNETQ-946 props.putSimpleStringProperty(ManagementHelper.HDR_USER, SimpleString.of(username)); props.putSimpleStringProperty(ManagementHelper.HDR_VALIDATED_USER, SimpleString.of(validatedUser)); @@ -649,9 +646,8 @@ public ServerConsumer createConsumer(final long consumerID, } /** - * Some protocols may chose to hold their transactions outside of the ServerSession. - * This can be used to replace the transaction. - * Notice that we set autoCommitACK and autoCommitSends to true if tx == null + * Some protocols may chose to hold their transactions outside of the ServerSession. This can be used to replace the + * transaction. Notice that we set autoCommitACK and autoCommitSends to true if tx == null */ @Override public synchronized void resetTX(Transaction transaction) { @@ -1260,9 +1256,8 @@ public List acknowledge(final long consumerID, final long messageID) throw List ackedRefs = null; if (tx != null && tx.getState() == State.ROLLEDBACK) { - // JBPAPP-8845 - if we let stuff to be acked on a rolled back TX, we will just - // have these messages to be stuck on the limbo until the server is restarted - // The tx has already timed out, so we need to ack and rollback immediately + // If we let stuff to be acked on a rolled back TX, we will just have these messages to be stuck on the limbo + // until the server is restarted. The tx has already timed out, so we need to ack and rollback immediately. Transaction newTX = newTransaction(); try { ackedRefs = consumer.acknowledge(newTX, messageID); @@ -1305,9 +1300,8 @@ public void individualAcknowledge(final long consumerID, final long messageID) t ServerConsumer consumer = findConsumer(consumerID); if (tx != null && tx.getState() == State.ROLLEDBACK) { - // JBPAPP-8845 - if we let stuff to be acked on a rolled back TX, we will just - // have these messages to be stuck on the limbo until the server is restarted - // The tx has already timed out, so we need to ack and rollback immediately + // If we let stuff to be acked on a rolled back TX, we will just have these messages to be stuck on the limbo + // until the server is restarted. The tx has already timed out, so we need to ack and rollback immediately. Transaction newTX = newTransaction(); consumer.individualAcknowledge(tx, messageID); newTX.rollback(); @@ -1360,9 +1354,8 @@ public void rollback(final boolean considerLastMessageAsDelivered) throws Except } /** - * @param clientFailed If the client has failed, we can't decrease the delivery-counts, and the close may issue a rollback - * @param considerLastMessageAsDelivered - * @throws Exception + * @param clientFailed If the client has failed, we can't decrease the delivery-counts, and the close may issue a + * rollback */ private synchronized void rollback(final boolean clientFailed, final boolean considerLastMessageAsDelivered) throws Exception { @@ -1381,18 +1374,11 @@ private synchronized void rollback(final boolean clientFailed, } } - /** - * @return - */ @Override public Transaction newTransaction() { return new TransactionImpl(null, storageManager, timeoutSeconds); } - /** - * @param xid - * @return - */ private Transaction newTransaction(final Xid xid) { return new TransactionImpl(xid, storageManager, timeoutSeconds); } @@ -1566,9 +1552,8 @@ public synchronized void xaRollback(final Xid xid) throws Exception { logger.trace("xarollback into {}, xid={} forcing a rollback regular", theTx, xid); try { - // jbpapp-8845 - // This could have happened because the TX timed out, - // at this point we would be better on rolling back this session as a way to prevent consumers from holding their messages + // This could have happened because the TX timed out, at this point we would be better on rolling back + // this session as a way to prevent consumers from holding their messages this.rollback(false); } catch (Exception e) { ActiveMQServerLogger.LOGGER.unableToRollbackOnTxTimedOut(e); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServiceRegistryImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServiceRegistryImpl.java index cd89a82e221..504d0b557bf 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServiceRegistryImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServiceRegistryImpl.java @@ -49,7 +49,8 @@ public class ServiceRegistryImpl implements ServiceRegistry { private ScheduledExecutorService scheduledExecutorService; - /* We are using a List rather than HashMap here as ActiveMQ Artemis allows multiple instances of the same class to be added + /* + * We are using a List rather than HashMap here as ActiveMQ Artemis allows multiple instances of the same class to be added * to the interceptor list */ private List incomingInterceptors; 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 05af7114133..04983357581 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 @@ -216,19 +216,16 @@ public void run() { } activeMQServer.getThreadPool().execute(endpointConnector); - /** - * Wait for a signal from the quorum manager. At this point if replication has been successful we can - * fail over or if there is an error trying to replicate (such as already replicating) we try the - * process again on the next primary server. All the action happens inside {@link BackupQuorum} + /* + * Wait for a signal from the quorum manager. At this point if replication has been successful we can fail + * over or if there is an error trying to replicate (such as already replicating) we try the process again + * on the next primary server. All the action happens inside {@link BackupQuorum} */ signal = backupQuorum.waitForStatusChange(); logger.trace("Got a signal {} through backupQuorum.waitForStatusChange()", signal); - /** - * replicationEndpoint will be holding lots of open files. Make sure they get - * closed/sync'ed. - */ + // replicationEndpoint will be holding lots of open files. Make sure they get closed/sync'ed. ActiveMQServerImpl.stopComponent(replicationEndpoint); // time to give up if (!activeMQServer.isStarted() || signal == STOP) { @@ -403,11 +400,8 @@ public void haStarted() { /** * Wait for backup synchronization when using synchronization * - * @param timeout - * @param unit - * @return {@code true} if the server was already initialized or if it was initialized within the - * timeout period, {@code false} otherwise. - * @throws InterruptedException + * @return {@code true} if the server was already initialized or if it was initialized within the timeout period, + * {@code false} otherwise. * @see java.util.concurrent.CountDownLatch#await(long, TimeUnit) */ public boolean waitForBackupSync(long timeout, TimeUnit unit) throws InterruptedException { @@ -430,13 +424,12 @@ public ReplicationEndpoint getReplicationEndpoint() { } /** - * Whether a remote backup server was in sync with its primary server. If it was not in sync, it may - * not take over the primary's functions. + * Whether a remote backup server was in sync with its primary server. If it was not in sync, it may not take over + * the primary's functions. *

                    * A local backup server or a primary server should always return {@code true} * - * @return whether the backup is up-to-date, if the server is not a backup it always returns - * {@code true}. + * @return whether the backup is up-to-date, if the server is not a backup it always returns {@code true}. */ public boolean isRemoteBackupUpToDate() { return backupUpToDate; @@ -455,9 +448,6 @@ public void onRemoteBackupUpToDate(String nodeId, long ignoredActivationSequence backupSyncLatch.countDown(); } - /** - * @throws ActiveMQException - */ @Override public void onPrimaryStopping(ReplicationPrimaryIsStoppingMessage.PrimaryStopping finalMessage) throws ActiveMQException { if (logger.isTraceEnabled()) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingPrimaryActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingPrimaryActivation.java index 6f56c7cf3a0..8a8848a102a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingPrimaryActivation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingPrimaryActivation.java @@ -293,8 +293,6 @@ private Pair getPair(TransportCo * Determines whether there is another server already running with this server's nodeID. *

                    * This can happen in case of a successful fail-over followed by the primary's restart (attempting a fail-back). - * - * @throws Exception */ private boolean isNodeIdUsed() throws Exception { if (activeMQServer.getConfiguration().getClusterConfigurations().isEmpty()) @@ -408,14 +406,11 @@ public void nodeUP(TopologyMember topologyMember, boolean last) { } /** - * In a cluster of replicated primary/backup pairs if a backup crashes and then its primary crashes the cluster will - * retain the topology information of the primary such that when the primary server restarts it will check the - * cluster to see if its nodeID is present (which it will be) and then it will activate as a backup rather than - * a primary. To prevent this situation an additional check is necessary to see if the server with the matching - * nodeID is actually active or not which is done by attempting to make a connection to it. - * - * @param transportConfiguration - * @return + * In a cluster of replicated primary/backup pairs if a backup crashes and then its primary crashes the cluster + * will retain the topology information of the primary such that when the primary server restarts it will check + * the cluster to see if its nodeID is present (which it will be) and then it will activate as a backup rather + * than a primary. To prevent this situation an additional check is necessary to see if the server with the + * matching nodeID is actually active or not which is done by attempting to make a connection to it. */ private boolean isActive(TransportConfiguration transportConfiguration) { boolean result = false; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SimpleMessageGroups.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SimpleMessageGroups.java index a789709f72c..293706295f3 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SimpleMessageGroups.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SimpleMessageGroups.java @@ -19,8 +19,9 @@ import java.util.HashMap; /** - * Implementation of MessageGroups that simply uses a HashMap, this is the existing and default behaviour of message groups in artemis. - * + * Implementation of MessageGroups that simply uses a HashMap, this is the existing and default behaviour of message + * groups in artemis. + *

                    * Effectively every Group Id is mapped raw, it also is unbounded. * * @param the value type. 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 523df099437..c5e4c1c6b0d 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 @@ -27,7 +27,8 @@ import java.lang.invoke.MethodHandles; /** - * Default implementation of a {@link ScheduledLeaseLock}: see {@link ScheduledLeaseLock#of(ScheduledExecutorService, ArtemisExecutor, String, LeaseLock, long, LockListener)}. + * Default implementation of a {@link ScheduledLeaseLock}: see + * {@link ScheduledLeaseLock#of(ScheduledExecutorService, ArtemisExecutor, String, LeaseLock, long, LockListener)}. */ final class ActiveMQScheduledLeaseLock extends ActiveMQScheduledComponent implements ScheduledLeaseLock { 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 26b8da3ec14..598e837db5d 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 @@ -55,8 +55,8 @@ class JdbcLeaseLock implements LeaseLock { private long allowedTimeDiff; /** - * The lock will be responsible (ie {@link #close()}) of all the {@link PreparedStatement}s used by it, but not of the {@link Connection}, - * whose life cycle will be managed externally. + * The lock will be responsible (ie {@link #close()}) of all the {@link PreparedStatement}s used by it, but not of + * the {@link Connection}, whose life cycle will be managed externally. */ JdbcLeaseLock(String holderId, JDBCConnectionProvider connectionProvider, @@ -103,8 +103,8 @@ public String holderId() { /** * Given that many DBMS won't support standard SQL queries to collect CURRENT_TIMESTAMP at milliseconds granularity, - * this value is stripped of the milliseconds part, making it less optimistic then the reality, if >= 0.

                    - * It's commonly used as an hard deadline for JDBC operations, hence is fine to not have a high precision. + * this value is stripped of the milliseconds part, making it less optimistic then the reality, if >= 0.

                    It's + * commonly used as an hard deadline for JDBC operations, hence is fine to not have a high precision. */ @Override public long localExpirationTime() { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/LeaseLock.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/LeaseLock.java index 35624471fb9..11ce4771d14 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/LeaseLock.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/LeaseLock.java @@ -75,17 +75,17 @@ default boolean renew() { } /** - * Not reentrant lock acquisition operation. - * The lock can be acquired if is not held by anyone (including the caller) or has an expired ownership. + * Not reentrant lock acquisition operation. The lock can be acquired if is not held by anyone (including the caller) + * or has an expired ownership. * * @return {@code true} if has been acquired, {@code false} otherwise */ boolean tryAcquire(); /** - * Not reentrant lock acquisition operation (ie {@link #tryAcquire()}). - * It tries to acquire the lock until will succeed (ie {@link AcquireResult#Done})or got interrupted (ie {@link AcquireResult#Exit}). - * After each failed attempt is performed a {@link Pauser#idle} call. + * Not reentrant lock acquisition operation (ie {@link #tryAcquire()}). It tries to acquire the lock until will + * succeed (ie {@link AcquireResult#Done})or got interrupted (ie {@link AcquireResult#Exit}). After each failed + * attempt is performed a {@link Pauser#idle} call. */ default AcquireResult tryAcquire(ExitCondition exitCondition, Pauser pauser) { while (exitCondition.keepRunning()) { @@ -99,11 +99,10 @@ default AcquireResult tryAcquire(ExitCondition exitCondition, Pauser pauser) { } /** - * Not reentrant lock acquisition operation (ie {@link #tryAcquire()}). - * It tries to acquire the lock until will succeed (ie {@link AcquireResult#Done}), got interrupted (ie {@link AcquireResult#Exit}) - * or exceed {@code tryAcquireTimeoutMillis}. - * After each failed attempt is performed a {@link Pauser#idle} call. - * If the specified timeout is <=0 then it behaves as {@link #tryAcquire(ExitCondition, Pauser)}. + * Not reentrant lock acquisition operation (ie {@link #tryAcquire()}). It tries to acquire the lock until will + * succeed (ie {@link AcquireResult#Done}), got interrupted (ie {@link AcquireResult#Exit}) or exceed + * {@code tryAcquireTimeoutMillis}. After each failed attempt is performed a {@link Pauser#idle} call. If the + * specified timeout is <=0 then it behaves as {@link #tryAcquire(ExitCondition, Pauser)}. */ default AcquireResult tryAcquire(long tryAcquireTimeoutMillis, Pauser pauser, ExitCondition exitCondition) { if (tryAcquireTimeoutMillis < 0) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/ScheduledLeaseLock.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/ScheduledLeaseLock.java index db298dde8d0..b49cc726232 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/ScheduledLeaseLock.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/ScheduledLeaseLock.java @@ -23,7 +23,8 @@ import org.apache.activemq.artemis.utils.actors.ArtemisExecutor; /** - * {@link LeaseLock} holder that allows to schedule a {@link LeaseLock#renew} task with a fixed {@link #renewPeriodMillis()} delay. + * {@link LeaseLock} holder that allows to schedule a {@link LeaseLock#renew} task with a fixed + * {@link #renewPeriodMillis()} delay. */ interface ScheduledLeaseLock extends ActiveMQComponent { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/SharedStateManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/SharedStateManager.java index f5b2ab7ac66..34bcaabf835 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/SharedStateManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/SharedStateManager.java @@ -21,7 +21,8 @@ import org.apache.activemq.artemis.utils.UUID; /** - * Facade to abstract the operations on the shared state (inter-process and/or inter-thread) necessary to coordinate broker nodes. + * Facade to abstract the operations on the shared state (inter-process and/or inter-thread) necessary to coordinate + * broker nodes. */ interface SharedStateManager extends AutoCloseable { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/quorum/ActivationSequenceStateMachine.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/quorum/ActivationSequenceStateMachine.java index 9b397103391..09375291c33 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/quorum/ActivationSequenceStateMachine.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/quorum/ActivationSequenceStateMachine.java @@ -31,10 +31,9 @@ import org.slf4j.Logger; /** - * This class contains the activation sequence logic of the pluggable lock manager: - * it should be used by {@link org.apache.activemq.artemis.core.server.impl.ReplicationBackupActivation} - * and {@link org.apache.activemq.artemis.core.server.impl.ReplicationPrimaryActivation} to coordinate - * for replication. + * This class contains the activation sequence logic of the pluggable lock manager: it should be used by + * {@link org.apache.activemq.artemis.core.server.impl.ReplicationBackupActivation} and + * {@link org.apache.activemq.artemis.core.server.impl.ReplicationPrimaryActivation} to coordinate for replication. */ public final class ActivationSequenceStateMachine { @@ -46,18 +45,17 @@ private ActivationSequenceStateMachine() { } /** - * It loops if the data of the broker is still valuable, but cannot become active. - * It loops (temporarily) if data is in sync or can auto-repair, but cannot yet acquire the primary lock. + * It loops if the data of the broker is still valuable, but cannot become active. It loops (temporarily) if data is + * in sync or can auto-repair, but cannot yet acquire the primary lock. *

                    * It stops loop and return: - *

                      + *
                        *
                      • {@code null}: if data is stale (and there are no rights to become active) *
                      • {@code !=null}: if data is in sync/repaired and the {@link DistributedLock} is correctly acquired - *

                      - *

                      + *

                    * After successfully returning from this method ie not null return value, a broker should use - * {@link #ensureSequentialAccessToNodeData} to complete - * the activation and guarantee the initial not-replicated ownership of data. + * {@link #ensureSequentialAccessToNodeData} to complete the activation and guarantee the initial not-replicated + * ownership of data. */ public static DistributedLock tryActivate(final NodeManager nodeManager, final DistributedLockManager distributedManager, @@ -147,19 +145,19 @@ private static void repairActivationSequence(final NodeManager nodeManager, private enum ValidationResult { /** * coordinated activation sequence (claimed/committed) is far beyond the local one: data is not valuable anymore - **/ + */ Stale, /** * coordinated activation sequence is the same as local one: data is in sync - **/ + */ InSync, /** * next coordinated activation sequence is not committed yet: maybe data is in sync - **/ + */ MaybeInSync, /** * next coordinated activation sequence is not committed yet, but this broker can self-repair: data is in sync - **/ + */ SelfRepair } @@ -253,12 +251,12 @@ public static boolean awaitNextCommittedActivationSequence(final DistributedLock } /** - * This is going to increment the coordinated activation sequence and the local activation sequence - * (using {@link NodeManager#writeNodeActivationSequence}) while holding the primary lock, - * failing with some exception otherwise.
                    + * This is going to increment the coordinated activation sequence and the local activation sequence (using + * {@link NodeManager#writeNodeActivationSequence}) while holding the primary lock, failing with some exception + * otherwise. *

                    - * This must be used while holding a primary lock to ensure not-exclusive ownership of data ie can be both used - * while loosing connectivity with a replica or after successfully {@link #tryActivate}. + * This must be used while holding a primary lock to ensure not-exclusive ownership of data ie can be both used while + * loosing connectivity with a replica or after successfully {@link #tryActivate}. */ public static void ensureSequentialAccessToNodeData(final String serverDescription, final NodeManager nodeManager, 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 b275e8ed9cf..3904645ff94 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 @@ -132,12 +132,14 @@ public boolean canInvoke(String object, String operationName) { logger.debug("can't check invoke rights as object name invalid: {}", object, e); return false; } - /* HawtIO calls this with a null operationName as a coarse grained way of authenticating against all the operations - * on an mbean. Until this addition this was throwing a null pointer on operationName later in this call which was - * swallowed by HawtIO. Since fine grained checks are carried out against every operation this was never an issue - * however the new console based on HawtIO 4 passes this exception back to the console which breaks it. Since it is - * just an optimisation it is fine to always return true. Note that the alternative ArtemisRbacInvocationHandler - * does allow the ability to restrict a whole mbean */ + /* + * HawtIO calls this with a null operationName as a coarse grained way of authenticating against all the + * operations on an mbean. Until this addition this was throwing a null pointer on operationName later in this + * call which was swallowed by HawtIO. Since fine grained checks are carried out against every operation this was + * never an issue however the new console based on HawtIO 4 passes this exception back to the console which breaks + * it. Since it is just an optimisation it is fine to always return true. Note that the alternative + * ArtemisRbacInvocationHandler does allow the ability to restrict a whole mbean. + */ if (operationName == null || canBypassRBAC(objectName)) { return true; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ArtemisRbacInvocationHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ArtemisRbacInvocationHandler.java index a5a0600ef36..74157b1e04b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ArtemisRbacInvocationHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ArtemisRbacInvocationHandler.java @@ -1,20 +1,21 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *

                    - * http://www.apache.org/licenses/LICENSE-2.0 - *

                    - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.core.server.management; import javax.management.Attribute; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ConnectorServerFactory.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ConnectorServerFactory.java index 05ad2e6b9b1..d8cb06aa978 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ConnectorServerFactory.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ConnectorServerFactory.java @@ -179,8 +179,6 @@ public String getAuthenticatorType() { /** * Authenticator type to use. Acceptable values are "none", "password", and "certificate" - * - * @param value */ public void setAuthenticatorType(String value) { this.authenticatorType = AuthenticatorType.valueOf(value.toUpperCase()); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/JaasAuthenticator.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/JaasAuthenticator.java index 28d8ce7d0bf..04563086288 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/JaasAuthenticator.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/JaasAuthenticator.java @@ -45,9 +45,7 @@ public Subject authenticate(final Object credentials) throws SecurityException { try { LoginContext loginContext = new LoginContext(realm, subject, callbacks -> { - /* - * pull out the jmx credentials if they exist if not, guest login module will handle it - * */ + // pull out the jmx credentials if they exist if not, guest login module will handle it String[] params = null; if (credentials instanceof String[] strings && strings.length == 2) { params = strings; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/RmiRegistryFactory.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/RmiRegistryFactory.java index 2589204f77e..005476a2096 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/RmiRegistryFactory.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/RmiRegistryFactory.java @@ -37,16 +37,10 @@ public class RmiRegistryFactory { private String host; private HostLimitedServerSocketFactory socketFactory; - /** - * @return the port - */ public int getPort() { return port; } - /** - * @param port the port to set - */ public void setPort(int port) { this.port = port; } @@ -59,9 +53,6 @@ public void setHost(String host) { this.host = host; } - /** - * Create a server socket for testing purposes. - */ ServerSocket createTestSocket() throws IOException { return socketFactory.createServerSocket(0); } 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 f40bd43b7bb..31a53a3b0f9 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 @@ -49,20 +49,19 @@ public class HawtioSecurityControlImpl extends AbstractControl implements Hawtio /** * The Tabular Type returned by the {@link #canInvoke(Map)} operation. The rows consist of - * {@link #CAN_INVOKE_RESULT_ROW_TYPE} entries. - * It has a composite key with consists of the "ObjectName" and "Method" columns. + * {@link #CAN_INVOKE_RESULT_ROW_TYPE} entries. It has a composite key with consists of the "ObjectName" and "Method" + * columns. */ static final TabularType CAN_INVOKE_TABULAR_TYPE = SecurityMBeanOpenTypeInitializer.TABULAR_TYPE; /** - * A row as returned by the {@link #CAN_INVOKE_TABULAR_TYPE}. The columns of the row are defined - * by {@link #CAN_INVOKE_RESULT_COLUMNS}. + * A row as returned by the {@link #CAN_INVOKE_TABULAR_TYPE}. The columns of the row are defined by + * {@link #CAN_INVOKE_RESULT_COLUMNS}. */ static final CompositeType CAN_INVOKE_RESULT_ROW_TYPE = SecurityMBeanOpenTypeInitializer.ROW_TYPE; /** - * The columns contained in a {@link #CAN_INVOKE_RESULT_ROW_TYPE}. The data types for these columns are - * as follows: + * The columns contained in a {@link #CAN_INVOKE_RESULT_ROW_TYPE}. The data types for these columns are as follows: *

                      *
                    • "ObjectName" : {@link SimpleType#STRING}
                    • *
                    • "Method" : {@link SimpleType#STRING}
                    • 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 8fad753b3ad..7144e5eef59 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 @@ -702,7 +702,7 @@ public synchronized void start() throws Exception { messageCounterManager.start(); } - /** + /* * Ensure the management notification address is created otherwise if auto-create-address = false then cluster * bridges won't be able to connect. */ @@ -821,9 +821,8 @@ public void sendNotification(final Notification notification) throws Exception { } } - // start sending notification *messages* only when server has initialised - // Note at backup initialisation we don't want to send notifications either - // https://jira.jboss.org/jira/browse/HORNETQ-317 + // Start sending notification *messages* only when server has initialised. Note at backup initialisation we + // don't want to send notifications either. if (messagingServer == null || !messagingServer.isActive()) { logger.debug("ignoring message {} as the server is not initialized", notification); return; @@ -949,10 +948,9 @@ public Object invokeOperation(final String resourceName, } /** - * Correlate management responses using the Correlation ID Pattern, if the request supplied a correlation id, - * or fallback to the Message ID Pattern providing the request had a message id. - - * @param request + * Correlate management responses using the Correlation ID Pattern, if the request supplied a correlation id, or + * fallback to the Message ID Pattern providing the request had a message id. + * * @return correlation identify */ private Object getCorrelationIdentity(final Message request) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/metrics/NettyPooledAllocatorMetrics.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/metrics/NettyPooledAllocatorMetrics.java index 10bc4790a0c..dd9e0762cea 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/metrics/NettyPooledAllocatorMetrics.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/metrics/NettyPooledAllocatorMetrics.java @@ -114,9 +114,7 @@ private void metricsOfPoolArena(final MeterRegistry registry, final PoolArenaMetric poolArenaMetric, final int poolArenaIndex, final String poolArenaType) { - /** - * the number of thread caches backed by this arena. - */ + // the number of thread caches backed by this arena. final String poolArenaIndexString = Integer.toString(poolArenaIndex); Gauge.builder("netty.pooled.arena.threadcaches.num", poolArenaMetric, metric -> metric.numThreadCaches()) .tags(commonTags) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/mirror/MirrorController.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/mirror/MirrorController.java index b79646ea028..fb194cca6e1 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/mirror/MirrorController.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/mirror/MirrorController.java @@ -27,7 +27,7 @@ /** * This represents the contract we will use to send messages to replicas. - * */ + */ public interface MirrorController { default boolean isRetryACK() { return false; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerAddressPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerAddressPlugin.java index f15d6c61d4c..44bffe1375e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerAddressPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerAddressPlugin.java @@ -22,9 +22,6 @@ import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.server.impl.AddressInfo; -/** - * - */ public interface ActiveMQServerAddressPlugin extends ActiveMQServerBasePlugin { /** @@ -32,7 +29,6 @@ public interface ActiveMQServerAddressPlugin extends ActiveMQServerBasePlugin { * * @param addressInfo The addressInfo that will be added * @param reload If the address is being reloaded - * @throws ActiveMQException */ default void beforeAddAddress(AddressInfo addressInfo, boolean reload) throws ActiveMQException { @@ -43,7 +39,6 @@ default void beforeAddAddress(AddressInfo addressInfo, boolean reload) throws Ac * * @param addressInfo The newly added address * @param reload If the address is being reloaded - * @throws ActiveMQException */ default void afterAddAddress(AddressInfo addressInfo, boolean reload) throws ActiveMQException { @@ -55,7 +50,6 @@ default void afterAddAddress(AddressInfo addressInfo, boolean reload) throws Act * * @param address The existing address info that is about to be updated * @param routingTypes The new routing types that the address will be updated with - * @throws ActiveMQException */ default void beforeUpdateAddress(SimpleString address, EnumSet routingTypes) throws ActiveMQException { @@ -65,7 +59,6 @@ default void beforeUpdateAddress(SimpleString address, EnumSet rout * After an address has been updated * * @param addressInfo The newly updated address info - * @throws ActiveMQException */ default void afterUpdateAddress(AddressInfo addressInfo) throws ActiveMQException { @@ -75,7 +68,6 @@ default void afterUpdateAddress(AddressInfo addressInfo) throws ActiveMQExceptio * Before an address is removed * * @param address The address that will be removed - * @throws ActiveMQException */ default void beforeRemoveAddress(SimpleString address) throws ActiveMQException { @@ -86,7 +78,6 @@ default void beforeRemoveAddress(SimpleString address) throws ActiveMQException * * @param address The address that has been removed * @param addressInfo The address info that has been removed or null if not removed - * @throws ActiveMQException */ default void afterRemoveAddress(SimpleString address, AddressInfo addressInfo) throws ActiveMQException { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBasePlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBasePlugin.java index a37d028cce0..cc0483a3cee 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBasePlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBasePlugin.java @@ -19,9 +19,6 @@ import java.util.Map; import org.apache.activemq.artemis.core.server.ActiveMQServer; -/** - * - */ public interface ActiveMQServerBasePlugin { default void setInit(Map props) { @@ -30,8 +27,6 @@ default void setInit(Map props) { /** * used to pass configured properties to Plugin - * - * @param properties */ default void init(Map properties) { } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBindingPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBindingPlugin.java index 25eb96a53cb..13d2470ee42 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBindingPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBindingPlugin.java @@ -21,16 +21,10 @@ import org.apache.activemq.artemis.core.postoffice.Binding; import org.apache.activemq.artemis.core.transaction.Transaction; -/** - * - */ public interface ActiveMQServerBindingPlugin extends ActiveMQServerBasePlugin { /** * Before a binding is added - * - * @param binding - * @throws ActiveMQException */ default void beforeAddBinding(Binding binding) throws ActiveMQException { @@ -40,7 +34,6 @@ default void beforeAddBinding(Binding binding) throws ActiveMQException { * After a binding has been added * * @param binding The newly added binding - * @throws ActiveMQException */ default void afterAddBinding(Binding binding) throws ActiveMQException { @@ -48,11 +41,6 @@ default void afterAddBinding(Binding binding) throws ActiveMQException { /** * Before a binding is removed - * - * @param uniqueName - * @param tx - * @param deleteData - * @throws ActiveMQException */ default void beforeRemoveBinding(SimpleString uniqueName, Transaction tx, boolean deleteData) throws ActiveMQException { @@ -60,11 +48,6 @@ default void beforeRemoveBinding(SimpleString uniqueName, Transaction tx, boolea /** * After a binding is removed - * - * @param binding - * @param tx - * @param deleteData - * @throws ActiveMQException */ default void afterRemoveBinding(Binding binding, Transaction tx, boolean deleteData) throws ActiveMQException { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBridgePlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBridgePlugin.java index 67d35673ef2..c10a40a6d08 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBridgePlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerBridgePlugin.java @@ -22,16 +22,12 @@ import org.apache.activemq.artemis.core.server.MessageReference; import org.apache.activemq.artemis.core.server.cluster.Bridge; -/** - * - */ public interface ActiveMQServerBridgePlugin extends ActiveMQServerBasePlugin { /** * Before a bridge is deployed * * @param config The bridge configuration - * @throws ActiveMQException */ default void beforeDeployBridge(BridgeConfiguration config) throws ActiveMQException { @@ -41,7 +37,6 @@ default void beforeDeployBridge(BridgeConfiguration config) throws ActiveMQExcep * After a bridge has been deployed * * @param bridge The newly deployed bridge - * @throws ActiveMQException */ default void afterDeployBridge(Bridge bridge) throws ActiveMQException { @@ -49,23 +44,13 @@ default void afterDeployBridge(Bridge bridge) throws ActiveMQException { /** * Called immediately before a bridge delivers a message - * - * @param bridge - * @param ref - * @throws ActiveMQException */ default void beforeDeliverBridge(Bridge bridge, MessageReference ref) throws ActiveMQException { } /** - * Called immediately after a bridge delivers a message but before the message - * is acknowledged - * - * @param bridge - * @param ref - * @param status - * @throws ActiveMQException + * Called immediately after a bridge delivers a message but before the message is acknowledged */ default void afterDeliverBridge(Bridge bridge, MessageReference ref, HandleStatus status) throws ActiveMQException { @@ -73,10 +58,6 @@ default void afterDeliverBridge(Bridge bridge, MessageReference ref, HandleStatu /** * Called after delivered message over this bridge has been acknowledged by the remote broker - * - * @param bridge - * @param ref - * @throws ActiveMQException */ default void afterAcknowledgeBridge(Bridge bridge, MessageReference ref) throws ActiveMQException { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerConnectionPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerConnectionPlugin.java index 18685a95fc3..5e5f219a5cb 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerConnectionPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerConnectionPlugin.java @@ -19,18 +19,12 @@ import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -/** - * - */ public interface ActiveMQServerConnectionPlugin extends ActiveMQServerBasePlugin { - - /** * A connection has been created. * * @param connection The newly created connection - * @throws ActiveMQException */ default void afterCreateConnection(RemotingConnection connection) throws ActiveMQException { @@ -38,9 +32,6 @@ default void afterCreateConnection(RemotingConnection connection) throws ActiveM /** * A connection has been destroyed. - * - * @param connection - * @throws ActiveMQException */ default void afterDestroyConnection(RemotingConnection connection) throws ActiveMQException { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerConsumerPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerConsumerPlugin.java index 3d802da2918..656f1ad703f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerConsumerPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerConsumerPlugin.java @@ -21,20 +21,11 @@ import org.apache.activemq.artemis.core.postoffice.QueueBinding; import org.apache.activemq.artemis.core.server.ServerConsumer; -/** - * - */ public interface ActiveMQServerConsumerPlugin extends ActiveMQServerBasePlugin { /** * Before a consumer is created * - * @param consumerID - * @param queueName - * @param filterString - * @param browseOnly - * @param supportLargeMessage - * @throws ActiveMQException * * @deprecated use {@link #beforeCreateConsumer(long, QueueBinding, SimpleString, boolean, boolean)} */ @@ -46,15 +37,7 @@ default void beforeCreateConsumer(long consumerID, SimpleString queueName, Simpl /** - * * Before a consumer is created - * - * @param consumerID - * @param queueBinding - * @param filterString - * @param browseOnly - * @param supportLargeMessage - * @throws ActiveMQException */ default void beforeCreateConsumer(long consumerID, QueueBinding queueBinding, SimpleString filterString, boolean browseOnly, boolean supportLargeMessage) throws ActiveMQException { @@ -66,7 +49,6 @@ default void beforeCreateConsumer(long consumerID, QueueBinding queueBinding, Si * After a consumer has been created * * @param consumer the created consumer - * @throws ActiveMQException */ default void afterCreateConsumer(ServerConsumer consumer) throws ActiveMQException { @@ -74,10 +56,6 @@ default void afterCreateConsumer(ServerConsumer consumer) throws ActiveMQExcepti /** * Before a consumer is closed - * - * @param consumer - * @param failed - * @throws ActiveMQException */ default void beforeCloseConsumer(ServerConsumer consumer, boolean failed) throws ActiveMQException { @@ -85,10 +63,6 @@ default void beforeCloseConsumer(ServerConsumer consumer, boolean failed) throws /** * After a consumer is closed - * - * @param consumer - * @param failed - * @throws ActiveMQException */ default void afterCloseConsumer(ServerConsumer consumer, boolean failed) throws ActiveMQException { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerCriticalPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerCriticalPlugin.java index 99d877b4bf4..562e924cd2d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerCriticalPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerCriticalPlugin.java @@ -19,16 +19,11 @@ import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.utils.critical.CriticalComponent; -/** - * - */ public interface ActiveMQServerCriticalPlugin extends ActiveMQServerBasePlugin { /** * A Critical failure has been detected. * This will be called before the broker is stopped - * @param components - * @throws ActiveMQException */ default void criticalFailure(CriticalComponent components) throws ActiveMQException { } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerFederationPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerFederationPlugin.java index a562c1d1fcf..052c98c1b7d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerFederationPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerFederationPlugin.java @@ -30,9 +30,6 @@ public interface ActiveMQServerFederationPlugin extends ActiveMQServerBasePlugin /** * After a federation stream has been started - * - * @param stream - * @throws ActiveMQException */ default void federationStreamStarted(final FederationStream stream) throws ActiveMQException { @@ -40,9 +37,6 @@ default void federationStreamStarted(final FederationStream stream) throws Activ /** * After a federation stream has been stopped - * - * @param stream - * @throws ActiveMQException */ default void federationStreamStopped(final FederationStream stream) throws ActiveMQException { @@ -50,9 +44,6 @@ default void federationStreamStopped(final FederationStream stream) throws Activ /** * Before a federated queue consumer is created - * - * @param key - * @throws ActiveMQException */ default void beforeCreateFederatedQueueConsumer(final FederatedConsumerKey key) throws ActiveMQException { @@ -60,9 +51,6 @@ default void beforeCreateFederatedQueueConsumer(final FederatedConsumerKey key) /** * After a federated queue consumer is created - * - * @param consumer - * @throws ActiveMQException */ default void afterCreateFederatedQueueConsumer(final FederatedQueueConsumer consumer) throws ActiveMQException { @@ -70,9 +58,6 @@ default void afterCreateFederatedQueueConsumer(final FederatedQueueConsumer cons /** * Before a federated queue consumer is closed - * - * @param consumer - * @throws ActiveMQException */ default void beforeCloseFederatedQueueConsumer(final FederatedQueueConsumer consumer) throws ActiveMQException { @@ -80,9 +65,6 @@ default void beforeCloseFederatedQueueConsumer(final FederatedQueueConsumer cons /** * After a federated queue consumer is closed - * - * @param consumer - * @throws ActiveMQException */ default void afterCloseFederatedQueueConsumer(final FederatedQueueConsumer consumer) throws ActiveMQException { @@ -90,10 +72,6 @@ default void afterCloseFederatedQueueConsumer(final FederatedQueueConsumer consu /** * Before a federated queue consumer handles a message - * - * @param consumer - * @param message - * @throws ActiveMQException */ default void beforeFederatedQueueConsumerMessageHandled(final FederatedQueueConsumer consumer, Message message) throws ActiveMQException { @@ -101,10 +79,6 @@ default void beforeFederatedQueueConsumerMessageHandled(final FederatedQueueCons /** * After a federated queue consumer handles a message - * - * @param consumer - * @param message - * @throws ActiveMQException */ default void afterFederatedQueueConsumerMessageHandled(final FederatedQueueConsumer consumer, Message message) throws ActiveMQException { @@ -114,9 +88,7 @@ default void afterFederatedQueueConsumerMessageHandled(final FederatedQueueConsu * Conditionally create a federated queue consumer for a federated address. This allows custom * logic to be inserted to decide when to create federated queue consumers * - * @param queue - * @return if true, create the consumer, else if false don't create - * @throws ActiveMQException + * @return if {@code true}, create the consumer, else if false don't create */ default boolean federatedAddressConditionalCreateConsumer(final Queue queue) throws ActiveMQException { return true; @@ -130,9 +102,7 @@ default boolean federatedAddressConditionalCreateDivertConsumer(DivertBinding di * Conditionally create a federated queue consumer for a federated queue. This allows custom * logic to be inserted to decide when to create federated queue consumers * - * @param consumer - * @return true, create the consumer, else if false don't create - * @throws ActiveMQException + * @return {@code true}, create the consumer, else if false don't create */ default boolean federatedQueueConditionalCreateConsumer(final ServerConsumer consumer) throws ActiveMQException { return true; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerMessagePlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerMessagePlugin.java index dd4ff0115d0..29fdbe0a91c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerMessagePlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerMessagePlugin.java @@ -27,20 +27,12 @@ import org.apache.activemq.artemis.core.server.impl.AckReason; import org.apache.activemq.artemis.core.transaction.Transaction; -/** - * - */ public interface ActiveMQServerMessagePlugin extends ActiveMQServerBasePlugin { /** * Before a message is sent * * @param session the session that sends the message - * @param tx - * @param message - * @param direct - * @param noAutoCreateQueue - * @throws ActiveMQException */ default void beforeSend(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue) throws ActiveMQException { //by default call the old method for backwards compatibility @@ -51,12 +43,6 @@ default void beforeSend(ServerSession session, Transaction tx, Message message, * After a message is sent * * @param session the session that sends the message - * @param tx - * @param message - * @param direct - * @param noAutoCreateQueue - * @param result - * @throws ActiveMQException */ default void afterSend(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue, RoutingStatus result) throws ActiveMQException { @@ -67,13 +53,7 @@ default void afterSend(ServerSession session, Transaction tx, Message message, b /** * When there was an exception sending the message * - * @param session - * @param tx - * @param message - * @param direct - * @param noAutoCreateQueue * @param e the exception that occurred when sending the message - * @throws ActiveMQException */ default void onSendException(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue, Exception e) throws ActiveMQException { @@ -83,12 +63,6 @@ default void onSendException(ServerSession session, Transaction tx, Message mess /** * Before a message is sent * - * @param tx - * @param message - * @param direct - * @param noAutoCreateQueue - * @throws ActiveMQException - * * @deprecated use {@link #beforeSend(ServerSession, Transaction, Message, boolean, boolean)} */ @Deprecated @@ -99,13 +73,6 @@ default void beforeSend(Transaction tx, Message message, boolean direct, boolean /** * After a message is sent * - * @param tx - * @param message - * @param direct - * @param noAutoCreateQueue - * @param result - * @throws ActiveMQException - * * @deprecated use {@link #afterSend(ServerSession, Transaction, Message, boolean, boolean, RoutingStatus)} */ @Deprecated @@ -116,12 +83,6 @@ default void afterSend(Transaction tx, Message message, boolean direct, boolean /** * Before a message is routed - * - * @param message - * @param context - * @param direct - * @param rejectDuplicates - * @throws ActiveMQException */ default void beforeMessageRoute(Message message, RoutingContext context, boolean direct, boolean rejectDuplicates) throws ActiveMQException { @@ -129,13 +90,6 @@ default void beforeMessageRoute(Message message, RoutingContext context, boolean /** * After a message is routed - * - * @param message - * @param context - * @param direct - * @param rejectDuplicates - * @param result - * @throws ActiveMQException */ default void afterMessageRoute(Message message, RoutingContext context, boolean direct, boolean rejectDuplicates, RoutingStatus result) throws ActiveMQException { @@ -145,12 +99,7 @@ default void afterMessageRoute(Message message, RoutingContext context, boolean /** * When there was an error routing the message * - * @param message - * @param context - * @param direct - * @param rejectDuplicates * @param e the exception that occurred during message routing - * @throws ActiveMQException */ default void onMessageRouteException(Message message, RoutingContext context, boolean direct, boolean rejectDuplicates, Exception e) throws ActiveMQException { @@ -162,7 +111,6 @@ default void onMessageRouteException(Message message, RoutingContext context, bo * * @param consumer the consumer the message will be delivered to * @param reference message reference - * @throws ActiveMQException */ default boolean canAccept(ServerConsumer consumer, MessageReference reference) throws ActiveMQException { return true; @@ -173,7 +121,6 @@ default boolean canAccept(ServerConsumer consumer, MessageReference reference) t * * @param consumer the consumer the message will be delivered to * @param reference message reference - * @throws ActiveMQException */ default void beforeDeliver(ServerConsumer consumer, MessageReference reference) throws ActiveMQException { //by default call the old method for backwards compatibility @@ -185,7 +132,6 @@ default void beforeDeliver(ServerConsumer consumer, MessageReference reference) * * @param consumer the consumer the message was delivered to * @param reference message reference - * @throws ActiveMQException */ default void afterDeliver(ServerConsumer consumer, MessageReference reference) throws ActiveMQException { //by default call the old method for backwards compatibility @@ -195,9 +141,6 @@ default void afterDeliver(ServerConsumer consumer, MessageReference reference) t /** * Before a message is delivered to a client consumer * - * @param reference - * @throws ActiveMQException - * * @deprecated use throws ActiveMQException {@link #beforeDeliver(ServerConsumer, MessageReference)} */ @Deprecated @@ -208,9 +151,6 @@ default void beforeDeliver(MessageReference reference) throws ActiveMQException /** * After a message is delivered to a client consumer * - * @param reference - * @throws ActiveMQException - * * @deprecated use {@link #afterDeliver(ServerConsumer, MessageReference)} */ @Deprecated @@ -221,10 +161,8 @@ default void afterDeliver(MessageReference reference) throws ActiveMQException { /** * A message has been expired * - * @param message The expired message + * @param message The expired message * @param messageExpiryAddress The message expiry address if exists - * @throws ActiveMQException - * * @deprecated use {@link #messageExpired(MessageReference, SimpleString, ServerConsumer)} */ @Deprecated @@ -235,11 +173,9 @@ default void messageExpired(MessageReference message, SimpleString messageExpiry /** * A message has been expired * - * @param message The expired message + * @param message The expired message * @param messageExpiryAddress The message expiry address if exists - * @param consumer the Consumer that acknowledged the message - this field is optional - * and can be null - * @throws ActiveMQException + * @param consumer the Consumer that acknowledged the message - this field is optional and can be null */ default void messageExpired(MessageReference message, SimpleString messageExpiryAddress, ServerConsumer consumer) throws ActiveMQException { messageExpired(message, messageExpiryAddress); @@ -248,10 +184,8 @@ default void messageExpired(MessageReference message, SimpleString messageExpiry /** * A message has been acknowledged * - * @param ref The acked message + * @param ref The acked message * @param reason The ack reason - * @throws ActiveMQException - * * @deprecated use {@link #messageAcknowledged(MessageReference, AckReason, ServerConsumer)} */ @Deprecated @@ -262,12 +196,9 @@ default void messageAcknowledged(MessageReference ref, AckReason reason) throws /** * A message has been acknowledged * - * @param ref The acked message - * @param reason The ack reason - * @param consumer the Consumer that acknowledged the message - this field is optional - * and can be null - * @throws ActiveMQException - * + * @param ref The acked message + * @param reason The ack reason + * @param consumer the Consumer that acknowledged the message - this field is optional and can be null */ @Deprecated default void messageAcknowledged(MessageReference ref, AckReason reason, ServerConsumer consumer) throws ActiveMQException { @@ -278,13 +209,10 @@ default void messageAcknowledged(MessageReference ref, AckReason reason, ServerC /** * A message has been acknowledged * - * @param tx The transaction associated with the ack - * @param ref The acked message - * @param reason The ack reason - * @param consumer the Consumer that acknowledged the message - this field is optional - * and can be null - * @throws ActiveMQException - * + * @param tx The transaction associated with the ack + * @param ref The acked message + * @param reason The ack reason + * @param consumer the Consumer that acknowledged the message - this field is optional and can be null */ default void messageAcknowledged(Transaction tx, MessageReference ref, AckReason reason, ServerConsumer consumer) throws ActiveMQException { //by default call the old method for backwards compatibility @@ -294,15 +222,14 @@ default void messageAcknowledged(Transaction tx, MessageReference ref, AckReason /** * A message has been moved * - * @param tx The transaction associated with the move - * @param ref The ref of the message moved - * @param reason The move reason + * @param tx The transaction associated with the move + * @param ref The ref of the message moved + * @param reason The move reason * @param destAddress the destination address for the move operation * @param destQueueID the destination queueID for the move operation - this field is optional and can be null - * @param consumer the consumer that moved the message - this field is optional and can be null - * @param newMessage the new message created by the move operation - * @param result routing status of the move operation - * @throws ActiveMQException + * @param consumer the consumer that moved the message - this field is optional and can be null + * @param newMessage the new message created by the move operation + * @param result routing status of the move operation */ default void messageMoved(final Transaction tx, final MessageReference ref, diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerPlugin.java index 9ddd8062ce9..ae064aa935e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerPlugin.java @@ -16,9 +16,6 @@ */ package org.apache.activemq.artemis.core.server.plugin; -/** - * - */ public interface ActiveMQServerPlugin extends ActiveMQServerBasePlugin, ActiveMQServerConnectionPlugin, diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerQueuePlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerQueuePlugin.java index 8b09d91e68b..6f2ddeceb25 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerQueuePlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerQueuePlugin.java @@ -23,16 +23,10 @@ import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.server.QueueConfig; -/** - * - */ public interface ActiveMQServerQueuePlugin extends ActiveMQServerBasePlugin { /** * Before a queue is created - * - * @param queueConfig - * @throws ActiveMQException */ default void beforeCreateQueue(QueueConfig queueConfig) throws ActiveMQException { @@ -40,9 +34,6 @@ default void beforeCreateQueue(QueueConfig queueConfig) throws ActiveMQException /** * Before a queue is created - * - * @param queueConfig - * @throws ActiveMQException */ default void beforeCreateQueue(QueueConfiguration queueConfig) throws ActiveMQException { //by default call the old method for backwards compatibility @@ -53,7 +44,6 @@ default void beforeCreateQueue(QueueConfiguration queueConfig) throws ActiveMQEx * After a queue has been created * * @param queue The newly created queue - * @throws ActiveMQException */ default void afterCreateQueue(Queue queue) throws ActiveMQException { @@ -62,12 +52,6 @@ default void afterCreateQueue(Queue queue) throws ActiveMQException { /** * Before a queue is destroyed * - * @param queueName - * @param session - * @param checkConsumerCount - * @param removeConsumers - * @param autoDeleteAddress - * @throws ActiveMQException * * @deprecated use {@link #beforeDestroyQueue(Queue, SecurityAuth, boolean, boolean, boolean)} */ @@ -79,13 +63,6 @@ default void beforeDestroyQueue(SimpleString queueName, final SecurityAuth sessi /** * Before a queue is destroyed - * - * @param queue - * @param session - * @param checkConsumerCount - * @param removeConsumers - * @param autoDeleteAddress - * @throws ActiveMQException */ default void beforeDestroyQueue(Queue queue, final SecurityAuth session, boolean checkConsumerCount, boolean removeConsumers, boolean autoDeleteAddress) throws ActiveMQException { @@ -95,14 +72,6 @@ default void beforeDestroyQueue(Queue queue, final SecurityAuth session, boolean /** * After a queue has been destroyed - * - * @param queue - * @param address - * @param session - * @param checkConsumerCount - * @param removeConsumers - * @param autoDeleteAddress - * @throws ActiveMQException */ default void afterDestroyQueue(Queue queue, SimpleString address, final SecurityAuth session, boolean checkConsumerCount, boolean removeConsumers, boolean autoDeleteAddress) throws ActiveMQException { @@ -111,14 +80,12 @@ default void afterDestroyQueue(Queue queue, SimpleString address, final Security /** * To be called before starting expiry scan on the queue - * @param queue */ default void beforeExpiryScan(Queue queue) { } /** * To be called before starting expiry scan on the queue - * @param queue */ default void afterExpiryScan(Queue queue) { } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerResourcePlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerResourcePlugin.java index 51b5ba1fc9b..c41d64f3c91 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerResourcePlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerResourcePlugin.java @@ -22,18 +22,10 @@ import org.apache.activemq.artemis.core.transaction.Transaction; import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; -/** - * - */ public interface ActiveMQServerResourcePlugin extends ActiveMQServerBasePlugin { /** * Before a transaction is put - * - * @param xid - * @param tx - * @param remotingConnection - * @throws ActiveMQException */ default void beforePutTransaction(Xid xid, Transaction tx, RemotingConnection remotingConnection) throws ActiveMQException { @@ -41,11 +33,6 @@ default void beforePutTransaction(Xid xid, Transaction tx, RemotingConnection re /** * After a transaction is put - * - * @param xid - * @param tx - * @param remotingConnection - * @throws ActiveMQException */ default void afterPutTransaction(Xid xid, Transaction tx, RemotingConnection remotingConnection) throws ActiveMQException { @@ -53,10 +40,6 @@ default void afterPutTransaction(Xid xid, Transaction tx, RemotingConnection rem /** * Before a transaction is removed - * - * @param xid - * @param remotingConnection - * @throws ActiveMQException */ default void beforeRemoveTransaction(Xid xid, RemotingConnection remotingConnection) throws ActiveMQException { @@ -64,10 +47,6 @@ default void beforeRemoveTransaction(Xid xid, RemotingConnection remotingConnect /** * After a transaction is removed - * - * @param xid - * @param remotingConnection - * @throws ActiveMQException */ default void afterRemoveTransaction(Xid xid, RemotingConnection remotingConnection) throws ActiveMQException { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerSessionPlugin.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerSessionPlugin.java index e1d24624546..f61a2dd18a5 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerSessionPlugin.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerSessionPlugin.java @@ -25,28 +25,10 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; import org.apache.activemq.artemis.spi.core.protocol.SessionCallback; -/** - * - */ public interface ActiveMQServerSessionPlugin extends ActiveMQServerBasePlugin { /** * Before a session is created. - * - * @param name - * @param username - * @param minLargeMessageSize - * @param connection - * @param autoCommitSends - * @param autoCommitAcks - * @param preAcknowledge - * @param xa - * @param defaultAddress - * @param callback - * @param autoCreateQueues - * @param context - * @param prefixes - * @throws ActiveMQException */ default void beforeCreateSession(String name, String username, int minLargeMessageSize, RemotingConnection connection, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, @@ -59,7 +41,6 @@ default void beforeCreateSession(String name, String username, int minLargeMessa * After a session has been created. * * @param session The newly created session - * @throws ActiveMQException */ default void afterCreateSession(ServerSession session) throws ActiveMQException { @@ -67,10 +48,6 @@ default void afterCreateSession(ServerSession session) throws ActiveMQException /** * Before a session is closed - * - * @param session - * @param failed - * @throws ActiveMQException */ default void beforeCloseSession(ServerSession session, boolean failed) throws ActiveMQException { @@ -78,10 +55,6 @@ default void beforeCloseSession(ServerSession session, boolean failed) throws Ac /** * After a session is closed - * - * @param session - * @param failed - * @throws ActiveMQException */ default void afterCloseSession(ServerSession session, boolean failed) throws ActiveMQException { @@ -89,11 +62,6 @@ default void afterCloseSession(ServerSession session, boolean failed) throws Act /** * Before session metadata is added to the session - * - * @param session - * @param key - * @param data - * @throws ActiveMQException */ default void beforeSessionMetadataAdded(ServerSession session, String key, String data) throws ActiveMQException { @@ -101,11 +69,6 @@ default void beforeSessionMetadataAdded(ServerSession session, String key, Strin /** * Called when adding session metadata fails because the metadata is a duplicate - * - * @param session - * @param key - * @param data - * @throws ActiveMQException */ default void duplicateSessionMetadataFailure(ServerSession session, String key, String data) throws ActiveMQException { @@ -113,11 +76,6 @@ default void duplicateSessionMetadataFailure(ServerSession session, String key, /** * After session metadata is added to the session - * - * @param session - * @param key - * @param data - * @throws ActiveMQException */ default void afterSessionMetadataAdded(ServerSession session, String key, String data) throws ActiveMQException { 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 8e8aee646f0..76c60d8d552 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 @@ -47,16 +47,16 @@ import java.lang.invoke.MethodHandles; /** - * plugin to log various events within the broker, configured with the following booleans - * - * LOG_CONNECTION_EVENTS - connections creation/destroy - * LOG_SESSION_EVENTS - sessions creation/close - * LOG_CONSUMER_EVENTS - consumers creation/close - * LOG_DELIVERING_EVENTS - messages delivered to consumer, acked by consumer - * LOG_SENDING_EVENTS - messaged is sent, message is routed - * LOG_INTERNAL_EVENTS - critical failures, bridge deployments, queue creation/destroyed, message expired + * plugin to log various events within the broker, configured with the following booleans: + *
                        + *
                      • {@code LOG_CONNECTION_EVENTS} - connections creation/destroy + *
                      • {@code LOG_SESSION_EVENTS} - sessions creation/close + *
                      • {@code LOG_CONSUMER_EVENTS} - consumers creation/close + *
                      • {@code LOG_DELIVERING_EVENTS} - messages delivered to consumer, acked by consumer + *
                      • {@code LOG_SENDING_EVENTS} - messaged is sent, message is routed + *
                      • {@code LOG_INTERNAL_EVENTS} - critical failures, bridge deployments, queue creation/destroyed, message expired + *
                      */ - public class LoggingActiveMQServerPlugin implements ActiveMQServerPlugin, Serializable { public static final String LOG_ALL_EVENTS = "LOG_ALL_EVENTS"; @@ -107,8 +107,6 @@ public boolean isLogInternalEvents() { /** * used to pass configured properties to Plugin - * - * @param properties */ @Override public void init(Map properties) { @@ -128,7 +126,6 @@ public void init(Map properties) { * A connection has been created. * * @param connection The newly created connection - * @throws ActiveMQException */ @Override public void afterCreateConnection(RemotingConnection connection) throws ActiveMQException { @@ -139,9 +136,6 @@ public void afterCreateConnection(RemotingConnection connection) throws ActiveMQ /** * A connection has been destroyed. - * - * @param connection - * @throws ActiveMQException */ @Override public void afterDestroyConnection(RemotingConnection connection) throws ActiveMQException { @@ -152,21 +146,6 @@ public void afterDestroyConnection(RemotingConnection connection) throws ActiveM /** * Before a session is created. - * - * @param name - * @param username - * @param minLargeMessageSize - * @param connection - * @param autoCommitSends - * @param autoCommitAcks - * @param preAcknowledge - * @param xa - * @param publicAddress - * @param callback - * @param autoCreateQueues - * @param context - * @param prefixes - * @throws ActiveMQException */ @Override public void beforeCreateSession(String name, @@ -193,7 +172,6 @@ public void beforeCreateSession(String name, * After a session has been created. * * @param session The newly created session - * @throws ActiveMQException */ @Override public void afterCreateSession(ServerSession session) throws ActiveMQException { @@ -218,10 +196,6 @@ private String getRemoteAddress(ServerSession session) { /** * Before a session is closed - * - * @param session - * @param failed - * @throws ActiveMQException */ @Override public void beforeCloseSession(ServerSession session, boolean failed) throws ActiveMQException { @@ -232,10 +206,6 @@ public void beforeCloseSession(ServerSession session, boolean failed) throws Act /** * After a session is closed - * - * @param session - * @param failed - * @throws ActiveMQException */ @Override public void afterCloseSession(ServerSession session, boolean failed) throws ActiveMQException { @@ -246,11 +216,6 @@ public void afterCloseSession(ServerSession session, boolean failed) throws Acti /** * Before session metadata is added to the session - * - * @param session - * @param key - * @param data - * @throws ActiveMQException */ @Override public void beforeSessionMetadataAdded(ServerSession session, String key, String data) throws ActiveMQException { @@ -261,11 +226,6 @@ public void beforeSessionMetadataAdded(ServerSession session, String key, String /** * After session metadata is added to the session - * - * @param session - * @param key - * @param data - * @throws ActiveMQException */ @Override public void afterSessionMetadataAdded(ServerSession session, String key, String data) throws ActiveMQException { @@ -281,13 +241,6 @@ public void afterSessionMetadataAdded(ServerSession session, String key, String /** * Before a consumer is created - * - * @param consumerID - * @param queueBinding - * @param filterString - * @param browseOnly - * @param supportLargeMessage - * @throws ActiveMQException */ @Override public void beforeCreateConsumer(long consumerID, @@ -306,7 +259,6 @@ public void beforeCreateConsumer(long consumerID, * After a consumer has been created * * @param consumer the created consumer - * @throws ActiveMQException */ @Override public void afterCreateConsumer(ServerConsumer consumer) throws ActiveMQException { @@ -319,10 +271,6 @@ public void afterCreateConsumer(ServerConsumer consumer) throws ActiveMQExceptio /** * Before a consumer is closed - * - * @param consumer - * @param failed - * @throws ActiveMQException */ @Override public void beforeCloseConsumer(ServerConsumer consumer, boolean failed) throws ActiveMQException { @@ -334,10 +282,6 @@ public void beforeCloseConsumer(ServerConsumer consumer, boolean failed) throws /** * After a consumer is closed - * - * @param consumer - * @param failed - * @throws ActiveMQException */ @Override public void afterCloseConsumer(ServerConsumer consumer, boolean failed) throws ActiveMQException { @@ -350,9 +294,6 @@ public void afterCloseConsumer(ServerConsumer consumer, boolean failed) throws A /** * Before a queue is created - * - * @param queueConfig - * @throws ActiveMQException */ @Override public void beforeCreateQueue(QueueConfiguration queueConfig) throws ActiveMQException { @@ -365,7 +306,6 @@ public void beforeCreateQueue(QueueConfiguration queueConfig) throws ActiveMQExc * After a queue has been created * * @param queue The newly created queue - * @throws ActiveMQException */ @Override public void afterCreateQueue(Queue queue) throws ActiveMQException { @@ -376,13 +316,6 @@ public void afterCreateQueue(Queue queue) throws ActiveMQException { /** * Before a queue is destroyed - * - * @param queueName - * @param session - * @param checkConsumerCount - * @param removeConsumers - * @param autoDeleteAddress - * @throws ActiveMQException */ @Override public void beforeDestroyQueue(SimpleString queueName, @@ -398,14 +331,6 @@ public void beforeDestroyQueue(SimpleString queueName, /** * After a queue has been destroyed - * - * @param queue - * @param address - * @param session - * @param checkConsumerCount - * @param removeConsumers - * @param autoDeleteAddress - * @throws ActiveMQException */ @Override public void afterDestroyQueue(Queue queue, @@ -424,12 +349,7 @@ public void afterDestroyQueue(Queue queue, /** * Before a message is sent * - * @param session the session that sends the message - * @param tx - * @param message - * @param direct - * @param noAutoCreateQueue - * @throws ActiveMQException + * @param session the session that sends the message */ @Override public void beforeSend(ServerSession session, @@ -445,14 +365,6 @@ public void beforeSend(ServerSession session, /** * After a message is sent - * - * @param session - * @param tx - * @param message - * @param direct - * @param noAutoCreateQueue - * @param result - * @throws ActiveMQException */ @Override public void afterSend(ServerSession session, @@ -514,12 +426,6 @@ public void onSendException(ServerSession session, /** * Before a message is routed - * - * @param message - * @param context - * @param direct - * @param rejectDuplicates - * @throws ActiveMQException */ @Override public void beforeMessageRoute(Message message, @@ -533,13 +439,6 @@ public void beforeMessageRoute(Message message, /** * After a message is routed - * - * @param message - * @param context - * @param direct - * @param rejectDuplicates - * @param result - * @throws ActiveMQException */ @Override public void afterMessageRoute(Message message, @@ -580,7 +479,6 @@ public void onMessageRouteException(Message message, * * @param consumer the consumer the message will be delivered to * @param reference message reference - * @throws ActiveMQException */ @Override public void beforeDeliver(ServerConsumer consumer, MessageReference reference) throws ActiveMQException { @@ -595,7 +493,6 @@ public void beforeDeliver(ServerConsumer consumer, MessageReference reference) t * * @param consumer the consumer the message was delivered to * @param reference message reference - * @throws ActiveMQException */ @Override public void afterDeliver(ServerConsumer consumer, MessageReference reference) throws ActiveMQException { @@ -631,7 +528,6 @@ public void messageExpired(MessageReference message, SimpleString messageExpiryA * @param ref The acked message * @param reason The ack reason * @param consumer The consumer acking the ref - * @throws ActiveMQException */ @Override public void messageAcknowledged(final Transaction tx, final MessageReference ref, final AckReason reason, final ServerConsumer consumer) throws ActiveMQException { @@ -671,7 +567,6 @@ private void logAck(Transaction tx, MessageReference ref) { * Before a bridge is deployed * * @param config The bridge configuration - * @throws ActiveMQException */ @Override public void beforeDeployBridge(BridgeConfiguration config) throws ActiveMQException { @@ -684,7 +579,6 @@ public void beforeDeployBridge(BridgeConfiguration config) throws ActiveMQExcept * After a bridge has been deployed * * @param bridge The newly deployed bridge - * @throws ActiveMQException */ @Override public void afterDeployBridge(Bridge bridge) throws ActiveMQException { @@ -696,9 +590,6 @@ public void afterDeployBridge(Bridge bridge) throws ActiveMQException { /** * A Critical failure has been detected. * This will be called before the broker is stopped - * - * @param components - * @throws ActiveMQException */ @Override public void criticalFailure(CriticalComponent components) throws ActiveMQException { @@ -720,7 +611,5 @@ private void dumpConfiguration() { logger.debug("LoggingPlugin logDeliveringEvents={}", logDeliveringEvents); logger.debug("LoggingPlugin logInternalEvents={}", logInternalEvents); } - } - } 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 8199ac4cace..4d20eb032f0 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 @@ -37,9 +37,6 @@ import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; -/** - * - */ public class NotificationActiveMQServerPlugin implements ActiveMQServerPlugin { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -59,8 +56,6 @@ public class NotificationActiveMQServerPlugin implements ActiveMQServerPlugin { /** * used to pass configured properties to Plugin - * - * @param properties */ @Override public void init(Map properties) { @@ -186,58 +181,34 @@ private void sendConnectionNotification(final RemotingConnection connection, fin } } - /** - * @return the sendConnectionNotifications - */ public boolean isSendConnectionNotifications() { return sendConnectionNotifications; } - /** - * @param sendConnectionNotifications the sendConnectionNotifications to set - */ public void setSendConnectionNotifications(boolean sendConnectionNotifications) { this.sendConnectionNotifications = sendConnectionNotifications; } - /** - * @return the sendDeliveredNotifications - */ public boolean isSendDeliveredNotifications() { return sendDeliveredNotifications; } - /** - * @param sendDeliveredNotifications the sendDeliveredNotifications to set - */ public void setSendDeliveredNotifications(boolean sendDeliveredNotifications) { this.sendDeliveredNotifications = sendDeliveredNotifications; } - /** - * @return the sendExpiredNotifications - */ public boolean isSendExpiredNotifications() { return sendExpiredNotifications; } - /** - * @param sendExpiredNotifications the sendExpiredNotifications to set - */ public void setSendExpiredNotifications(boolean sendExpiredNotifications) { this.sendExpiredNotifications = sendExpiredNotifications; } - /** - * @return the sendAddressNotifications - */ public boolean isSendAddressNotifications() { return sendAddressNotifications; } - /** - * @param sendAddressNotifications the sendAddressNotifications to set - */ public void setSendAddressNotifications(boolean sendAddressNotifications) { this.sendAddressNotifications = sendAddressNotifications; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoder.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoder.java index c8de2548e38..d8b7a1f4c07 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoder.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoder.java @@ -26,17 +26,14 @@ import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; /** - * This class uses the maximum frame payload size to packetize/frame outbound websocket messages into - * continuation frames. + * This class uses the maximum frame payload size to packetize/frame outbound websocket messages into continuation + * frames. */ public class WebSocketFrameEncoder extends ChannelOutboundHandlerAdapter { private int maxFramePayloadLength; private WebSocketFrameEncoderType type; - /** - * @param maxFramePayloadLength - */ public WebSocketFrameEncoder(int maxFramePayloadLength, WebSocketFrameEncoderType type) { this.maxFramePayloadLength = maxFramePayloadLength; this.type = type; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoderType.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoderType.java index 986101c34c4..410b9a216b2 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoderType.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoderType.java @@ -1,20 +1,21 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.core.server.protocol.websocket; import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/transformer/ServerMessageImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/transformer/ServerMessageImpl.java index 3553db3bb33..f64b9b5bcc2 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/transformer/ServerMessageImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/transformer/ServerMessageImpl.java @@ -60,10 +60,8 @@ public MessageReference createReference(Queue queue) { } /** - * This will force encoding of the address, and will re-check the buffer - * This is to avoid setMessageTransient which set the address without changing the buffer - * - * @param address + * This will force encoding of the address, and will re-check the buffer. This is to avoid setMessageTransient which + * set the address without changing the buffer */ @Override public void forceAddress(SimpleString address) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/HierarchicalRepository.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/HierarchicalRepository.java index 9b8247d8bf6..b84f8cb515e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/HierarchicalRepository.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/HierarchicalRepository.java @@ -43,16 +43,15 @@ public interface HierarchicalRepository { * * @param match the pattern to use to match against * @param value the value to hold against the match - * @param immutableMatch */ void addMatch(String match, T value, boolean immutableMatch); /** * Add a new match to the repository * - * @param match the pattern to use to match against - * @param value the value to hold against the match - * @param immutableMatch whether this match can be removed + * @param match the pattern to use to match against + * @param value the value to hold against the match + * @param immutableMatch whether this match can be removed * @param notifyListeners whether to notify any listeners that the match has been added */ void addMatch(String match, T value, boolean immutableMatch, boolean notifyListeners); @@ -67,8 +66,6 @@ public interface HierarchicalRepository { /** * Return a list of Values being added - * - * @return */ List values(); @@ -80,8 +77,7 @@ public interface HierarchicalRepository { void setDefault(T defaultValue); /** - * - * @return the default match for this repo + * {@return the default match for this repo} */ T getDefault(); @@ -94,15 +90,11 @@ public interface HierarchicalRepository { /** * register a listener to listen for changes in the repository - * - * @param listener */ void registerListener(HierarchicalRepositoryChangeListener listener); /** * unregister a listener - * - * @param listener */ void unRegisterListener(HierarchicalRepositoryChangeListener listener); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java index 5c1fab30965..948ebf522f4 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java @@ -979,8 +979,6 @@ public AddressSettings setRedeliveryCollisionAvoidanceFactor(final double redeli } public long getMaxRedeliveryDelay() { - // default is redelivery-delay * 10 as specified on the docs and at this JIRA: - // https://issues.jboss.org/browse/HORNETQ-1263 return maxRedeliveryDelay != null ? maxRedeliveryDelay : (getRedeliveryDelay() * 10); } @@ -1180,76 +1178,46 @@ public AddressSettings setMaxSizeBytesRejectThreshold(long maxSizeBytesRejectThr return this; } - /** - * @return the defaultConsumerWindowSize - */ public int getDefaultConsumerWindowSize() { return defaultConsumerWindowSize != null ? defaultConsumerWindowSize : ActiveMQClient.DEFAULT_CONSUMER_WINDOW_SIZE; } - /** - * @param defaultConsumerWindowSize the defaultConsumerWindowSize to set - */ public AddressSettings setDefaultConsumerWindowSize(int defaultConsumerWindowSize) { this.defaultConsumerWindowSize = defaultConsumerWindowSize; return this; } - /** - * @return the defaultGroupBuckets - */ public boolean isDefaultGroupRebalance() { return defaultGroupRebalance != null ? defaultGroupRebalance : ActiveMQDefaultConfiguration.getDefaultGroupRebalance(); } - /** - * @param defaultGroupRebalance the defaultGroupBuckets to set - */ public AddressSettings setDefaultGroupRebalance(boolean defaultGroupRebalance) { this.defaultGroupRebalance = defaultGroupRebalance; return this; } - /** - * @return the defaultGroupRebalancePauseDispatch - */ public boolean isDefaultGroupRebalancePauseDispatch() { return defaultGroupRebalancePauseDispatch != null ? defaultGroupRebalancePauseDispatch : ActiveMQDefaultConfiguration.getDefaultGroupRebalancePauseDispatch(); } - /** - * @param defaultGroupRebalancePauseDispatch the defaultGroupBuckets to set - */ public AddressSettings setDefaultGroupRebalancePauseDispatch(boolean defaultGroupRebalancePauseDispatch) { this.defaultGroupRebalancePauseDispatch = defaultGroupRebalancePauseDispatch; return this; } - /** - * @return the defaultGroupBuckets - */ public int getDefaultGroupBuckets() { return defaultGroupBuckets != null ? defaultGroupBuckets : ActiveMQDefaultConfiguration.getDefaultGroupBuckets(); } - /** - * @return the defaultGroupFirstKey - */ public SimpleString getDefaultGroupFirstKey() { return defaultGroupFirstKey != null ? defaultGroupFirstKey : ActiveMQDefaultConfiguration.getDefaultGroupFirstKey(); } - /** - * @param defaultGroupFirstKey the defaultGroupFirstKey to set - */ public AddressSettings setDefaultGroupFirstKey(SimpleString defaultGroupFirstKey) { this.defaultGroupFirstKey = defaultGroupFirstKey; return this; } - /** - * @param defaultGroupBuckets the defaultGroupBuckets to set - */ public AddressSettings setDefaultGroupBuckets(int defaultGroupBuckets) { this.defaultGroupBuckets = defaultGroupBuckets; return this; @@ -1320,8 +1288,6 @@ public AddressSettings setInitialQueueBufferSize(int initialQueueBufferSize) { /** * Merge two AddressSettings instances in one instance - * - * @param merged */ @Override public void merge(final AddressSettings merged) { @@ -1334,8 +1300,6 @@ public void merge(final AddressSettings merged) { /** * Merge two AddressSettings instances in a new instance - * - * @param merged */ @Override public AddressSettings mergeCopy(final AddressSettings merged) { 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 1628d57ff6e..f483dd21c47 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 @@ -54,19 +54,17 @@ public class HierarchicalObjectRepository implements HierarchicalRepository> wildcardMatches = new HashMap<>(); private final Map> exactMatches = new HashMap<>(); private final Map> literalMatches = new HashMap<>(); /** - * Certain values cannot be removed after installed. - * This is because we read a few records from the main config. - * JBoss AS deployer may remove them on undeploy, while we don't want to accept that since - * this could cause issues on shutdown. - * Notice you can still change these values. You just can't remove them. + * Certain values cannot be removed after installed. This is because we read a few records from the main config. + * JBoss AS deployer may remove them on undeploy, while we don't want to accept that since this could cause issues on + * shutdown. Notice you can still change these values. You just can't remove them. */ private final Set immutables = new HashSet<>(); @@ -85,23 +83,17 @@ public class HierarchicalObjectRepository implements HierarchicalRepository cache = new ConcurrentHashMap<>(); /** * Need a lock instead of using multiple {@link ConcurrentHashMap}s. *

                      - * We could have a race between the state of {@link #wildcardMatches}, {@link #exactMatches}, - * and {@link #cache}: - *

                      - * Thread1: calls {@link #addMatch(String, T)}: i. cleans cache; ii. adds match to Map.
                      - * Thread2: could add an (out-dated) entry to the cache between 'i. clean cache' and 'ii. add - * match to Map'. - *

                      - * The lock is OK with regards to performance because we can search the cache before entering the - * lock. + * We could have a race between the state of {@link #wildcardMatches}, {@link #exactMatches}, and {@link #cache}: + *

                        + *
                      • Thread1: calls {@link #addMatch(String, T)}: i. cleans cache; ii. adds match to Map. + *
                      • Thread2: could add an (out-dated) entry to the cache between 'i. clean cache' and 'ii. add match to Map'. + *
                      + * The lock is OK with regards to performance because we can search the cache before entering the lock. *

                      * The lock is required for the 'add match to cache' part. */ @@ -242,10 +234,8 @@ public int getCacheSize() { } /** - * return the value held against the nearest match - * + * {@return the value held against the nearest match} * @param match the match to look for - * @return the value */ @Override public T getMatch(final String match) { @@ -281,9 +271,6 @@ public boolean containsExactWildcardMatch(String match) { /** * merge all the possible matches, if the values implement Mergeable then a full merge is done - * - * @param orderedMatches - * @return */ private T merge(final Collection> orderedMatches) { Iterator> matchIterator = orderedMatches.iterator(); @@ -315,9 +302,9 @@ public void removeMatch(final String match) { if (immutables.contains(modMatch)) { logger.debug("Cannot remove match {} since it came from a main config", modMatch); } else { - /** - * Clear the cache before removing the match, but only if the match used wildcards. This - * will force any thread at {@link #getMatch(String)} to get the lock to recompute. + /* + * Clear the cache before removing the match, but only if the match used wildcards. This will force any + * thread at {@link #getMatch(String)} to get the lock to recompute. */ if (usesWildcards(modMatch)) { clearCache(); @@ -369,7 +356,6 @@ public void setDefault(final T defaultValue) { } /** - * * @return the default match for this repo */ @Override @@ -439,12 +425,6 @@ private void onChange() { } } - /** - * return matches - * - * @param match - * @return - */ private List> getMatches(final String match) { List> matches = new ArrayList<>(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/Match.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/Match.java index bddc87dbf07..054e6185436 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/Match.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/Match.java @@ -60,12 +60,8 @@ public Match(final String match, final T value, final WildcardConfiguration wild } /** - * - * @param match - * @param wildcardConfiguration - * @param direct setting true is useful for use-cases where you just want to know whether or not a message sent to - * a particular address would match the pattern - * @return + * @param direct setting true is useful for use-cases where you just want to know whether a message sent to a + * particular address would match the pattern */ public static Pattern createPattern(final String match, final WildcardConfiguration wildcardConfiguration, boolean direct) { String actMatch = match; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/ResourceLimitSettings.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/ResourceLimitSettings.java index 475abd1e5ad..704e2df090c 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/ResourceLimitSettings.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/ResourceLimitSettings.java @@ -141,9 +141,6 @@ public void decode(ActiveMQBuffer buffer) { // queueNameRegex = buffer.readNullableSimpleString(); } - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ @Override public int hashCode() { final int prime = 31; @@ -176,9 +173,6 @@ public boolean equals(Object o) { return maxQueues != null ? maxQueues.equals(that.maxQueues) : that.maxQueues == null; } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { return "ResourceLimitSettings [match=" + match + diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/Transaction.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/Transaction.java index 0a64aa1e90b..deac731375a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/Transaction.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/Transaction.java @@ -36,8 +36,8 @@ enum State { Object getProtocolData(); /** - * Protocol managers can use this field to store any object needed. - * An example would be the Session used by the transaction on openwire + * Protocol managers can use this field to store any object needed. An example would be the Session used by the + * transaction on openwire */ void setProtocolData(Object data); @@ -51,9 +51,10 @@ enum State { void rollback() throws Exception; - /** In a ServerSession failure scenario,\ - * we may try to rollback, however only if it's not prepared. - * In case it's prepared, we will just let it be and let the transaction manager to deal with it */ + /** + * In a ServerSession failure scenario,\ we may try to rollback, however only if it's not prepared. In case it's + * prepared, we will just let it be and let the transaction manager to deal with it + */ boolean tryRollback(); long getID(); @@ -77,9 +78,8 @@ enum State { void afterWired(Runnable runnable); /** - * This is an operation that will be called right after the storage is completed. - * addOperation could only happen after paging and replication, while these operations will just be - * about the storage + * This is an operation that will be called right after the storage is completed. addOperation could only happen + * after paging and replication, while these operations will just be about the storage */ void afterStore(TransactionOperation sync); @@ -88,8 +88,8 @@ enum State { boolean hasTimedOut(long currentTime, int defaultTimeout); /** - * To validate if the Transaction had previously timed out. - * This is to check the reason why a TX has been rolled back. + * To validate if the Transaction had previously timed out. This is to check the reason why a TX has been rolled + * back. */ boolean hasTimedOut(); @@ -107,7 +107,9 @@ enum State { boolean isAsync(); - /** To be used on control transactions that are meant as internal and don't really require a hard sync. */ + /** + * To be used on control transactions that are meant as internal and don't really require a hard sync. + */ Transaction setAsync(boolean async); default boolean isAllowPageTransaction() { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionOperationAbstract.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionOperationAbstract.java index f45f8d2cb39..912d7ff1e32 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionOperationAbstract.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/TransactionOperationAbstract.java @@ -81,9 +81,6 @@ public List getRelatedMessageReferences() { return Collections.emptyList(); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.transaction.TransactionOperation#getListOnConsumer(long) - */ @Override public List getListOnConsumer(long consumerID) { return Collections.emptyList(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/BindingsTransactionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/BindingsTransactionImpl.java index e2d0b507211..0b287660831 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/BindingsTransactionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/BindingsTransactionImpl.java @@ -25,9 +25,6 @@ public BindingsTransactionImpl(StorageManager storage) { super(storage, 0); } - /** - * @throws Exception - */ @Override protected void doCommit() throws Exception { if (isContainsPersistent()) { 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 d4b1a1f69d2..03c08ebf1a9 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 @@ -340,9 +340,6 @@ public void done() { } } - /** - * @throws Exception - */ protected void doCommit() throws Exception { if (containsPersistent || xid != null && state == State.PREPARED) { // ^^ These are the scenarios where we require a storage.commit diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/AbstractProtocolManagerFactory.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/AbstractProtocolManagerFactory.java index d1ae43e73dc..96be40f8806 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/AbstractProtocolManagerFactory.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/AbstractProtocolManagerFactory.java @@ -28,13 +28,8 @@ public abstract class AbstractProtocolManagerFactory

                      implements ProtocolManagerFactory

                      { /** - * This method exists because java templates won't store the type of P at runtime. - * So it's not possible to write a generic method with having the Class Type. - * This will serve as a tool for sub classes to filter properly* * * - * - * @param type - * @param listIn - * @return + * This method exists because Java templates won't store the type of P at runtime. So it's not possible to write a + * generic method with having the Class Type. This will serve as a tool for sub classes to filter properly, */ protected List

                      internalFilterInterceptors(Class

                      type, List listIn) { if (listIn == null) { 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 9efa650f58e..cc379a1ca9c 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 @@ -42,7 +42,9 @@ public byte getID() { private static final MessagePersister theInstance = new MessagePersister(); - /** This will be used for reading messages */ + /** + * This will be used for reading messages + */ private static final Persister[] persisters = new Persister[MAX_PERSISTERS]; static { @@ -100,7 +102,9 @@ public int getEncodeSize(Message record) { } - /** Sub classes must add the first short as the protocol-id */ + /** + * Sub classes must add the first short as the protocol-id + */ @Override public void encode(ActiveMQBuffer buffer, Message record) { buffer.writeByte(getID()); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/ProtocolManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/ProtocolManager.java index 0a9e5b9d723..60b94c639bd 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/ProtocolManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/ProtocolManager.java @@ -30,17 +30,16 @@ import org.apache.activemq.artemis.spi.core.remoting.Connection; /** - * Info: ProtocolManager is loaded by {@link org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl#loadProtocolManagerFactories(Iterable)} + * Info: ProtocolManager is loaded by + * {@link + * org.apache.activemq.artemis.core.remoting.server.impl.RemotingServiceImpl#loadProtocolManagerFactories(Iterable)} */ public interface ProtocolManager

                      { ProtocolManagerFactory

                      getFactory(); /** - * This method will receive all the interceptors on the system and you should filter them out * - * - * @param incomingInterceptors - * @param outgoingInterceptors + * This method will receive all the interceptors on the system and you should filter them out */ void updateInterceptors(List incomingInterceptors, List outgoingInterceptors); @@ -56,9 +55,9 @@ default void removeHandler(String name) { boolean isProtocol(byte[] array); /** - * If this protocols accepts connectoins without an initial handshake. - * If true this protocol will be the failback case no other connections are made. - * New designed protocols should always require a handshake. This is only useful for legacy protocols. + * If this protocols accepts connectoins without an initial handshake. If true this protocol will be the failback + * case no other connections are made. New designed protocols should always require a handshake. This is only useful + * for legacy protocols. */ boolean acceptsNoHandshake(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/ProtocolManagerFactory.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/ProtocolManagerFactory.java index 91a587e40ff..d61f0a09ad2 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/ProtocolManagerFactory.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/ProtocolManagerFactory.java @@ -31,16 +31,10 @@ default Persister[] getPersister() { return new Persister[]{}; } - /** - * When you create the ProtocolManager, you should filter out any interceptors that won't belong - * to this Protocol. - * For example don't send any core Interceptors {@link org.apache.activemq.artemis.api.core.Interceptor} to Stomp * * * - * - * @param server - * @param incomingInterceptors - * @param outgoingInterceptors - * @return + * When you create the ProtocolManager, you should filter out any interceptors that won't belong to this Protocol. + * For example don't send any core Interceptors {@link org.apache.activemq.artemis.api.core.Interceptor} to Stomp * * + * * */ ProtocolManager createProtocolManager(ActiveMQServer server, Map parameters, @@ -48,10 +42,7 @@ ProtocolManager createProtocolManager(ActiveMQServer server, List outgoingInterceptors) throws Exception; /** - * This should get the entire list and only return the ones this factory can deal with * - * - * @param interceptors - * @return + * This should get the entire list and only return the ones this factory can deal with */ List

                      filterInterceptors(List interceptors); @@ -62,16 +53,13 @@ ProtocolManager createProtocolManager(ActiveMQServer server, void loadProtocolServices(ActiveMQServer server, List services); /** - * Provides an entry point for the server to trigger the protocol manager factory to - * update its protocol services based on updates to server configuration. - * - * @param server - * The service instance that has triggered this update - * @param services - * The protocol services that were previously registered (mutable). + * Provides an entry point for the server to trigger the protocol manager factory to update its protocol services + * based on updates to server configuration. * - * @throws Exception can throw an exception if an error occurs while updating or adding - * protocol services from configuration updates. + * @param server The service instance that has triggered this update + * @param services The protocol services that were previously registered (mutable). + * @throws Exception can throw an exception if an error occurs while updating or adding protocol services from + * configuration updates. */ void updateProtocolServices(ActiveMQServer server, List services) throws Exception; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/SessionCallback.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/SessionCallback.java index e20f01277f2..ad504739cf6 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/SessionCallback.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/protocol/SessionCallback.java @@ -24,17 +24,15 @@ public interface SessionCallback { - /** A requirement to do direct delivery is: - * no extra locking required at the protocol layer. - * which cannot be guaranteed at AMQP as proton will need the locking. - * So, disable this on AMQP or any other protocol requiring extra lock. - * @return + /** + * A requirement to do direct delivery is: no extra locking required at the protocol layer. which cannot be + * guaranteed at AMQP as proton will need the locking. So, disable this on AMQP or any other protocol requiring extra + * lock. */ default boolean supportsDirectDelivery() { return true; } - /** * This one gives a chance for Proton to have its own flow control. */ @@ -49,18 +47,13 @@ default boolean hasCredits(ServerConsumer consumerID, MessageReference ref) { } /** - * This can be used to complete certain operations outside of the lock, - * like acks or other operations. + * This can be used to complete certain operations outside of the lock, like acks or other operations. */ void afterDelivery() throws Exception; /** - * Use this to updates specifics on the message after a redelivery happened. - * Return true if there was specific logic applied on the protocol, so the ServerConsumer won't make any adjustments. - * - * @param consumer - * @param ref - * @param failed + * Use this to updates specifics on the message after a redelivery happened. Return true if there was specific logic + * applied on the protocol, so the ServerConsumer won't make any adjustments. */ boolean updateDeliveryCountAfterCancel(ServerConsumer consumer, MessageReference ref, boolean failed); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Acceptor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Acceptor.java index 9b36a47bd0c..0446cbaac84 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Acceptor.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Acceptor.java @@ -27,14 +27,13 @@ import org.apache.activemq.artemis.core.server.management.NotificationService; /** - * An Acceptor is used by the RemotingService to allow clients to connect. It should take care of - * dispatching client requests to the RemotingService's Dispatcher. + * An Acceptor is used by the RemotingService to allow clients to connect. It should take care of dispatching client + * requests to the RemotingService's Dispatcher. */ public interface Acceptor extends ActiveMQComponent { /** - * The name of the acceptor used on the configuration. - * for logging and debug purposes. + * The name of the acceptor used on the configuration. for logging and debug purposes. */ String getName(); @@ -75,8 +74,8 @@ public interface Acceptor extends ActiveMQComponent { boolean isUnsecurable(); /** - * Re-create the acceptor with the existing configuration values. Useful, for example, for reloading key/trust - * stores on acceptors which support SSL. + * Re-create the acceptor with the existing configuration values. Useful, for example, for reloading key/trust stores + * on acceptors which support SSL. */ void reload(); @@ -85,9 +84,8 @@ default ProtocolHandler getProtocolHandler() { } /** - * This is a utility method for Socket-based acceptor implementations to get the actual port used. - * This is useful for configurations which specify a port number of 0 which allows the JVM to select - * an ephemeral port. + * This is a utility method for Socket-based acceptor implementations to get the actual port used. This is useful for + * configurations which specify a port number of 0 which allows the JVM to select an ephemeral port. * * @return the actual port used if using a Socket-based acceptor implementation; -1 otherwise */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/AcceptorFactory.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/AcceptorFactory.java index 2416e17efcf..b944e89ec39 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/AcceptorFactory.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/AcceptorFactory.java @@ -26,7 +26,8 @@ /** * A factory for creating acceptors. *

                      - * An Acceptor is an endpoint that a {@link org.apache.activemq.artemis.spi.core.remoting.Connector} will connect to and is used by the remoting service. + * An Acceptor is an endpoint that a {@link org.apache.activemq.artemis.spi.core.remoting.Connector} will connect to and + * is used by the remoting service. */ public interface AcceptorFactory { @@ -39,7 +40,6 @@ public interface AcceptorFactory { * @param listener the listener * @param threadPool the threadpool * @param scheduledThreadPool a scheduled thread pool - * @param protocolMap * @return an acceptor */ Acceptor createAcceptor(String name, 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 55368c57748..0be7a2ba12f 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 @@ -39,9 +39,9 @@ /** * This implementation delegates to the JAAS security interfaces. - * - * The {@link Subject} returned by the login context is expecting to have a set of {@link RolePrincipal} for each - * role of the user. + *

                      + * The {@link Subject} returned by the login context is expecting to have a set of {@link RolePrincipal} for each role + * of the user. */ public class ActiveMQJAASSecurityManager implements ActiveMQSecurityManager5 { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager.java index 40969679bf2..9b906c21626 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager.java @@ -26,8 +26,7 @@ import org.apache.activemq.artemis.utils.SecurityManagerUtil; /** - * Use to validate whether a user has is valid to connect to the server and perform certain - * functions + * Use to validate whether a user has is valid to connect to the server and perform certain functions */ public interface ActiveMQSecurityManager { @@ -40,7 +39,7 @@ default String getDomain() { * * @param user the user * @param password the users password - * @return true if a valid user + * @return {@code true} if a valid user */ boolean validateUser(String user, String password); @@ -51,14 +50,14 @@ default String getDomain() { * @param password the users password * @param roles the roles the user has * @param checkType the type of check to perform - * @return true if the user is valid and they have the correct roles + * @return {@code true} if the user is valid and they have the correct roles */ boolean validateUserAndRole(String user, String password, Set roles, CheckType checkType); /** * Initialize the manager with the given configuration properties. This method is called by the broker when the - * file-based configuration is read. If you're creating/configuring the plugin programmatically then the - * recommended approach is to simply use the manager's getters/setters rather than this method. + * file-based configuration is read. If you're creating/configuring the plugin programmatically then the recommended + * approach is to simply use the manager's getters/setters rather than this method. * * @param properties name/value pairs used to configure the ActiveMQSecurityManager instance * @return {@code this} instance diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager2.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager2.java index 560da4df9e9..69de3ee38af 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager2.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager2.java @@ -24,31 +24,26 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; /** - * Used to validate whether a user is authorized to connect to the - * server and perform certain functions on certain destinations. - * - * This is an evolution of {@link ActiveMQSecurityManager} that adds - * the ability to perform authorization taking the destination address - * into account. + * This is an evolution of {@link ActiveMQSecurityManager} that adds the ability to perform authorization taking the + * destination address into account. */ public interface ActiveMQSecurityManager2 extends ActiveMQSecurityManager { /** * is this a valid user. - * - * This method is called instead of - * {@link ActiveMQSecurityManager#validateUser(String, String)}. + *

                      + * This method is called instead of {@link ActiveMQSecurityManager#validateUser(String, String)}. * * @param user the user * @param password the users password - * @return true if a valid user + * @return {@code true} if a valid user */ boolean validateUser(String user, String password, X509Certificate[] certificates); /** - * Determine whether the given user is valid and whether they have - * the correct role for the given destination address. - * + * Determine whether the given user is valid and whether they have the correct role for the given destination + * address. + *

                      * This method is called instead of * {@link ActiveMQSecurityManager#validateUserAndRole(String, String, Set, CheckType)}. * @@ -58,7 +53,7 @@ public interface ActiveMQSecurityManager2 extends ActiveMQSecurityManager { * @param checkType which permission to validate * @param address the address for which to perform authorization * @param connection the user's connection - * @return true if the user is valid and they have the correct roles for the given destination address + * @return {@code true} if the user is valid and they have the correct roles for the given destination address */ boolean validateUserAndRole(String user, String password, diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager3.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager3.java index 3a42fc16389..9230cb4e99d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager3.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager3.java @@ -23,40 +23,34 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; /** - * Used to validate whether a user is authorized to connect to the - * server and perform certain functions on certain destinations. - * - * This is an evolution of {@link ActiveMQSecurityManager} and - * {@link ActiveMQSecurityManager2} that adds the ability to determine - * the identity of the validated user. + * This is an evolution of {@link ActiveMQSecurityManager} and {@link ActiveMQSecurityManager2} that adds the ability to + * determine the identity of the validated user. */ public interface ActiveMQSecurityManager3 extends ActiveMQSecurityManager { /** * is this a valid user. - * - * This method is called instead of - * {@link ActiveMQSecurityManager#validateUser(String, String)}. + *

                      + * This method is called instead of {@link ActiveMQSecurityManager#validateUser(String, String)}. * * @param user the user * @param password the users password - * @param remotingConnection * @return the name of the validated user or null if the user isn't validated */ String validateUser(String user, String password, RemotingConnection remotingConnection); /** - * Determine whether the given user is valid and whether they have - * the correct role for the given destination address. - * + * Determine whether the given user is valid and whether they have the correct role for the given destination + * address. + *

                      * This method is called instead of * {@link ActiveMQSecurityManager#validateUserAndRole(String, String, Set, CheckType)}. * - * @param user the user - * @param password the user's password - * @param roles the user's roles - * @param checkType which permission to validate - * @param address the address for which to perform authorization + * @param user the user + * @param password the user's password + * @param roles the user's roles + * @param checkType which permission to validate + * @param address the address for which to perform authorization * @param remotingConnection the user's connection * @return the name of the validated user or null if the user isn't validated */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager4.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager4.java index dd680204776..0609b9a5069 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager4.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager4.java @@ -23,42 +23,36 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection; /** - * Used to validate whether a user is authorized to connect to the - * server and perform certain functions on certain addresses - * - * This is an evolution of {@link ActiveMQSecurityManager3} - * that adds the ability to specify the JAAS domain per call. + * This is an evolution of {@link ActiveMQSecurityManager3} that adds the ability to specify the JAAS domain per call. */ public interface ActiveMQSecurityManager4 extends ActiveMQSecurityManager { /** * is this a valid user. + *

                      + * This method is called instead of {@link ActiveMQSecurityManager#validateUser(String, String)}. * - * This method is called instead of - * {@link ActiveMQSecurityManager#validateUser(String, String)}. - * - * @param user the user - * @param password the users password - * @param remotingConnection + * @param user the user + * @param password the users password * @param securityDomain the name of the JAAS security domain to use (can be null) * @return the name of the validated user or null if the user isn't validated */ String validateUser(String user, String password, RemotingConnection remotingConnection, String securityDomain); /** - * Determine whether the given user is valid and whether they have - * the correct role for the given destination address. - * + * Determine whether the given user is valid and whether they have the correct role for the given destination + * address. + *

                      * This method is called instead of * {@link ActiveMQSecurityManager#validateUserAndRole(String, String, Set, CheckType)}. * - * @param user the user - * @param password the user's password - * @param roles the user's roles - * @param checkType which permission to validate - * @param address the address for which to perform authorization + * @param user the user + * @param password the user's password + * @param roles the user's roles + * @param checkType which permission to validate + * @param address the address for which to perform authorization * @param remotingConnection the user's connection - * @param securityDomain the name of the JAAS security domain to use (can be null) + * @param securityDomain the name of the JAAS security domain to use (can be null) * @return the name of the validated user or null if the user isn't validated */ String validateUserAndRole(String user, diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager5.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager5.java index af8c8c82340..0458acdc81a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager5.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager5.java @@ -25,39 +25,34 @@ import org.apache.activemq.artemis.spi.core.security.jaas.NoCacheLoginException; /** - * Used to validate whether a user is authorized to connect to the - * server and perform certain functions on certain addresses - * - * This is an evolution of {@link ActiveMQSecurityManager4} - * that integrates with the new Subject caching functionality. + * This is an evolution of {@link ActiveMQSecurityManager4} that integrates with the new Subject caching functionality. */ public interface ActiveMQSecurityManager5 extends ActiveMQSecurityManager { /** * is this a valid user. + *

                      + * This method is called instead of {@link ActiveMQSecurityManager#validateUser(String, String)}. * - * This method is called instead of - * {@link ActiveMQSecurityManager#validateUser(String, String)}. - * - * @param user the user - * @param password the user's password + * @param user the user + * @param password the user's password * @param remotingConnection the user's connection which contains any corresponding SSL certs - * @param securityDomain the name of the JAAS security domain to use (can be null) + * @param securityDomain the name of the JAAS security domain to use (can be null) * @return the Subject of the authenticated user, else null */ Subject authenticate(String user, String password, RemotingConnection remotingConnection, String securityDomain) throws NoCacheLoginException; /** * Determine whether the given user has the correct role for the given check type. - * + *

                      * This method is called instead of * {@link ActiveMQSecurityManager#validateUserAndRole(String, String, Set, CheckType)}. * - * @param subject the Subject to authorize - * @param roles the roles configured in the security-settings - * @param checkType which permission to validate - * @param address the address (or FQQN) to grant access to - * @return true if the user is authorized, else false + * @param subject the Subject to authorize + * @param roles the roles configured in the security-settings + * @param checkType which permission to validate + * @param address the address (or FQQN) to grant access to + * @return {@code true} if the user is authorized, else false */ boolean authorize(Subject subject, Set roles, CheckType checkType, String address); 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 1877c32e9d6..a29a56105b9 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 @@ -46,8 +46,6 @@ public ActiveMQSecurityManagerImpl(SecurityConfiguration configuration) { this.configuration = configuration; } - - @Override public boolean validateUser(final String username, final String password) { if (username != null) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/AuditLoginModule.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/AuditLoginModule.java index 515d283b16b..9b36545cb85 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/AuditLoginModule.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/AuditLoginModule.java @@ -21,15 +21,15 @@ import javax.security.auth.Subject; import javax.security.auth.spi.LoginModule; -/* -* This is only to support auditlogging -* */ +/** + * This is only to support auditlogging + */ public interface AuditLoginModule extends LoginModule { /* - * We need this because if authentication fails at the web layer then there is no way to access the unauthenticated - * subject as it is removed and the session destroyed and never gets as far as the broker - * */ + * We need this because if authentication fails at the web layer then there is no way to access the unauthenticated + * subject as it is removed and the session destroyed and never gets as far as the broker + */ default void registerFailureForAudit(String name) { Subject subject = new Subject(); subject.getPrincipals().add(new UserPrincipal(name)); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/CertificateCallback.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/CertificateCallback.java index 630dd32b4b8..a122971034b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/CertificateCallback.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/CertificateCallback.java @@ -21,27 +21,17 @@ /** * A Callback for SSL certificates. - * + *

                      * Will return a certificate chain to its client. */ public class CertificateCallback implements Callback { X509Certificate[] certificates; - /** - * Setter for certificate chain. - * - * @param certs The certificates to be returned. - */ public void setCertificates(X509Certificate[] certs) { certificates = certs; } - /** - * Getter for certificate chain. - * - * @return The certificates being carried. - */ public X509Certificate[] getCertificates() { return certificates; } 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 704e789e5d4..7bec6c7e807 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 @@ -34,9 +34,8 @@ import java.lang.invoke.MethodHandles; /** - * A LoginModule that allows for authentication based on SSL certificates. - * Allows for subclasses to define methods used to verify user certificates and - * find user roles. Uses CertificateCallbacks to retrieve certificates. + * A LoginModule that allows for authentication based on SSL certificates. Allows for subclasses to define methods used + * to verify user certificates and find user roles. Uses CertificateCallbacks to retrieve certificates. */ public abstract class CertificateLoginModule extends PropertiesLoader implements AuditLoginModule { @@ -149,22 +148,21 @@ private void clear() { } /** - * Should return a unique name corresponding to the certificates given. The - * name returned will be used to look up access levels as well as role - * associations. + * Should return a unique name corresponding to the certificates given. The name returned will be used to look up + * access levels as well as role associations. * * @param certs The distinguished name. - * @return The unique name if the certificate is recognized, null otherwise. + * @return The unique name if the certificate is recognized, null otherwise */ protected abstract String getUserNameForCertificates(X509Certificate[] certs) throws LoginException; /** - * Should return a set of the roles this user belongs to. The roles - * returned will be added to the user's credentials. + * Should return a set of the roles this user belongs to. The roles returned will be added to the user's + * credentials. * - * @param username The username of the client. This is the same name that - * getUserNameForDn returned for the user's DN. - * @return A Set of the names of the roles this user belongs to. + * @param username The username of the client. This is the same name that getUserNameForDn returned for the user's + * DN. + * @return A Set of the names of the roles this user belongs to */ protected abstract Set getUserRoles(String username) throws LoginException; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ClientIDCallback.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ClientIDCallback.java index 90f43ff5980..7f944193d49 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ClientIDCallback.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ClientIDCallback.java @@ -18,25 +18,14 @@ import javax.security.auth.callback.Callback; -/** - * A Callback for getting the Client ID. - */ public class ClientIDCallback implements Callback { private String clientID; - /** - * Setter for Client ID. - * @param cid The Client ID to be returned. - */ public void setClientID(String cid) { clientID = cid; } - /** - * Getter for peer Client ID. - * @return The Client ID being carried. - */ public String getClientID() { return clientID; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/DigestCallback.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/DigestCallback.java index 865b2664a51..215285b2d37 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/DigestCallback.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/DigestCallback.java @@ -29,6 +29,7 @@ public class DigestCallback implements Callback { /** * set the digest to use + * * @param digest the digest */ public void setDigest(MessageDigest digest) { @@ -36,7 +37,7 @@ public void setDigest(MessageDigest digest) { } /** - * @return the digest or null if not known + * {@return the digest or {@code null} if not known} */ public MessageDigest getDigest() { return digest; 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 fbbc7aef8f5..0c4fa77bcb6 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 @@ -34,9 +34,8 @@ /** * Always login the user with a default 'guest' identity. - * - * Useful for unauthenticated communication channels being used in the - * same broker as authenticated ones. + *

                      + * Useful for unauthenticated communication channels being used in the same broker as authenticated ones. */ public class GuestLoginModule implements AuditLoginModule { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/HmacCallback.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/HmacCallback.java index 8d8f9ce8883..7bdbbcba8da 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/HmacCallback.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/HmacCallback.java @@ -26,19 +26,11 @@ public class HmacCallback implements Callback { private Mac hmac; - /** - * set the Hmac to use - * @param hmac - */ public void setHmac(Mac hmac) { this.hmac = hmac; } - /** - * @return the Hmac or null if non could be obtained - */ public Mac getHmac() { return hmac; } - } 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 73d1d72613c..4c1e8f01992 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 @@ -27,8 +27,8 @@ import java.lang.invoke.MethodHandles; /** - * populate an empty (no UserPrincipal) subject with UserPrincipal seeded from existing principal - * Useful when a third party login module generated principal needs to be accepted as-is by the broker + * populate an empty (no UserPrincipal) subject with UserPrincipal seeded from existing principal Useful when a third + * party login module generated principal needs to be accepted as-is by the broker */ public class PrincipalConversionLoginModule implements AuditLoginModule { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PrincipalsCallback.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PrincipalsCallback.java index 821f6fb9e05..7bd4fc1923e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PrincipalsCallback.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/PrincipalsCallback.java @@ -29,6 +29,7 @@ public class PrincipalsCallback implements Callback { /** * Setter for peer Principals. + * * @param principal The certificates to be returned. */ public void setPeerPrincipals(Principal[] principal) { @@ -37,7 +38,8 @@ public void setPeerPrincipals(Principal[] principal) { /** * Getter for peer Principals. - * @return The principal being carried. + * + * @return The principal being carried */ public Principal[] getPeerPrincipals() { return peerPrincipals; 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 7ac3a677e79..63cfd996ddb 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 @@ -185,7 +185,7 @@ private void load(final File source, Properties props) throws IOException { } private boolean hasModificationAfter(long reloadTime) { - /** + /* * A bug in JDK 8/9 (i.e. https://bugs.openjdk.java.net/browse/JDK-8177809) causes java.io.File.lastModified() to * lose resolution past 1 second. Because of this, the value returned by java.io.File.lastModified() can appear to * be smaller than it actually is which can cause the broker to miss reloading the properties if the modification diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/SCRAMMechanismCallback.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/SCRAMMechanismCallback.java index de66108dbfc..a9509a79856 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/SCRAMMechanismCallback.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/SCRAMMechanismCallback.java @@ -27,6 +27,7 @@ public class SCRAMMechanismCallback implements Callback { /** * sets the name of the mechanism + * * @param name the name of the mechanism */ public void setMechanism(String name) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/SCRAMPropertiesLoginModule.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/SCRAMPropertiesLoginModule.java index c9fccadb2bb..d94494ff677 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/SCRAMPropertiesLoginModule.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/SCRAMPropertiesLoginModule.java @@ -44,15 +44,12 @@ import org.apache.activemq.artemis.utils.PasswordMaskingUtil; /** - * Login modules that uses properties files similar to the {@link PropertiesLoginModule}. It can - * either store the username-password in plain text or in an encrypted/hashed form. the - * {@link #main(String[])} method provides a way to prepare unencrypted data to be encrypted/hashed. + * Login modules that uses properties files similar to the {@link PropertiesLoginModule}. It can either store the + * username-password in plain text or in an encrypted/hashed form. the {@link #main(String[])} method provides a way to + * prepare unencrypted data to be encrypted/hashed. */ public class SCRAMPropertiesLoginModule extends PropertiesLoader implements AuditLoginModule { - /** - * - */ private static final String SEPARATOR_MECHANISM = "|"; private static final String SEPARATOR_PARAMETER = ":"; private static final int MIN_ITERATIONS = 4096; @@ -179,11 +176,12 @@ public boolean logout() throws LoginException { /** * Main method that could be used to encrypt given credentials for use in properties files + * * @param args username password type [iterations] * @throws GeneralSecurityException if any security mechanism is not available on this JVM - * @throws ScramException if invalid data is supplied - * @throws StringPrepError if username can't be encoded according to SASL StringPrep - * @throws IOException if writing as properties failed + * @throws ScramException if invalid data is supplied + * @throws StringPrepError if username can't be encoded according to SASL StringPrep + * @throws IOException if writing as properties failed */ public static void main(String[] args) throws GeneralSecurityException, ScramException, StringPrepError, IOException { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/TextFileCertificateLoginModule.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/TextFileCertificateLoginModule.java index 2af08c69776..6045bcfac94 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/TextFileCertificateLoginModule.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/TextFileCertificateLoginModule.java @@ -27,15 +27,12 @@ import java.util.regex.Pattern; /** - * A LoginModule allowing for SSL certificate based authentication based on - * Distinguished Names (DN) stored in text files. The DNs are parsed using a - * Properties class where each line is <user_name>=<user_DN>. This class also - * uses a group definition file where each line is <role_name>=<user_name_1>,<user_name_2>,etc. - * The user and role files' locations must be specified in the - * org.apache.activemq.jaas.textfiledn.user and - * org.apache.activemq.jaas.textfiledn.role properties respectively. NOTE: This - * class will re-read user and group files if they have been modified and the "reload" - * option is true + * A LoginModule allowing for SSL certificate based authentication based on Distinguished Names (DN) stored in text + * files. The DNs are parsed using a Properties class where each line is <user_name>=<user_DN>. This class + * also uses a group definition file where each line is <role_name>=<user_name_1>,<user_name_2>,etc. + * The user and role files' locations must be specified in the org.apache.activemq.jaas.textfiledn.user and + * org.apache.activemq.jaas.textfiledn.role properties respectively. NOTE: This class will re-read user and group files + * if they have been modified and the "reload" option is true */ public class TextFileCertificateLoginModule extends CertificateLoginModule { @@ -67,14 +64,11 @@ public void initialize(Subject subject, } /** - * Overriding to allow DN authorization based on DNs specified in text - * files. + * Overriding to allow DN authorization based on DNs specified in text files. * * @param certs The certificate the incoming connection provided. - * @return The user's authenticated name or null if unable to authenticate - * the user. - * @throws LoginException Thrown if unable to find user file or connection - * certificate. + * @return The user's authenticated name or null if unable to authenticate the user. + * @throws LoginException Thrown if unable to find user file or connection certificate. */ @Override protected String getUserNameForCertificates(final X509Certificate[] certs) throws LoginException { @@ -88,9 +82,9 @@ protected String getUserNameForCertificates(final X509Certificate[] certs) throw /** * Overriding to allow for role discovery based on text files. * - * @param username The name of the user being examined. This is the same - * name returned by getUserNameForCertificates. - * @return A Set of name Strings for roles this user belongs to. + * @param username The name of the user being examined. This is the same name returned by + * getUserNameForCertificates. + * @return A Set of name Strings for roles this user belongs to * @throws LoginException Thrown if unable to find role definition file. */ @Override diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/ScramException.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/ScramException.java index e6ea177f4c2..d7ef08801af 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/ScramException.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/ScramException.java @@ -22,8 +22,10 @@ * Indicates error while processing SCRAM sequence */ public class ScramException extends Exception { + /** * Creates new ScramException + * * @param message Exception message */ public ScramException(String message) { @@ -36,6 +38,7 @@ public ScramException(String message, GeneralSecurityException e) { /** * Creates new ScramException + * * @param cause Throwable */ public ScramException(Throwable cause) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/ScramUtils.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/ScramUtils.java index 1f7e80449c1..1aec01e8399 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/ScramUtils.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/ScramUtils.java @@ -37,12 +37,12 @@ private ScramUtils() { /** * Generates salted password. - * @param password Clear form password, i.e. what user typed - * @param salt Salt to be used + * + * @param password Clear form password, i.e. what user typed + * @param salt Salt to be used * @param iterationsCount Iterations for 'salting' - * @param mac HMAC to be used + * @param mac HMAC to be used * @return salted password - * @throws ScramException */ public static byte[] generateSaltedPassword(final String password, byte[] salt, int iterationsCount, Mac mac) throws ScramException { @@ -70,10 +70,11 @@ public static byte[] generateSaltedPassword(final String password, byte[] salt, /** * Creates HMAC + * * @param keyBytes key * @param hmacName HMAC name * @return Mac - * @throws InvalidKeyException if internal error occur while working with SecretKeySpec + * @throws InvalidKeyException if internal error occur while working with SecretKeySpec * @throws NoSuchAlgorithmException if hmacName is not supported by the java */ public static Mac createHmac(final byte[] keyBytes, String hmacName) throws NoSuchAlgorithmException, @@ -87,11 +88,12 @@ public static Mac createHmac(final byte[] keyBytes, String hmacName) throws NoSu /** * Computes HMAC byte array for given string - * @param key key + * + * @param key key * @param hmacName HMAC name - * @param string string for which HMAC will be computed + * @param string string for which HMAC will be computed * @return computed HMAC - * @throws InvalidKeyException if internal error occur while working with SecretKeySpec + * @throws InvalidKeyException if internal error occur while working with SecretKeySpec * @throws NoSuchAlgorithmException if hmacName is not supported by the java */ public static byte[] computeHmac(final byte[] key, String hmacName, final String string) throws InvalidKeyException, @@ -115,6 +117,7 @@ public static byte[] computeHmac(final byte[] key, Mac hmac, final String string /** * Checks if string is null or empty + * * @param string String to be tested * @return true if the string is null or empty, false otherwise */ @@ -125,16 +128,15 @@ public static boolean isNullOrEmpty(String string) { /** * Computes the data associated with new password like salted password, keys, etc *

                      - * This method is supposed to be used by a server when user provides new clear form password. We - * don't want to save it that way so we generate salted password and store it along with other - * data required by the SCRAM mechanism + * This method is supposed to be used by a server when user provides new clear form password. We don't want to save + * it that way so we generate salted password and store it along with other data required by the SCRAM mechanism + * * @param passwordClearText Clear form password, i.e. as provided by the user - * @param salt Salt to be used - * @param iterations Iterations for 'salting' - * @param mac HMAC name to be used - * @param messageDigest Digest name to be used + * @param salt Salt to be used + * @param iterations Iterations for 'salting' + * @param mac HMAC name to be used + * @param messageDigest Digest name to be used * @return new password data while working with SecretKeySpec - * @throws ScramException */ public static NewPasswordByteArrayData newPassword(String passwordClearText, byte[] salt, int iterations, MessageDigest messageDigest, Mac mac) throws ScramException { @@ -148,8 +150,9 @@ public static NewPasswordByteArrayData newPassword(String passwordClearText, byt } /** - * Transforms NewPasswordByteArrayData into NewPasswordStringData into database friendly (string) - * representation Uses Base64 to encode the byte arrays into strings + * Transforms NewPasswordByteArrayData into NewPasswordStringData into database friendly (string) representation Uses + * Base64 to encode the byte arrays into strings + * * @param ba Byte array data * @return String data */ @@ -166,39 +169,22 @@ public static NewPasswordStringData byteArrayToStringData(NewPasswordByteArrayDa */ @SuppressWarnings("unused") public static class NewPasswordStringData { - /** - * Salted password - */ public final String saltedPassword; - /** - * Used salt - */ public final String salt; - /** - * Client key - */ public final String clientKey; - /** - * Stored key - */ public final String storedKey; - /** - * Server key - */ public final String serverKey; - /** - * Iterations for slating - */ public final int iterations; /** * Creates new NewPasswordStringData + * * @param saltedPassword Salted password - * @param salt Used salt - * @param clientKey Client key - * @param storedKey Stored key - * @param serverKey Server key - * @param iterations Iterations for slating + * @param salt Used salt + * @param clientKey Client key + * @param storedKey Stored key + * @param serverKey Server key + * @param iterations Iterations for slating */ public NewPasswordStringData(String saltedPassword, String salt, String clientKey, String storedKey, String serverKey, int iterations) { @@ -216,39 +202,22 @@ public NewPasswordStringData(String saltedPassword, String salt, String clientKe */ @SuppressWarnings("unused") public static class NewPasswordByteArrayData { - /** - * Salted password - */ public final byte[] saltedPassword; - /** - * Used salt - */ public final byte[] salt; - /** - * Client key - */ public final byte[] clientKey; - /** - * Stored key - */ public final byte[] storedKey; - /** - * Server key - */ public final byte[] serverKey; - /** - * Iterations for slating - */ public final int iterations; /** * Creates new NewPasswordByteArrayData + * * @param saltedPassword Salted password - * @param salt Used salt - * @param clientKey Client key - * @param storedKey Stored key - * @param serverKey Server key - * @param iterations Iterations for slating + * @param salt Used salt + * @param clientKey Client key + * @param storedKey Stored key + * @param serverKey Server key + * @param iterations Iterations for slating */ public NewPasswordByteArrayData(byte[] saltedPassword, byte[] salt, byte[] clientKey, byte[] storedKey, byte[] serverKey, int iterations) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/StringPrep.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/StringPrep.java index d8e23c87d2d..2ead6eff252 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/StringPrep.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/StringPrep.java @@ -136,7 +136,9 @@ public boolean isCharInClass(int c) { } } - /** A.1 Unassigned code points in Unicode 3.2 */ + /** + * A.1 Unassigned code points in Unicode 3.2 + */ static final CharClass A1 = CharClass.fromRanges(new int[] {0x0221, 0x0221, 0x0234, @@ -930,7 +932,9 @@ public boolean isCharInClass(int c) { 0xE0080, 0xEFFFD}); - /** B.1 Commonly mapped to nothing */ + /** + * B.1 Commonly mapped to nothing + */ static final CharClass B1 = CharClass.fromList(new int[] {0x00AD, 0x034F, 0x1806, @@ -959,10 +963,14 @@ public boolean isCharInClass(int c) { 0xFE0F, 0xFEFF}); - /** C.1.1 ASCII space characters */ + /** + * C.1.1 ASCII space characters + */ static final CharClass C11 = CharClass.fromList(new int[] {0x0020}); - /** C.1.2 Non-ASCII space characters */ + /** + * C.1.2 Non-ASCII space characters + */ static final CharClass C12 = CharClass.fromList(new int[] {0x00A0, 0x1680, 0x2000, @@ -981,7 +989,9 @@ public boolean isCharInClass(int c) { 0x205F, 0x3000}); - /** C.2.1 ASCII control characters */ + /** + * C.2.1 ASCII control characters + */ static final CharClass C21 = CharClass.fromList(new int[] {0x0000, 0x0001, 0x0002, @@ -1016,7 +1026,9 @@ public boolean isCharInClass(int c) { 0x001F, 0x007F}); - /** C.2.2 Non-ASCII control characters */ + /** + * C.2.2 Non-ASCII control characters + */ static final CharClass C22 = CharClass.fromList(new int[] {0x0080, 0x0081, 0x0082, @@ -1080,10 +1092,14 @@ public boolean isCharInClass(int c) { 0x1D179, 0x1D17A}); - /** C.3 Private use */ + /** + * C.3 Private use + */ static final CharClass C3 = CharClass.fromRanges(new int[] {0xE000, 0xF8FF, 0xF0000, 0xFFFFD, 0x100000, 0x10FFFD}); - /** C.4 Non-character code points */ + /** + * C.4 Non-character code points + */ static final CharClass C4 = CharClass.fromRanges(new int[] {0xFDD0, 0xFDEF, 0xFFFE, @@ -1121,13 +1137,19 @@ public boolean isCharInClass(int c) { 0x10FFFE, 0x10FFFF}); - /** C.5 Surrogate codes */ + /** + * C.5 Surrogate codes + */ static final CharClass C5 = CharClass.fromRanges(new int[] {0xD800, 0xDFFF}); - /** C.6 Inappropriate for plain text */ + /** + * C.6 Inappropriate for plain text + */ static final CharClass C6 = CharClass.fromList(new int[] {0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD}); - /** C.7 Inappropriate for canonical representation */ + /** + * C.7 Inappropriate for canonical representation + */ static final CharClass C7 = CharClass.fromList(new int[] {0x2FF0, 0x2FF1, 0x2FF2, @@ -1141,7 +1163,9 @@ public boolean isCharInClass(int c) { 0x2FFA, 0x2FFB}); - /** C.8 Change display properties or are deprecated */ + /** + * C.8 Change display properties or are deprecated + */ static final CharClass C8 = CharClass.fromList(new int[] {0x0340, 0x0341, 0x200E, @@ -1158,10 +1182,14 @@ public boolean isCharInClass(int c) { 0x206E, 0x206F}); - /** C.9 Tagging characters (tuples) */ + /** + * C.9 Tagging characters (tuples) + */ static final CharClass C9 = CharClass.fromRanges(new int[] {0xE0001, 0xE0001, 0xE0020, 0xE007F}); - /** D.1 Characters with bidirectional property "R" or "AL" */ + /** + * D.1 Characters with bidirectional property "R" or "AL" + */ static final CharClass D1 = CharClass.fromRanges(new int[] {0x05BE, 0x05BE, 0x05C0, @@ -1231,7 +1259,9 @@ public boolean isCharInClass(int c) { 0xFE76, 0xFEFC}); - /** D.2 Characters with bidirectional property "L" */ + /** + * D.2 Characters with bidirectional property "L" + */ static final CharClass D2 = CharClass.fromRanges(new int[] {0x0041, 0x005A, 0x0061, @@ -1953,14 +1983,15 @@ public boolean isCharInClass(int c) { 0x100000, 0x10FFFD}); - /** rfc4013 2.3. Prohibited Output */ + /** + * rfc4013 2.3. Prohibited Output + */ static final CharClass saslProhibited = CharClass.fromClasses(C12, C21, C22, C3, C4, C5, C6, C7, C8, C9); - /** A prohibited string has been passed to StringPrep. */ + /** + * A prohibited string has been passed to StringPrep. + */ public abstract static class StringPrepError extends Exception { - /** - * - */ private static final long serialVersionUID = 1L; protected StringPrepError(String message) { @@ -1968,12 +1999,11 @@ protected StringPrepError(String message) { } } - /** A prohibited character was detected. */ + /** + * A prohibited character was detected. + */ @SuppressWarnings({"WeakerAccess", "JavaDoc"}) public static class StringPrepProhibitedCharacter extends StringPrepError { - /** - * - */ private static final long serialVersionUID = 1L; StringPrepProhibitedCharacter() { @@ -1985,12 +2015,11 @@ protected StringPrepProhibitedCharacter(String s) { } } - /** A prohibited unassigned codepoint was detected. */ + /** + * A prohibited unassigned codepoint was detected. + */ @SuppressWarnings("JavaDoc") public static class StringPrepUnassignedCodepoint extends StringPrepProhibitedCharacter { - /** - * - */ private static final long serialVersionUID = 1L; StringPrepUnassignedCodepoint() { @@ -1998,12 +2027,11 @@ public static class StringPrepUnassignedCodepoint extends StringPrepProhibitedCh } } - /** RTL verification has failed, according to rfc3454 section 6. */ + /** + * RTL verification has failed, according to rfc3454 section 6. + */ @SuppressWarnings({"unused", "JavaDoc"}) public static class StringPrepRTLError extends StringPrepError { - /** - * - */ private static final long serialVersionUID = 1L; StringPrepRTLError() { @@ -2013,25 +2041,16 @@ public static class StringPrepRTLError extends StringPrepError { public static class StringPrepRTLErrorBothRALandL extends StringPrepRTLError { - /** - * - */ private static final long serialVersionUID = 1L; } public static class StringPrepRTLErrorRALWithoutPrefix extends StringPrepRTLError { - /** - * - */ private static final long serialVersionUID = 1L; } public static class StringPrepRTLErrorRALWithoutSuffix extends StringPrepRTLError { - /** - * - */ private static final long serialVersionUID = 1L; } @@ -2092,7 +2111,9 @@ protected static void verifyRTL(String s) throws StringPrepRTLError { } } - /** Apply SASLPrep and return the result. {@code} is treated as a stored string. */ + /** + * Apply SASLPrep and return the result. {@code} is treated as a stored string. + */ public static String prepAsStoredString(String s) throws StringPrepError { s = prepAsQueryString(s); @@ -2107,7 +2128,9 @@ public static String prepAsStoredString(String s) throws StringPrepError { return s; } - /** Apply SASLPrep and return the result. {@code} is treated as a query string. */ + /** + * Apply SASLPrep and return the result. {@code} is treated as a query string. + */ public static String prepAsQueryString(String s) throws StringPrepError { // 1) Map // rfc4013: 2.1. Mapping diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/UserData.java b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/UserData.java index 4f6104df8d1..aa84ec4a210 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/UserData.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/scram/UserData.java @@ -20,30 +20,11 @@ * Wrapper for user data needed for the SCRAM authentication */ public class UserData { - /** - * Salt - */ public final String salt; - /** - * Iterations used to salt the password - */ public final int iterations; - /** - * Server key - */ public final String serverKey; - /** - * Stored key - */ public final String storedKey; - /** - * Creates new UserData - * @param salt Salt - * @param iterations Iterations for salting - * @param serverKey Server key - * @param storedKey Stored key - */ public UserData(String salt, int iterations, String serverKey, String storedKey) { this.salt = salt; this.iterations = iterations; 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 926ebf676aa..6b9fef9cecc 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 @@ -2431,7 +2431,6 @@ public void testSecuritySettingPluginFromBrokerProperties() throws Exception { /** * To test ARTEMIS-926 - * @throws Throwable */ @Test public void testSetSystemPropertyCME() throws Throwable { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationValidationTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationValidationTest.java index 6aa363ffbab..4793a4c1c7c 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationValidationTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationValidationTest.java @@ -43,8 +43,8 @@ public class ConfigurationValidationTest extends ServerTestBase { } /** - * test does not pass in eclipse (because it can not find artemis-configuration.xsd). - * It runs fine on the CLI with the proper env setting. + * test does not pass in eclipse (because it can not find artemis-configuration.xsd). It runs fine on the CLI with + * the proper env setting. */ @Test public void testMinimalConfiguration() throws Exception { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java index 2b81f381c89..2003207dc80 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationParserTest.java @@ -117,14 +117,12 @@ public class FileConfigurationParserTest extends ServerTestBase { """; /** - * These "InvalidConfigurationTest*.xml" files are modified copies of {@value - * ConfigurationTest-full-config.xml}, so just diff it for changes, e.g. + * These "InvalidConfigurationTest*.xml" files are modified copies of {@literal ConfigurationTest-full-config.xml}, + * so just diff it for changes, e.g. *

                      *

                           * diff ConfigurationTest-full-config.xml InvalidConfigurationTest4.xml
                           * 
                      - * - * @throws Exception */ @Test public void testSchemaValidation() throws Exception { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/WrongRoleFileConfigurationParserTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/WrongRoleFileConfigurationParserTest.java index 01f375b602c..e5e6eac4ba9 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/WrongRoleFileConfigurationParserTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/WrongRoleFileConfigurationParserTest.java @@ -27,8 +27,11 @@ import org.junit.jupiter.api.Test; /** - * When running this test from an IDE add this to the test command line so that the AssertionLoggerHandler works properly: - * -Dlog4j2.configurationFile=file:/tests/config/log4j2-tests-config.properties + * When running this test from an IDE add this to the test command line so that the {@link AssertionLoggerHandler} works + * properly: + *
                      + * -Dlog4j2.configurationFile=file:${path-to-source}/tests/config/log4j2-tests-config.properties
                      + * 
                      */ public class WrongRoleFileConfigurationParserTest extends ServerTestBase { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/filter/impl/FilterTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/filter/impl/FilterTest.java index a5d901a2bc3..6dc639df14a 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/filter/impl/FilterTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/filter/impl/FilterTest.java @@ -725,7 +725,6 @@ public void testStringLikePunctuation() throws Exception { // FilterParser parse = new FilterParser(); // SimpleStringReader reader = new SimpleStringReader(SimpleString.of(largeString)); // parse.ReInit(reader); - // // the server would fail at doing this when HORNETQ-545 wasn't solved // parse.getNextToken(); // } diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandlerTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandlerTest.java index 8aa5a060574..a23d0f27318 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandlerTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandlerTest.java @@ -25,9 +25,6 @@ import static org.mockito.Mockito.spy; -/** - * HttpAcceptorHandlerTest - */ @ExtendWith(MockitoExtension.class) public class HttpAcceptorHandlerTest { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/NoCacheLoginModule.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/NoCacheLoginModule.java index 7cf2272d964..2e42a332bb8 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/NoCacheLoginModule.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/security/jaas/NoCacheLoginModule.java @@ -1,20 +1,21 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.core.security.jaas; import javax.security.auth.Subject; diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/cluster/impl/BroadcastGroupImplTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/cluster/impl/BroadcastGroupImplTest.java index 37d28980504..1afd107d8da 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/cluster/impl/BroadcastGroupImplTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/cluster/impl/BroadcastGroupImplTest.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; /** - * Test the {@link BroadcastGroupImpl}.
                      + * Test the {@link BroadcastGroupImpl}. */ public class BroadcastGroupImplTest extends ServerTestBase { @@ -88,14 +88,14 @@ public byte[] receiveBroadcast(long time, TimeUnit unit) throws Exception { } /** - * Test the broadcasted packages length.
                      - * Broadcast and MultiCast techniques are commonly limited in size by - * underlying hardware. Broadcast and MultiCast protocols are typically not - * guaranteed (UDP) and as such large packages may be silently discarded by - * underlying hardware.
                      - * This test validates that Artemis Server does not broadcast packages above - * a size of 1500 bytes. The limit is not derived from any normative - * documents, but is rather derived from common MTU for network equipment. + * Test the broadcasted packages length. + *

                      + * Broadcast and MultiCast techniques are commonly limited in size by underlying hardware. Broadcast and MultiCast + * protocols are typically not guaranteed (UDP) and as such large packages may be silently discarded by underlying + * hardware. + *

                      + * This test validates that Artemis Server does not broadcast packages above a size of 1500 bytes. The limit is not + * derived from any normative documents, but is rather derived from common MTU for network equipment. */ @Test public void testBroadcastDatagramLength() throws Throwable { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java index 3358d477b52..663168d48c3 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/embedded/MainTest.java @@ -30,8 +30,10 @@ public class MainTest { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /* Tests what happens when no workdir arg is given and the default can't - * be accessed as not in container env, expect to throw IOE. */ + /* + * Tests what happens when no workdir arg is given and the default can't be accessed as not in container env, expect + * to throw IOE. + */ @Test @Timeout(5) public void testNull() throws Exception { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java index ae9b902c7bf..e9fd36c8683 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java @@ -69,9 +69,8 @@ import org.junit.jupiter.api.Test; /** - * this is testing the case for resending notifications from RemotingGroupHandler - * There is a small window where you could receive notifications wrongly - * this test will make sure the component would play well with that notification + * this is testing the case for resending notifications from RemotingGroupHandler There is a small window where you + * could receive notifications wrongly this test will make sure the component would play well with that notification */ public class ClusteredResetMockTest extends ServerTestBase { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoderTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoderTest.java index 771194260b6..261e0e5b749 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoderTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketFrameEncoderTest.java @@ -45,9 +45,6 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -/** - * WebSocketContinuationFrameEncoderTest - */ @ExtendWith(MockitoExtension.class) public class WebSocketFrameEncoderTest { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketServerHandlerTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketServerHandlerTest.java index cecf7dfe940..7ff3d28906e 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketServerHandlerTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketServerHandlerTest.java @@ -36,9 +36,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; -/** - * WebSocketServerHandlerTest - */ @ExtendWith(MockitoExtension.class) public class WebSocketServerHandlerTest { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java index ad9d6fbbc7b..7ff4cab876a 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/RepositoryTest.java @@ -73,8 +73,9 @@ public void testMatchingDocs() throws Throwable { assertEquals("abd#", repo.getMatch("a.b.d")); } - /* - * A "literal" match is one which uses wild-cards but should not be applied to other matches "below" it in the hierarchy. + /** + * A "literal" match is one which uses wild-cards but should not be applied to other matches "below" it in the + * hierarchy. */ @Test public void testLiteral() { diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServerTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServerTestBase.java index 4225d4a7b4e..ac62c5ad04b 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServerTestBase.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ServerTestBase.java @@ -246,11 +246,6 @@ protected Configuration createDefaultConfig(final int serverID, final boolean ne return configuration; } - /** - * @param serverID - * @return - * @throws Exception - */ protected ConfigurationImpl createBasicConfig(final int serverID) { ConfigurationImpl configuration = new ConfigurationImpl().setSecurityEnabled(false).setJournalMinFiles(2).setJournalFileSize(100 * 1024).setJournalType(getDefaultJournalType()).setJournalDirectory(getJournalDir(serverID, false)).setBindingsDirectory(getBindingsDir(serverID, false)).setPagingDirectory(getPageDir(serverID, false)).setLargeMessagesDirectory(getLargeMessagesDir(serverID, false)).setJournalCompactMinFiles(0).setJournalCompactPercentage(0).setClusterPassword(CLUSTER_PASSWORD).setJournalDatasync(false); @@ -274,8 +269,10 @@ protected DatabaseStorageConfiguration createDefaultDatabaseStorageConfiguration DatabaseStorageConfiguration dbStorageConfiguration = new DatabaseStorageConfiguration(); String connectionURI = getTestJDBCConnectionUrl(); - /** The connectionURI could be passed into the testsuite as a system property (say you are testing against Oracle). - * So, we only schedule the drop on Derby if we are using a derby memory database */ + /* + * The connectionURI could be passed into the testsuite as a system property (say you are testing against Oracle). + * So, we only schedule the drop on Derby if we are using a derby memory database + */ if (connectionURI.contains("derby") && connectionURI.contains("memory") && !derbyDropped) { // some tests will reinitialize the server and call this method more than one time // and we should only schedule one task @@ -386,9 +383,6 @@ protected void recreateDataDirectories(String testDir1, int index, boolean backu recreateDirectory(getTemporaryDir(testDir1)); } - /** - * @return the journalDir - */ public String getJournalDir() { return getJournalDir(0, false); } @@ -405,23 +399,14 @@ public static String getJournalDir(final String testDir, final int index, final return getJournalDir(testDir) + directoryNameSuffix(index, backup); } - /** - * @return the bindingsDir - */ protected String getBindingsDir() { return getBindingsDir(0, false); } - /** - * @return the bindingsDir - */ protected static String getBindingsDir(final String testDir1) { return testDir1 + "/bindings"; } - /** - * @return the bindingsDir - */ protected String getBindingsDir(final int index, final boolean backup) { return getBindingsDir(getTestDir(), index, backup); } @@ -430,9 +415,6 @@ public static String getBindingsDir(final String testDir, final int index, final return getBindingsDir(testDir) + directoryNameSuffix(index, backup); } - /** - * @return the pageDir - */ protected String getPageDir() { return getPageDir(0, false); } @@ -442,9 +424,6 @@ protected File getPageDirFile() { } - /** - * @return the pageDir - */ protected static String getPageDir(final String testDir1) { return testDir1 + "/page"; } @@ -457,16 +436,10 @@ public static String getPageDir(final String testDir, final int index, final boo return getPageDir(testDir) + directoryNameSuffix(index, backup); } - /** - * @return the largeMessagesDir - */ protected String getLargeMessagesDir() { return getLargeMessagesDir(0, false); } - /** - * @return the largeMessagesDir - */ protected static String getLargeMessagesDir(final String testDir1) { return testDir1 + "/large-msg"; } @@ -485,23 +458,14 @@ private static String directoryNameSuffix(int index, boolean backup) { return index + "-" + (backup ? "B" : "L"); } - /** - * @return the clientLargeMessagesDir - */ protected String getClientLargeMessagesDir(final String testDir1) { return testDir1 + "/client-large-msg"; } - /** - * @return the temporaryDir - */ protected final String getTemporaryDir() { return getTemporaryDir(getTestDir()); } - /** - * @return the temporaryDir - */ protected String getTemporaryDir(final String testDir1) { return testDir1 + "/temp"; } diff --git a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/ServiceUtils.java b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/ServiceUtils.java index 7213b74b6d5..882beeee77b 100644 --- a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/ServiceUtils.java +++ b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/ServiceUtils.java @@ -66,7 +66,8 @@ public static void setTransactionManager(TransactionManager tm) { } /** - * Find the first transaction manager loaded from the {@code TransactionManagerLocator} service or {@code null} if none is loaded. + * Find the first transaction manager loaded from the {@code TransactionManagerLocator} service or + * {@code null} if none is loaded. */ private static TransactionManager findTransactionManager() { return AccessController.doPrivileged((PrivilegedAction) () -> { @@ -79,8 +80,8 @@ private static TransactionManager findTransactionManager() { } /** - * Find the first wrapper factory loaded from the {@code ActiveMQXAResourceWrapperFactory} service or - * use the default {@code ActiveMQXAResourceWrapperFactoryImpl} if none is loaded. + * Find the first wrapper factory loaded from the {@code ActiveMQXAResourceWrapperFactory} service or use + * the default {@code ActiveMQXAResourceWrapperFactoryImpl} if none is loaded. */ private static ActiveMQXAResourceWrapperFactory findActiveMQXAResourceWrapperFactory() { return AccessController.doPrivileged((PrivilegedAction) () -> { diff --git a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/ActiveMQXAResourceWrapperImpl.java b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/ActiveMQXAResourceWrapperImpl.java index e1c182abfa5..a09b8230b42 100644 --- a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/ActiveMQXAResourceWrapperImpl.java +++ b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/ActiveMQXAResourceWrapperImpl.java @@ -36,11 +36,8 @@ public class ActiveMQXAResourceWrapperImpl implements ActiveMQXAResourceWrapper /** * Creates a new XAResourceWrapper. PRODUCT_NAME, productVersion and jndiName are useful for log output in the - * Transaction Manager. For ActiveMQ Artemis only the resourceManagerID is required to allow Transaction Manager to recover - * from relevant recovery scenarios. - * - * @param xaResource - * @param properties + * Transaction Manager. For ActiveMQ Artemis only the resourceManagerID is required to allow Transaction Manager to + * recover from relevant recovery scenarios. */ public ActiveMQXAResourceWrapperImpl(XAResource xaResource, Map properties) { this.xaResource = xaResource; 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 5a90b266e52..1f75aa441c7 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 @@ -28,8 +28,8 @@ /** * A XAResourceRecovery instance that can be used to recover any JMS provider. *

                      - * In reality only recover, rollback and commit will be called but we still need to be implement all - * methods just in case. + * In reality only recover, rollback and commit will be called but we still need to be implement all methods just in + * case. *

                      * To enable this add the following to the jbossts-properties file *

                      @@ -89,15 +89,13 @@ public boolean hasMoreResources() {
                             /*
                              * The way hasMoreResources is supposed to work is as follows:
                              * For each "sweep" the recovery manager will call hasMoreResources, then if it returns
                      -       * true it will call getXAResource.
                      +       * {@code true} it will call getXAResource.
                              * It will repeat that until hasMoreResources returns false.
                              * Then the sweep is over.
                      -       * For the next sweep hasMoreResources should return true, etc.
                      +       * For the next sweep hasMoreResources should return {@code true}, etc.
                              *
                              * In our case where we only need to return one XAResource per sweep,
                      -       * hasMoreResources should basically alternate between true and false.
                      -       *
                      -       *
                      +       * hasMoreResources should basically alternate between {@code true} and false.
                              */
                       
                             hasMore = !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 029a6b14922..d48e8fc74fa 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
                      @@ -35,20 +35,17 @@
                       
                       /**
                        * XAResourceWrapper.
                      - *
                      + * 

                      * Mainly from org.jboss.server.XAResourceWrapper from the JBoss AS server module - * - * The reason why we don't use that class directly is that it assumes on failure of connection - * the RM_FAIL or RM_ERR is thrown, but in ActiveMQ Artemis we throw XA_RETRY since we want the recovery manager to be able - * to retry on failure without having to manually retry + *

                      + * The reason why we don't use that class directly is that it assumes on failure of connection the RM_FAIL or RM_ERR is + * thrown, but in ActiveMQ Artemis we throw XA_RETRY since we want the recovery manager to be able to retry on failure + * without having to manually retry */ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureListener { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /** - * The state lock - */ private static final Object lock = new Object(); private ServerLocator serverLocator; @@ -323,9 +320,6 @@ protected XAResource connect() throws Exception { throw new ActiveMQNotConnectedException(); } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { return "ActiveMQXAResourceWrapper [serverLocator=" + serverLocator + @@ -382,8 +376,8 @@ public void close() { } /** - * Check whether an XAException is fatal. If it is an RM problem - * we close the connection so the next call will reconnect. + * Check whether an XAException is fatal. If it is an RM problem we close the connection so the next call will + * reconnect. * * @param e the xa exception * @return never diff --git a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/XARecoveryConfig.java b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/XARecoveryConfig.java index 83637e7cdda..2e49d830591 100644 --- a/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/XARecoveryConfig.java +++ b/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/XARecoveryConfig.java @@ -234,9 +234,6 @@ public boolean equals(Object obj) { return true; } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { StringBuilder builder = new StringBuilder(); diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/logs/AssertionLoggerHandler.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/logs/AssertionLoggerHandler.java index 457d89dbeea..0290d67a8c1 100644 --- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/logs/AssertionLoggerHandler.java +++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/logs/AssertionLoggerHandler.java @@ -36,10 +36,9 @@ /** * This class contains a tool where programs could intercept for LogMessage - * + *

                      * Be careful with this use as this is intended for testing only (such as testcases) */ - public class AssertionLoggerHandler extends AbstractAppender implements Closeable { private final Deque messages = new ConcurrentLinkedDeque<>(); @@ -81,9 +80,6 @@ public void close() throws IOException { /** * is there any record matching Level? - * - * @param level - * @return */ public boolean hasLevel(LogLevel level) { Level implLevel = level.toImplLevel(); @@ -111,9 +107,6 @@ public static LogLevel setLevel(String loggerName, LogLevel level) { /** * Find a line that contains the parameters passed as an argument - * - * @param text - * @return */ public boolean findText(final String... text) { for (LogEntry logEntry : messages) { @@ -136,9 +129,6 @@ public boolean findText(final String... text) { /** * Find a stacktrace that contains the parameters passed as an argument - * - * @param trace - * @return */ public boolean findTrace(final String trace) { for (LogEntry logEntry : messages) { @@ -235,8 +225,8 @@ public String getLoggerName() { /** * Only useful if {@link AssertionLoggerHandler} was created with - * {@link AssertionLoggerHandler#AssertionLoggerHandler(boolean captureStackTrace)} - * to enable StackTrace collection. + * {@link AssertionLoggerHandler#AssertionLoggerHandler(boolean captureStackTrace)} to enable StackTrace + * collection. */ public String getStackTrace() { return stackTrace; diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/SubjectDotDoAsExtension.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/SubjectDotDoAsExtension.java index dcb638a7214..3f193541029 100644 --- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/SubjectDotDoAsExtension.java +++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/SubjectDotDoAsExtension.java @@ -1,20 +1,21 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *

                      - * http://www.apache.org/licenses/LICENSE-2.0 - *

                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.extensions; import javax.security.auth.Subject; diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/TestMethodNameMatchExtension.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/TestMethodNameMatchExtension.java index 20c98c1e593..afe79c46710 100644 --- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/TestMethodNameMatchExtension.java +++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/TestMethodNameMatchExtension.java @@ -27,10 +27,10 @@ /** * Extension to check for specific method name(s) about run. - * - * Useful in subclasses where a determination must be made before the method, for use by utility - * code executed 'early' due to BeforeEach activity triggered by a superclass, before any local - * BeforeEach implementation can run and check the method name. + *

                      + * Useful in subclasses where a determination must be made before the method, for use by utility code executed 'early' + * due to BeforeEach activity triggered by a superclass, before any local BeforeEach implementation can run and check + * the method name. */ public class TestMethodNameMatchExtension implements BeforeEachCallback, Extension { diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/ThreadLeakCheckDelegate.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/ThreadLeakCheckDelegate.java index a63afb48dea..1a95258540d 100644 --- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/ThreadLeakCheckDelegate.java +++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/ThreadLeakCheckDelegate.java @@ -216,9 +216,6 @@ private String checkThread() { /** * if it's an expected thread... we will just move along ignoring it - * - * @param thread - * @return */ private boolean isExpectedThread(Thread thread) { final String threadName = thread.getName(); diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/parameterized/ParameterizedTestExtension.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/parameterized/ParameterizedTestExtension.java index 28a6f0d875b..06da9b5a5f6 100644 --- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/parameterized/ParameterizedTestExtension.java +++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/extensions/parameterized/ParameterizedTestExtension.java @@ -45,10 +45,10 @@ import java.util.stream.Stream; /** - * This extension is used to implement parameterized tests classes for JUnit 5 via - * the TestTemplate mechanism, replace parameterized test runner from JUnit4 while - * avoiding the per-method parameterization currently available from Junit 5. - * + * This extension is used to implement parameterized tests classes for JUnit 5 via the TestTemplate mechanism, replace + * parameterized test runner from JUnit4 while avoiding the per-method parameterization currently available from Junit + * 5. + *

                      * When using this extension, all tests must be annotated by {@link TestTemplate}. */ public class ParameterizedTestExtension implements TestTemplateInvocationContextProvider { diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ArtemisTestCase.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ArtemisTestCase.java index e0d5fce98b9..7fa2e71e864 100644 --- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ArtemisTestCase.java +++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ArtemisTestCase.java @@ -69,7 +69,7 @@ public interface TestCompletionTask { /** * Use this method to cleanup your resources by passing a TestCleanupTask. - * + *

                      * Exceptions thrown from your tasks will just be logged and not passed as failures. * * @param completionTask A TestCleanupTask that will be passed, possibly from a lambda @@ -87,10 +87,10 @@ protected void runAfter(TestCompletionTask completionTask) { /** * Use this method to cleanup your resources and validating exceptional results by passing a TestCompletionTask. - * - * An exception thrown from a task will be thrown to JUnit. If more than one task is present, all tasks will be - * be executed, however only the exception of the first one will then be thrown the JUnit runner. All will be - * logged as they occur. + *

                      + * An exception thrown from a task will be thrown to JUnit. If more than one task is present, all tasks will be be + * executed, however only the exception of the first one will then be thrown the JUnit runner. All will be logged as + * they occur. * * @param completionTask A TestCompletionTask that will be passed, possibly from a lambda method */ diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/SilentTestCase.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/SilentTestCase.java index 39b5ae3d6e0..ea2290ca910 100644 --- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/SilentTestCase.java +++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/SilentTestCase.java @@ -25,8 +25,7 @@ /** * Test case that hijacks sys-out and sys-err. *

                      - * It is meant to avoid cluttering either during test execution when the tested code (expectedly) - * writes to these. + * It is meant to avoid cluttering either during test execution when the tested code (expectedly) writes to these. */ public abstract class SilentTestCase { diff --git a/artemis-web/src/main/java/org/apache/activemq/artemis/component/AuthenticationFilter.java b/artemis-web/src/main/java/org/apache/activemq/artemis/component/AuthenticationFilter.java index 25b46dc24ef..1e43406158c 100644 --- a/artemis-web/src/main/java/org/apache/activemq/artemis/component/AuthenticationFilter.java +++ b/artemis-web/src/main/java/org/apache/activemq/artemis/component/AuthenticationFilter.java @@ -30,9 +30,9 @@ import org.eclipse.jetty.server.Response; import org.eclipse.jetty.server.Session; -/* -* This filter intercepts the login and audits its results -* */ +/** + * This filter intercepts the login and audits its results + */ public class AuthenticationFilter implements Filter { @Override public void init(FilterConfig filterConfig) { diff --git a/artemis-web/src/main/java/org/apache/activemq/artemis/component/JolokiaFilter.java b/artemis-web/src/main/java/org/apache/activemq/artemis/component/JolokiaFilter.java index c87e97f8018..e86f95d8a0b 100644 --- a/artemis-web/src/main/java/org/apache/activemq/artemis/component/JolokiaFilter.java +++ b/artemis-web/src/main/java/org/apache/activemq/artemis/component/JolokiaFilter.java @@ -29,9 +29,9 @@ import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Session; -/* -* This intercepts all calls made via jolokia -* */ +/** + * This intercepts all calls made via jolokia + */ public class JolokiaFilter implements Filter { @Override public void init(FilterConfig filterConfig) { @@ -40,18 +40,18 @@ public void init(FilterConfig filterConfig) { @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { /* - * this is the only place we can catch the remote address of the calling console client thru Jolokia. - * We set the address on the calling thread which will end up in JMX audit logging - * */ + * This is the only place we can catch the remote address of the calling console client thru Jolokia. We set the + * address on the calling thread which will end up in JMX audit logging. + */ if (AuditLogger.isAnyLoggingEnabled() && servletRequest != null) { String remoteHost = servletRequest.getRemoteHost(); AuditLogger.setRemoteAddress(remoteHost + ":" + servletRequest.getRemotePort()); } filterChain.doFilter(servletRequest, servletResponse); /* - * This is the only place we can get access to the authenticated subject on invocations after the login has happened. - * we set the subject for audit logging - * */ + * This is the only place we can get access to the authenticated subject on invocations after the login has + * happened. We set the subject for audit logging. + */ if (AuditLogger.isAnyLoggingEnabled()) { try { Session session = ((Request) servletRequest).getSession(true); 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 a3219cec603..028746cfe3b 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 @@ -461,7 +461,7 @@ public boolean isStarted() { } /** - * @return started server's port number; useful if it was specified as 0 (to use a random port) + * {@return started server's port number; useful if it was specified as 0 (to use a random port)} */ @Deprecated public int getPort() { diff --git a/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerCLITest.java b/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerCLITest.java index 29b52607b30..00bfc5d8389 100644 --- a/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerCLITest.java +++ b/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerCLITest.java @@ -84,9 +84,7 @@ public void testStopEmbeddedWebServerOnCriticalIOError() throws Exception { ActiveMQServer activeMQServer = ((Pair) result).getB(); List externalComponents = activeMQServer.getExternalComponents(); - /** - * simulate critical IO error as this is what is eventually called by org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.ShutdownOnCriticalErrorListener - */ + // simulate critical IO error as this is what is eventually called by org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.ShutdownOnCriticalErrorListener ((ActiveMQServerImpl) activeMQServer).stop(false, true, false); for (ActiveMQComponent externalComponent : externalComponents) { diff --git a/docs/hacking-guide/_formatting.adoc b/docs/hacking-guide/_formatting.adoc index 1b8d6220eee..824cc2434a4 100644 --- a/docs/hacking-guide/_formatting.adoc +++ b/docs/hacking-guide/_formatting.adoc @@ -20,3 +20,7 @@ Do not use the https://maven.apache.org/plugins/maven-eclipse-plugin/[maven-ecli For editors supporting http://editorconfig.org/[EditorConfig], a settings file is provided in etc/ide-settings/editorconfig.ini. Copy it to your Artemis top level directory and http://editorconfig.org/#file-location[name it .editorconfig] + +== JavaDoc + +There's no formal enforcement of the JavaDoc style \ No newline at end of file diff --git a/etc/checkstyle.xml b/etc/checkstyle.xml index 94fc26b5f5a..5162446b734 100644 --- a/etc/checkstyle.xml +++ b/etc/checkstyle.xml @@ -38,6 +38,17 @@ under the License. + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index f73ae80180b..d995780e89b 100644 --- a/pom.xml +++ b/pom.xml @@ -328,7 +328,7 @@ -Xdiags:verbose -XDcompilePolicy=simple - -Xplugin:ErrorProne -Xep:ThreadLocalUsage:ERROR -Xep:MissingOverride:ERROR -Xep:NonAtomicVolatileUpdate:ERROR -Xep:SynchronizeOnNonFinalField:ERROR -Xep:StaticQualifiedUsingExpression:ERROR -Xep:WaitNotInLoop:ERROR -Xep:BanJNDI:OFF -XepExcludedPaths:.*/generated-sources/.* + -Xplugin:ErrorProne -Xep:ThreadLocalUsage:ERROR -Xep:MissingOverride:ERROR -Xep:NonAtomicVolatileUpdate:ERROR -Xep:SynchronizeOnNonFinalField:ERROR -Xep:StaticQualifiedUsingExpression:ERROR -Xep:WaitNotInLoop:ERROR -Xep:BanJNDI:OFF -Xep:DepAnn -Xep:AnnotationPosition -Xep:UnescapedEntity -XepExcludedPaths:.*/generated-sources/.* -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java index 9e624c1fe28..9a08ad7efaf 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java @@ -71,9 +71,8 @@ import org.slf4j.LoggerFactory; /** - * Manages the life-cycle of an ActiveMQ Broker. A BrokerService consists of a - * number of transport connectors, network connectors and a bunch of properties - * which can be used to configure the broker as its lazily created. + * Manages the life-cycle of an ActiveMQ Broker. A BrokerService consists of a number of transport connectors, network + * connectors and a bunch of properties which can be used to configure the broker as its lazily created. */ public class BrokerService implements Service { diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/SslBrokerService.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/SslBrokerService.java index 3eefc9d14c3..386cd2da07d 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/SslBrokerService.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/SslBrokerService.java @@ -26,13 +26,9 @@ import org.apache.activemq.transport.TransportServer; /** - * A BrokerService that allows access to the key and trust managers used by SSL - * connections. There is no reason to use this class unless SSL is being used - * AND the key and trust managers need to be specified from within code. In - * fact, if the URI passed to this class does not have an "ssl" scheme, this - * class will pass all work on to its superclass. - * - * @author sepandm@gmail.com (Sepand) + * A BrokerService that allows access to the key and trust managers used by SSL connections. There is no reason to use + * this class unless SSL is being used AND the key and trust managers need to be specified from within code. In fact, if + * the URI passed to this class does not have an "ssl" scheme, this class will pass all work on to its superclass. */ public class SslBrokerService extends BrokerService { diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/InVMNameParser.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/InVMNameParser.java index d92c2774a3b..7f03945be3d 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/InVMNameParser.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/InVMNameParser.java @@ -23,14 +23,10 @@ import java.io.Serializable; import java.util.Properties; -/** - * @author Ovidiu Feodorov - */ public class InVMNameParser implements NameParser, Serializable { private static final long serialVersionUID = 2925203703371001031L; - static Properties syntax; static { @@ -40,8 +36,6 @@ public class InVMNameParser implements NameParser, Serializable { InVMNameParser.syntax.put("jndi.syntax.separator", "/"); } - - public static Properties getSyntax() { return InVMNameParser.syntax; } @@ -50,5 +44,4 @@ public static Properties getSyntax() { public Name parse(final String name) throws NamingException { return new CompoundName(name, InVMNameParser.syntax); } - } diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/NonSerializableFactory.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/NonSerializableFactory.java index 7dc42afdd9b..9d43012e509 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/NonSerializableFactory.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/NonSerializableFactory.java @@ -27,12 +27,8 @@ import java.util.Hashtable; import java.util.Map; -//import org.jboss.util.naming.Util; - /** * used by the default context when running in embedded local configuration - * - * @author Andy Taylor */ public class NonSerializableFactory implements ObjectFactory { diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/usage/SystemUsage.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/usage/SystemUsage.java index a536c98c081..673a2809a5e 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/usage/SystemUsage.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/usage/SystemUsage.java @@ -38,8 +38,7 @@ public class SystemUsage implements Service { private String checkLimitsLogLevel = "warn"; /** - * True if someone called setSendFailIfNoSpace() on this particular usage - * manager + * True if someone called setSendFailIfNoSpace() on this particular usage manager */ private boolean sendFailIfNoSpaceExplicitySet; private boolean sendFailIfNoSpace; @@ -84,30 +83,18 @@ public String getName() { return name; } - /** - * @return the memoryUsage - */ public MemoryUsage getMemoryUsage() { return this.memoryUsage; } - /** - * @return the storeUsage - */ public StoreUsage getStoreUsage() { return this.storeUsage; } - /** - * @return the tempDiskUsage - */ public TempUsage getTempUsage() { return this.tempUsage; } - /** - * @return the schedulerUsage - */ public JobSchedulerUsage getJobSchedulerUsage() { return this.jobSchedulerUsage; } @@ -250,16 +237,10 @@ public void setJobSchedulerUsage(JobSchedulerUsage jobSchedulerUsage) { this.jobSchedulerUsage.setExecutor(getExecutor()); } - /** - * @return the executor - */ public ThreadPoolExecutor getExecutor() { return this.executor; } - /** - * @param executor the executor to set - */ public void setExecutor(ThreadPoolExecutor executor) { this.executor = executor; if (this.memoryUsage != null) { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java index 688897f6f8c..0bd1258481d 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java @@ -33,18 +33,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * ActiveMQMessageAuditTest - */ public class ActiveMQMessageAuditTest extends TestCase { static final Logger LOG = LoggerFactory.getLogger(ActiveMQMessageAuditTest.class); - /** - * Constructor for ActiveMQMessageAuditTest. - * - * @param name - */ public ActiveMQMessageAuditTest(String name) { super(name); } @@ -62,10 +54,7 @@ protected void tearDown() throws Exception { super.tearDown(); } - /** - * test case for isDuplicate - */ - public void testIsDuplicateString() { + public void testIsDuplicateString() { int count = 10000; ActiveMQMessageAudit audit = new ActiveMQMessageAudit(); IdGenerator idGen = new IdGenerator(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/AutoFailTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/AutoFailTestSupport.java index e3e96f02a8d..53a59dd873a 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/AutoFailTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/AutoFailTestSupport.java @@ -26,10 +26,7 @@ import org.slf4j.LoggerFactory; /** - * Enforces a test case to run for only an allotted time to prevent them from - * hanging and breaking the whole testing. - * - * + * Enforces a test case to run for only an allotted time to prevent them from hanging and breaking the whole testing. */ public abstract class AutoFailTestSupport extends TestCase { @@ -63,10 +60,9 @@ protected void tearDown() throws Exception { } /** - * Manually start the auto fail thread. To start it automatically, just set - * the auto fail to true before calling any setup methods. As a rule, this - * method is used only when you are not sure, if the setUp and tearDown - * method is propagated correctly. + * Manually start the auto fail thread. To start it automatically, just set the auto fail to true before calling any + * setup methods. As a rule, this method is used only when you are not sure, if the setUp and tearDown method is + * propagated correctly. */ public void startAutoFailThread() { setAutoFail(true); @@ -102,9 +98,8 @@ public void startAutoFailThread() { } /** - * Manually stops the auto fail thread. As a rule, this method is used only - * when you are not sure, if the setUp and tearDown method is propagated - * correctly. + * Manually stops the auto fail thread. As a rule, this method is used only when you are not sure, if the setUp and + * tearDown method is propagated correctly. */ public void stopAutoFailThread() { if (isAutoFail() && autoFailThread != null && autoFailThread.isAlive()) { @@ -120,11 +115,8 @@ public void stopAutoFailThread() { } /** - * Sets the auto fail value. As a rule, this should be used only before any - * setup methods is called to automatically enable the auto fail thread in - * the setup method of the test case. - * - * @param val + * Sets the auto fail value. As a rule, this should be used only before any setup methods is called to automatically + * enable the auto fail thread in the setup method of the test case. */ public void setAutoFail(boolean val) { this.useAutoFail = val; @@ -135,10 +127,8 @@ public boolean isAutoFail() { } /** - * The assigned value will only be reflected when the auto fail thread has - * started its run. Value is in milliseconds. - * - * @param val + * The assigned value will only be reflected when the auto fail thread has started its run. Value is in + * milliseconds. */ public void setMaxTestTime(long val) { this.maxTestTime = val; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java index 8dfe8fb1e99..9119efeb015 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/CombinationTestSupport.java @@ -43,25 +43,24 @@ import org.slf4j.LoggerFactory; /** - * Poor mans way of getting JUnit to run a test case through a few different - * combinations of options. Usage: If you have a test case called testFoo what - * you want to run through a few combinations, of of values for the attributes - * age and color, you would something like: + * Poor mans way of getting JUnit to run a test case through a few different combinations of options. Usage: If you have + * a test case called testFoo what you want to run through a few combinations, of of values for the attributes age and + * color, you would something like: + *

                      {@code
                        * public void initCombosForTestFoo() {
                      - * addCombinationValues( "age", new Object[]{ new Integer(21), new Integer(30) } );
                      - * addCombinationValues( "color", new Object[]{"blue", "green"} );
                      + *    addCombinationValues( "age", new Object[]{ new Integer(21), new Integer(30) } );
                      + *    addCombinationValues( "color", new Object[]{"blue", "green"} );
                        * }
                      - * 
                      - * The testFoo test case would be run for each possible combination of age and
                      - * color that you setup in the initCombosForTestFoo method. Before each
                      - * combination is run, the age and color fields of the test class are set to one
                      - * of the values defined. This is done before the normal setUp method is called.
                      - * If you want the test combinations to show up as separate test runs in the
                      - * JUnit reports, add a suite method to your test case similar to: 
                      + * }
                      + * The testFoo test case would be run for each possible combination of age and color that you setup in the + * initCombosForTestFoo method. Before each combination is run, the age and color fields of the test class are set to + * one of the values defined. This is done before the normal setUp method is called. If you want the test combinations + * to show up as separate test runs in the JUnit reports, add a suite method to your test case similar to: + *
                      {@code
                        * public static Test suite() {
                      - * return suite(FooTest.class);
                      + *    return suite(FooTest.class);
                        * }
                      - * 
                      + * }
                      */ public abstract class CombinationTestSupport extends AutoFailTestSupport { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCleanupTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCleanupTest.java index ac062628f7f..2e4a2e05a01 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCleanupTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCleanupTest.java @@ -21,9 +21,6 @@ import junit.framework.TestCase; -/** - * - */ public class ConnectionCleanupTest extends TestCase { private ActiveMQConnection connection; @@ -34,17 +31,11 @@ protected void setUp() throws Exception { connection = (ActiveMQConnection) factory.createConnection(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { connection.close(); } - /** - * @throws JMSException - */ public void testChangeClientID() throws JMSException { connection.setClientID("test"); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCloseMultipleTimesConcurrentTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCloseMultipleTimesConcurrentTest.java index 64d060b0fe5..053460e09b4 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCloseMultipleTimesConcurrentTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCloseMultipleTimesConcurrentTest.java @@ -25,9 +25,6 @@ import junit.framework.TestCase; -/** - * - */ public class ConnectionCloseMultipleTimesConcurrentTest extends TestCase { private ActiveMQConnection connection; @@ -43,9 +40,6 @@ protected void setUp() throws Exception { connection.start(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { if (connection.isStarted()) { @@ -56,9 +50,6 @@ protected void tearDown() throws Exception { } } - /** - * @throws javax.jms.JMSException - */ public void testCloseMultipleTimes() throws Exception { connection.createSession(false, Session.AUTO_ACKNOWLEDGE); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCloseMultipleTimesTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCloseMultipleTimesTest.java index aecdddbc0fd..6cefabc07fc 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCloseMultipleTimesTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConnectionCloseMultipleTimesTest.java @@ -21,9 +21,6 @@ import junit.framework.TestCase; -/** - * - */ public class ConnectionCloseMultipleTimesTest extends TestCase { private ActiveMQConnection connection; @@ -35,9 +32,6 @@ protected void setUp() throws Exception { connection.start(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { if (connection.isStarted()) { @@ -45,9 +39,6 @@ protected void tearDown() throws Exception { } } - /** - * @throws javax.jms.JMSException - */ public void testCloseMultipleTimes() throws JMSException { connection.createSession(false, Session.AUTO_ACKNOWLEDGE); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConsumerReceiveWithTimeoutTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConsumerReceiveWithTimeoutTest.java index 8c5324697eb..b1771eb1078 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConsumerReceiveWithTimeoutTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ConsumerReceiveWithTimeoutTest.java @@ -24,9 +24,6 @@ import javax.jms.Queue; import javax.jms.Session; -/** - * - */ public class ConsumerReceiveWithTimeoutTest extends TestSupport { private Connection connection; @@ -37,9 +34,6 @@ protected void setUp() throws Exception { connection = createConnection(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { if (connection != null) { @@ -50,10 +44,7 @@ protected void tearDown() throws Exception { } /** - * Test to check if consumer thread wakes up inside a receive(timeout) after - * a message is dispatched to the consumer - * - * @throws javax.jms.JMSException + * Test to check if consumer thread wakes up inside a receive(timeout) after a message is dispatched to the consumer */ public void testConsumerReceiveBeforeMessageDispatched() throws JMSException { @@ -81,7 +72,5 @@ public void testConsumerReceiveBeforeMessageDispatched() throws JMSException { Message msg = consumer.receive(60000); assertNotNull(msg); session.close(); - } - } diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java index 2a0848dd59b..f81cbd3a865 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java @@ -21,9 +21,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class CreateConsumerButDontStartConnectionWarningTest extends JmsQueueSendReceiveTest { private static final transient Logger LOG = LoggerFactory.getLogger(CreateConsumerButDontStartConnectionWarningTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java index 8c3f355da70..7854694f54d 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java @@ -118,8 +118,8 @@ protected ActiveMQDestination createDestination() { } /** - * Factory method to create the destination in either the queue or topic - * space based on the value of the {@link #useTopic} field + * Factory method to create the destination in either the queue or topic space based on the value of the + * {@link #useTopic} field */ protected ActiveMQDestination createDestination(String subject) { if (useTopic) { @@ -130,7 +130,7 @@ protected ActiveMQDestination createDestination(String subject) { } /** - * Returns the name of the destination used in this test case + * {@return the name of the destination used in this test case} */ protected String getDestinationString() { return getClass().getName() + "." + getName(); @@ -184,16 +184,10 @@ protected void startBroker() throws Exception { artemisBroker.start(); } - /** - * @return whether or not persistence should be used - */ protected boolean isPersistent() { return false; } - /** - * Factory method to create a new connection - */ protected Connection createConnection() throws Exception { return connectionFactory.createConnection(); } diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ExpiryHogTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ExpiryHogTest.java index ef876315070..93aa2c6dfaf 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ExpiryHogTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ExpiryHogTest.java @@ -29,9 +29,6 @@ import org.junit.runner.RunWith; import org.junit.runners.BlockJUnit4ClassRunner; -/** - * User: gtully - */ @RunWith(BlockJUnit4ClassRunner.class) public class ExpiryHogTest extends JmsMultipleClientsTestSupport { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSDurableTopicRedeliverTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSDurableTopicRedeliverTest.java index ff404d9c1e6..d7a1171a030 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSDurableTopicRedeliverTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSDurableTopicRedeliverTest.java @@ -23,9 +23,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JMSDurableTopicRedeliverTest extends JmsTopicRedeliverTest { private static final Logger LOG = LoggerFactory.getLogger(JMSDurableTopicRedeliverTest.class); @@ -38,8 +35,6 @@ protected void setUp() throws Exception { /** * Sends and consumes the messages. - * - * @throws Exception */ public void testRedeliverNewSession() throws Exception { String text = "TEST: " + System.currentTimeMillis(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSIndividualAckTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSIndividualAckTest.java index 3ad4273b76c..4224146fb9c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSIndividualAckTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSIndividualAckTest.java @@ -25,9 +25,6 @@ import javax.jms.Session; import javax.jms.TextMessage; -/** - * - */ public class JMSIndividualAckTest extends TestSupport { private Connection connection; @@ -38,9 +35,6 @@ protected void setUp() throws Exception { connection = createConnection(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { if (connection != null) { @@ -52,8 +46,6 @@ protected void tearDown() throws Exception { /** * Tests if acknowledged messages are being consumed. - * - * @throws JMSException */ public void testAckedMessageAreConsumed() throws JMSException { connection.start(); @@ -82,8 +74,6 @@ public void testAckedMessageAreConsumed() throws JMSException { /** * Tests if acknowledged messages are being consumed. - * - * @throws JMSException */ public void testLastMessageAcked() throws JMSException { connection.start(); @@ -126,8 +116,6 @@ public void testLastMessageAcked() throws JMSException { /** * Tests if unacknowledged messages are being re-delivered when the consumer connects again. - * - * @throws JMSException */ public void testUnAckedMessageAreNotConsumedOnSessionClose() throws JMSException { connection.start(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSQueueRedeliverTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSQueueRedeliverTest.java index 70b080617b1..b5174304f99 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSQueueRedeliverTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSQueueRedeliverTest.java @@ -16,9 +16,6 @@ */ package org.apache.activemq; -/** - * - */ public class JMSQueueRedeliverTest extends JmsTopicRedeliverTest { @Override diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsAutoAckListenerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsAutoAckListenerTest.java index 62a8770588c..7a7fb80d06d 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsAutoAckListenerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsAutoAckListenerTest.java @@ -24,9 +24,6 @@ import javax.jms.Queue; import javax.jms.Session; -/** - * - */ public class JmsAutoAckListenerTest extends TestSupport implements MessageListener { private Connection connection; @@ -37,9 +34,6 @@ protected void setUp() throws Exception { connection = createConnection(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { if (connection != null) { @@ -51,8 +45,6 @@ protected void tearDown() throws Exception { /** * Tests if acknowledged messages are being consumed. - * - * @throws javax.jms.JMSException */ public void testAckedMessageAreConsumed() throws Exception { connection.start(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsAutoAckTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsAutoAckTest.java index f329b1c3c84..8d209e0ec8f 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsAutoAckTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsAutoAckTest.java @@ -24,9 +24,6 @@ import javax.jms.Queue; import javax.jms.Session; -/** - * - */ public class JmsAutoAckTest extends TestSupport { private Connection connection; @@ -37,9 +34,6 @@ protected void setUp() throws Exception { connection = createConnection(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { if (connection != null) { @@ -51,8 +45,6 @@ protected void tearDown() throws Exception { /** * Tests if acknowledged messages are being consumed. - * - * @throws javax.jms.JMSException */ public void testAckedMessageAreConsumed() throws JMSException { connection.start(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsBenchmark.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsBenchmark.java index b1243166cca..55f94ce73e9 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsBenchmark.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsBenchmark.java @@ -45,10 +45,9 @@ import org.slf4j.LoggerFactory; /** - * Benchmarks the broker by starting many consumer and producers against the - * same destination. Make sure you run with jvm option -server (makes a big - * difference). The tests simulate storing 1000 1k jms messages to see the rate - * of processing msg/sec. + * Benchmarks the broker by starting many consumer and producers against the same destination. Make sure you run with + * jvm option -server (makes a big difference). The tests simulate storing 1000 1k jms messages to see the rate of + * processing msg/sec. */ public class JmsBenchmark extends JmsTestSupport { @@ -84,9 +83,6 @@ protected ConnectionFactory createConnectionFactory() throws URISyntaxException, return new ActiveMQConnectionFactory(broker.getTransportConnectors().get(0).getServer().getConnectURI()); } - /** - * @throws Throwable - */ public void testConcurrentSendReceive() throws Throwable { final Semaphore connectionsEstablished = new Semaphore(1 - (CONSUMER_COUNT + PRODUCER_COUNT)); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsClientAckListenerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsClientAckListenerTest.java index c593d4a58c2..abfa89805a2 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsClientAckListenerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsClientAckListenerTest.java @@ -24,9 +24,6 @@ import javax.jms.Queue; import javax.jms.Session; -/** - * - */ public class JmsClientAckListenerTest extends TestSupport implements MessageListener { private Connection connection; @@ -38,9 +35,6 @@ protected void setUp() throws Exception { connection = createConnection(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { if (connection != null) { @@ -52,8 +46,6 @@ protected void tearDown() throws Exception { /** * Tests if acknowledged messages are being consumed. - * - * @throws javax.jms.JMSException */ public void testAckedMessageAreConsumed() throws Exception { connection.start(); @@ -84,8 +76,6 @@ public void testAckedMessageAreConsumed() throws Exception { /** * Tests if unacknowledged messages are being redelivered when the consumer * connects again. - * - * @throws javax.jms.JMSException */ public void testUnAckedMessageAreNotConsumedOnSessionClose() throws Exception { connection.start(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsClientAckTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsClientAckTest.java index 85aea85cf3a..d464d22d812 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsClientAckTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsClientAckTest.java @@ -24,9 +24,6 @@ import javax.jms.Queue; import javax.jms.Session; -/** - * - */ public class JmsClientAckTest extends TestSupport { private Connection connection; @@ -37,9 +34,6 @@ protected void setUp() throws Exception { connection = createConnection(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { if (connection != null) { @@ -51,8 +45,6 @@ protected void tearDown() throws Exception { /** * Tests if acknowledged messages are being consumed. - * - * @throws JMSException */ public void testAckedMessageAreConsumed() throws JMSException { connection.start(); @@ -81,8 +73,6 @@ public void testAckedMessageAreConsumed() throws JMSException { /** * Tests if acknowledged messages are being consumed. - * - * @throws JMSException */ public void testLastMessageAcked() throws JMSException { connection.start(); @@ -117,8 +107,6 @@ public void testLastMessageAcked() throws JMSException { /** * Tests if unacknowledged messages are being re-delivered when the consumer connects again. - * - * @throws JMSException */ public void testUnAckedMessageAreNotConsumedOnSessionClose() throws JMSException { connection.start(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsConnectionStartStopTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsConnectionStartStopTest.java index 3e286fa4a7b..a5a878cfab8 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsConnectionStartStopTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsConnectionStartStopTest.java @@ -30,9 +30,6 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -/** - * - */ public class JmsConnectionStartStopTest extends TestSupport { private static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(JmsConnectionStartStopTest.class); @@ -40,9 +37,6 @@ public class JmsConnectionStartStopTest extends TestSupport { private Connection startedConnection; private Connection stoppedConnection; - /** - * @see junit.framework.TestCase#setUp() - */ @Override protected void setUp() throws Exception { @@ -54,9 +48,6 @@ protected void setUp() throws Exception { stoppedConnection = factory.createConnection(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { stoppedConnection.close(); @@ -66,8 +57,6 @@ protected void tearDown() throws Exception { /** * Tests if the consumer receives the messages that were sent before the * connection was started. - * - * @throws JMSException */ public void testStoppedConsumerHoldsMessagesTillStarted() throws JMSException { Session startedSession = startedConnection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -101,8 +90,6 @@ public void testStoppedConsumerHoldsMessagesTillStarted() throws JMSException { /** * Tests if the consumer is able to receive messages eveb when the * connecction restarts multiple times. - * - * @throws Exception */ public void testMultipleConnectionStops() throws Exception { testStoppedConsumerHoldsMessagesTillStarted(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsConsumerResetActiveListenerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsConsumerResetActiveListenerTest.java index d6367e54377..f3c5c840fbd 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsConsumerResetActiveListenerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsConsumerResetActiveListenerTest.java @@ -54,8 +54,6 @@ protected void tearDown() throws Exception { /** * verify the (undefined by spec) behaviour of setting a listener while receiving a message. - * - * @throws Exception */ public void testSetListenerFromListener() throws Exception { Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE); @@ -103,8 +101,6 @@ public void onMessage(Message message) { /** * and a listener on a new consumer, just in case. - * - * @throws Exception */ public void testNewConsumerSetListenerFromListener() throws Exception { final Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsCreateConsumerInOnMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsCreateConsumerInOnMessageTest.java index ebceb0ad9af..32d8b5f99c9 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsCreateConsumerInOnMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsCreateConsumerInOnMessageTest.java @@ -24,9 +24,6 @@ import javax.jms.Session; import javax.jms.Topic; -/** - * - */ public class JmsCreateConsumerInOnMessageTest extends TestSupport implements MessageListener { private Connection connection; @@ -38,9 +35,6 @@ public class JmsCreateConsumerInOnMessageTest extends TestSupport implements Mes private Topic topic; private final Object lock = new Object(); - /* - * @see junit.framework.TestCase#setUp() - */ @Override protected void setUp() throws Exception { super.setUp(); @@ -56,9 +50,6 @@ protected void setUp() throws Exception { connection.start(); } - /* - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { super.tearDown(); @@ -67,8 +58,6 @@ protected void tearDown() throws Exception { /** * Tests if a consumer can be created asynchronusly - * - * @throws Exception */ public void testCreateConsumer() throws Exception { Message msg = super.createMessage(); @@ -83,8 +72,6 @@ public void testCreateConsumer() throws Exception { /** * Use the asynchronous subscription mechanism - * - * @param message */ @Override public void onMessage(Message message) { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java index 487c7ce2cb9..2dec582eaf2 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java @@ -25,11 +25,7 @@ */ public class JmsDurableQueueWildcardSendReceiveTest extends JmsTopicSendReceiveTest { - /** - * Set up the test with a queue and persistent delivery mode. - * - * @see junit.framework.TestCase#setUp() - */ + // Set up the test with a queue and persistent delivery mode. @Override protected void setUp() throws Exception { topic = false; @@ -37,17 +33,11 @@ protected void setUp() throws Exception { super.setUp(); } - /** - * Returns the consumer subject. - */ @Override protected String getConsumerSubject() { return "FOO.>"; } - /** - * Returns the producer subject. - */ @Override protected String getProducerSubject() { return "FOO.BAR.HUMBUG"; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicSelectorTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicSelectorTest.java index 1ca8f6da21c..6de6f5011f7 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicSelectorTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicSelectorTest.java @@ -16,9 +16,6 @@ */ package org.apache.activemq; -/** - * - */ public class JmsDurableTopicSelectorTest extends JmsTopicSelectorTest { @Override diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicSendReceiveTest.java index 547b72fe245..5b74eb928cf 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicSendReceiveTest.java @@ -29,9 +29,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsDurableTopicSendReceiveTest extends JmsTopicSendReceiveTest { private static final Logger LOG = LoggerFactory.getLogger(JmsDurableTopicSendReceiveTest.class); @@ -44,11 +41,6 @@ public class JmsDurableTopicSendReceiveTest extends JmsTopicSendReceiveTest { protected Destination consumerDestination2; protected Destination producerDestination2; - /** - * Set up a durable suscriber test. - * - * @see junit.framework.TestCase#setUp() - */ @Override protected void setUp() throws Exception { this.durable = true; @@ -57,8 +49,6 @@ protected void setUp() throws Exception { /** * Test if all the messages sent are being received. - * - * @throws Exception */ public void testSendWhileClosed() throws Exception { connection2 = createConnection(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicTransactionTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicTransactionTest.java index 2769a8eec7c..ced33b25b03 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicTransactionTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicTransactionTest.java @@ -20,9 +20,6 @@ import org.apache.activemq.test.JmsResourceProvider; -/** - * - */ public class JmsDurableTopicTransactionTest extends JmsTopicTransactionTest { /** diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicWildcardSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicWildcardSendReceiveTest.java index b43329e5a23..256d6e0f12b 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicWildcardSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsDurableTopicWildcardSendReceiveTest.java @@ -20,16 +20,10 @@ import org.apache.activemq.test.JmsTopicSendReceiveTest; -/** - * - */ public class JmsDurableTopicWildcardSendReceiveTest extends JmsTopicSendReceiveTest { /** - * Sets up a test with a topic destination, durable suscriber and persistent - * delivery mode. - * - * @see junit.framework.TestCase#setUp() + * Sets up a test with a topic destination, durable suscriber and persistent delivery mode. */ @Override protected void setUp() throws Exception { @@ -39,17 +33,11 @@ protected void setUp() throws Exception { super.setUp(); } - /** - * Returns the consumer subject. - */ @Override protected String getConsumerSubject() { return "FOO.>"; } - /** - * Returns the producer subject. - */ @Override protected String getProducerSubject() { return "FOO.BAR.HUMBUG"; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsMultipleClientsTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsMultipleClientsTestSupport.java index 8e8e01c5a5b..0f57b2fa44c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsMultipleClientsTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsMultipleClientsTestSupport.java @@ -247,9 +247,7 @@ public void tearDown() throws Exception { } } - /* - * Some helpful assertions for multiple consumers. - */ + // Some helpful assertions for multiple consumers. protected void assertConsumerReceivedAtLeastXMessages(MessageConsumer consumer, int msgCount) { MessageIdList messageIdList = consumers.get(consumer); messageIdList.assertAtLeastMessagesReceived(msgCount); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java index 4143ccaa139..cb5bbca234d 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueBrowserTest.java @@ -45,8 +45,6 @@ public static Test suite() throws Exception { /** * Tests the queue browser. Browses the messages then the consumer tries to receive them. The messages should still * be in the queue even when it was browsed. - * - * @throws Exception */ public void testReceiveBrowseReceive() throws Exception { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java index 5f7e322086e..057b609d0fe 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java @@ -32,9 +32,6 @@ import org.apache.activemq.test.JmsTopicSendReceiveTest; import org.junit.Ignore; -/** - * - */ @Ignore public class JmsQueueCompositeSendReceiveTest extends JmsTopicSendReceiveTest { @@ -42,8 +39,6 @@ public class JmsQueueCompositeSendReceiveTest extends JmsTopicSendReceiveTest { /** * Sets a test to have a queue destination and non-persistent delivery mode. - * - * @see junit.framework.TestCase#setUp() */ @Override protected void setUp() throws Exception { @@ -56,33 +51,16 @@ protected void setUp() throws Exception { ArtemisBrokerHelper.makeSureDestinationExists(dest2); } - /** - * Returns the consumer subject. - * - * @return String - consumer subject - * @see org.apache.activemq.test.TestSupport#getConsumerSubject() - */ @Override protected String getConsumerSubject() { return "FOO.BAR.HUMBUG"; } - /** - * Returns the producer subject. - * - * @return String - producer subject - * @see org.apache.activemq.test.TestSupport#getProducerSubject() - */ @Override protected String getProducerSubject() { return "FOO.BAR.HUMBUG,FOO.BAR.HUMBUG2"; } - /** - * Test if all the messages sent are being received. - * - * @throws Exception - */ @Override public void testSendReceive() throws Exception { super.testSendReceive(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueRequestReplyTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueRequestReplyTest.java index a1d42d7462c..78aa72a1b30 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueRequestReplyTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueRequestReplyTest.java @@ -16,15 +16,10 @@ */ package org.apache.activemq; -/** - * - */ public class JmsQueueRequestReplyTest extends JmsTopicRequestReplyTest { /** * Set up the test with a queue. - * - * @see junit.framework.TestCase#setUp() */ @Override protected void setUp() throws Exception { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSelectorTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSelectorTest.java index 6553db36051..6f1437a9d83 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSelectorTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSelectorTest.java @@ -16,9 +16,6 @@ */ package org.apache.activemq; -/** - * - */ public class JmsQueueSelectorTest extends JmsTopicSelectorTest { @Override diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTest.java index b4c4eedb575..c3eac544185 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTest.java @@ -18,15 +18,10 @@ import org.apache.activemq.test.JmsTopicSendReceiveTest; -/** - * - */ public class JmsQueueSendReceiveTest extends JmsTopicSendReceiveTest { /** * Set up the test with a queue. - * - * @see junit.framework.TestCase#setUp() */ @Override protected void setUp() throws Exception { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsStartBeforeBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsStartBeforeBrokerTest.java index 8397e6515d4..294481972d4 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsStartBeforeBrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsStartBeforeBrokerTest.java @@ -23,9 +23,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsQueueSendReceiveTwoConnectionsStartBeforeBrokerTest extends JmsQueueSendReceiveTwoConnectionsTest { private static final Logger LOG = LoggerFactory.getLogger(JmsQueueSendReceiveTwoConnectionsStartBeforeBrokerTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsTest.java index 576f06ba099..effceb4b03a 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveTwoConnectionsTest.java @@ -18,15 +18,10 @@ import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest; -/** - * - */ public class JmsQueueSendReceiveTwoConnectionsTest extends JmsTopicSendReceiveWithTwoConnectionsTest { /** * Set up the test with a queue and using two connections. - * - * @see junit.framework.TestCase#setUp() */ @Override protected void setUp() throws Exception { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveUsingTwoSessionsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveUsingTwoSessionsTest.java index 72da87e9d72..2944d43c629 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveUsingTwoSessionsTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueSendReceiveUsingTwoSessionsTest.java @@ -16,15 +16,10 @@ */ package org.apache.activemq; -/** - * - */ public class JmsQueueSendReceiveUsingTwoSessionsTest extends JmsQueueSendReceiveTest { /** * Set up the test using two sessions. - * - * @see junit.framework.TestCase#setUp() */ @Override protected void setUp() throws Exception { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java index 1d56d489287..453e3ae3b7c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java @@ -23,9 +23,6 @@ import org.apache.activemq.test.JmsTopicSendReceiveTest; -/** - * - */ public class JmsQueueTopicCompositeSendReceiveTest extends JmsTopicSendReceiveTest { private static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(JmsQueueTopicCompositeSendReceiveTest.class); @@ -34,8 +31,6 @@ public class JmsQueueTopicCompositeSendReceiveTest extends JmsTopicSendReceiveTe /** * Sets a test to have a queue destination and non-persistent delivery mode. - * - * @see junit.framework.TestCase#setUp() */ @Override protected void setUp() throws Exception { @@ -53,33 +48,16 @@ protected void setUp() throws Exception { } - /** - * Returns the consumer subject. - * - * @return String - consumer subject - * @see org.apache.activemq.test.TestSupport#getConsumerSubject() - */ @Override protected String getConsumerSubject() { return "FOO.BAR.HUMBUG"; } - /** - * Returns the producer subject. - * - * @return String - producer subject - * @see org.apache.activemq.test.TestSupport#getProducerSubject() - */ @Override protected String getProducerSubject() { return "queue://FOO.BAR.HUMBUG,topic://FOO.BAR.HUMBUG2"; } - /** - * Test if all the messages sent are being received. - * - * @throws Exception - */ @Override public void testSendReceive() throws Exception { super.testSendReceive(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java index cbf11d21125..ac4e89f15d2 100755 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueTransactionTest.java @@ -32,9 +32,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsQueueTransactionTest extends JmsTransactionTestSupport { private static final Logger LOG = LoggerFactory.getLogger(JmsQueueTransactionTest.class); @@ -50,10 +47,7 @@ protected JmsResourceProvider getJmsResourceProvider() { } /** - * Tests if the the connection gets reset, the messages will still be - * received. - * - * @throws Exception + * Tests if the the connection gets reset, the messages will still be received. */ public void testReceiveTwoThenCloseConnection() throws Exception { Message[] outbound = new Message[]{session.createTextMessage("First Message"), session.createTextMessage("Second Message")}; @@ -105,10 +99,7 @@ public void testReceiveTwoThenCloseConnection() throws Exception { } /** - * Tests sending and receiving messages with two sessions(one for producing - * and another for consuming). - * - * @throws Exception + * Tests sending and receiving messages with two sessions(one for producing and another for consuming). */ public void testSendReceiveInSeperateSessionTest() throws Exception { session.close(); @@ -146,11 +137,8 @@ public void testSendReceiveInSeperateSessionTest() throws Exception { } /** - * Tests the queue browser. Browses the messages then the consumer tries to - * receive them. The messages should still be in the queue even when it was - * browsed. - * - * @throws Exception + * Tests the queue browser. Browses the messages then the consumer tries to receive them. The messages should still + * be in the queue even when it was browsed. */ public void testReceiveBrowseReceive() throws Exception { Message[] outbound = new Message[]{session.createTextMessage("First Message"), session.createTextMessage("Second Message"), session.createTextMessage("Third Message")}; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java index 6d79c7bcd82..3fa9ea910d5 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java @@ -42,8 +42,6 @@ public class JmsQueueWildcardSendReceiveTest extends JmsTopicSendReceiveTest { /** * Sets a test to have a queue destination and non-persistent delivery mode. - * - * @see junit.framework.TestCase#setUp() */ @Override protected void setUp() throws Exception { @@ -52,23 +50,11 @@ protected void setUp() throws Exception { super.setUp(); } - /** - * Returns the consumer subject. - * - * @return String - consumer subject - * @see org.apache.activemq.test.TestSupport#getConsumerSubject() - */ @Override protected String getConsumerSubject() { return "FOO.>"; } - /** - * Returns the producer subject. - * - * @return String - producer subject - * @see org.apache.activemq.test.TestSupport#getProducerSubject() - */ @Override protected String getProducerSubject() { return "FOO.BAR.HUMBUG"; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsRedeliveredTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsRedeliveredTest.java index 197b253981f..bb0d8fbf0a3 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsRedeliveredTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsRedeliveredTest.java @@ -35,26 +35,15 @@ import org.apache.activemq.util.Wait; -/** - * - */ public class JmsRedeliveredTest extends TestCase { private Connection connection; - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ @Override protected void setUp() throws Exception { connection = createConnection(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { if (connection != null) { @@ -64,18 +53,12 @@ protected void tearDown() throws Exception { CombinationTestSupport.checkStopped(); } - /** - * Creates a connection. - * - * @return connection - * @throws Exception - */ protected Connection createConnection() throws Exception { ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); return factory.createConnection(); } - /** + /* * Tests if a message unacknowledged message gets to be resent when the * session is closed and then a new consumer session is created. */ @@ -148,11 +131,9 @@ public void testQueueSessionCloseMarksUnAckedMessageRedelivered() throws JMSExce session.close(); } - /** + /* * Tests session recovery and that the redelivered message is marked as * such. Session uses client acknowledgement, the destination is a queue. - * - * @throws JMSException */ public void testQueueRecoverMarksMessageRedelivered() throws JMSException { connection.start(); @@ -182,11 +163,9 @@ public void testQueueRecoverMarksMessageRedelivered() throws JMSException { session.close(); } - /** + /* * Tests rollback message to be marked as redelivered. Session uses client * acknowledgement and the destination is a queue. - * - * @throws JMSException */ public void testQueueRollbackMarksMessageRedelivered() throws JMSException { connection.start(); @@ -215,13 +194,11 @@ public void testQueueRollbackMarksMessageRedelivered() throws JMSException { session.close(); } - /** + /* * Tests if the message gets to be re-delivered when the session closes and * that the re-delivered message is marked as such. Session uses client * acknowledgment, the destination is a topic and the consumer is a durable * subscriber. - * - * @throws JMSException */ public void testDurableTopicSessionCloseMarksMessageRedelivered() throws JMSException { connection.setClientID(getName()); @@ -259,12 +236,10 @@ public void testDurableTopicSessionCloseMarksMessageRedelivered() throws JMSExce session.close(); } - /** + /* * Tests session recovery and that the redelivered message is marked as * such. Session uses client acknowledgement, the destination is a topic and * the consumer is a durable suscriber. - * - * @throws JMSException */ public void testDurableTopicRecoverMarksMessageRedelivered() throws JMSException { connection.setClientID(getName()); @@ -296,11 +271,9 @@ public void testDurableTopicRecoverMarksMessageRedelivered() throws JMSException session.close(); } - /** + /* * Tests rollback message to be marked as redelivered. Session uses client * acknowledgement and the destination is a topic. - * - * @throws JMSException */ public void testDurableTopicRollbackMarksMessageRedelivered() throws JMSException { connection.setClientID(getName()); @@ -331,9 +304,6 @@ public void testDurableTopicRollbackMarksMessageRedelivered() throws JMSExceptio session.close(); } - /** - * @throws JMSException - */ public void testTopicRecoverMarksMessageRedelivered() throws JMSException { connection.setClientID(getName()); @@ -365,11 +335,9 @@ public void testTopicRecoverMarksMessageRedelivered() throws JMSException { session.close(); } - /** + /* * Tests rollback message to be marked as redelivered. Session uses client * acknowledgement and the destination is a topic. - * - * @throws JMSException */ public void testTopicRollbackMarksMessageRedelivered() throws JMSException { connection.setClientID(getName()); @@ -480,13 +448,6 @@ public void testNoReceiveDurableConsumerDoesNotIncrementRedelivery() throws Exce session.close(); } - /** - * Creates a text message. - * - * @param session - * @return TextMessage. - * @throws JMSException - */ private TextMessage createTextMessage(Session session) throws JMSException { return createTextMessage(session, "Hello"); } @@ -495,55 +456,24 @@ private TextMessage createTextMessage(Session session, String txt) throws JMSExc return session.createTextMessage(txt); } - /** - * Creates a producer. - * - * @param session - * @param queue - destination. - * @return MessageProducer - * @throws JMSException - */ private MessageProducer createProducer(Session session, Destination queue) throws JMSException { MessageProducer producer = session.createProducer(queue); producer.setDeliveryMode(getDeliveryMode()); return producer; } - /** - * Returns delivery mode. - * - * @return int - persistent delivery mode. - */ protected int getDeliveryMode() { return DeliveryMode.PERSISTENT; } - /** - * Run the JmsRedeliverTest with the delivery mode set as persistent. - */ public static final class PersistentCase extends JmsRedeliveredTest { - - /** - * Returns delivery mode. - * - * @return int - persistent delivery mode. - */ @Override protected int getDeliveryMode() { return DeliveryMode.PERSISTENT; } } - /** - * Run the JmsRedeliverTest with the delivery mode set as non-persistent. - */ public static final class TransientCase extends JmsRedeliveredTest { - - /** - * Returns delivery mode. - * - * @return int - non-persistent delivery mode. - */ @Override protected int getDeliveryMode() { return DeliveryMode.NON_PERSISTENT; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java index a8fb319f195..6c4f7c1b5ee 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java @@ -35,9 +35,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsSendReceiveTestSupport extends TestSupport implements MessageListener { private static final Logger LOG = LoggerFactory.getLogger(JmsSendReceiveTestSupport.class); @@ -56,9 +53,6 @@ public class JmsSendReceiveTestSupport extends TestSupport implements MessageLis protected final Object lock = new Object(); protected boolean verbose; - /* - * @see junit.framework.TestCase#setUp() - */ @Override protected void setUp() throws Exception { super.setUp(); @@ -81,8 +75,6 @@ protected void setUp() throws Exception { /** * Sends and consumes the messages. - * - * @throws Exception */ public void testSendReceive() throws Exception { messages.clear(); @@ -107,11 +99,6 @@ public void testSendReceive() throws Exception { /** * Sends a message to a destination using the supplied producer - * - * @param producer - * @param producerDestination - * @param message - * @throws JMSException */ protected void sendToProducer(MessageProducer producer, Destination producerDestination, @@ -121,8 +108,6 @@ protected void sendToProducer(MessageProducer producer, /** * Asserts messages are received. - * - * @throws JMSException */ protected void assertMessagesAreReceived() throws JMSException { waitForMessagesToBeDelivered(); @@ -133,7 +118,6 @@ protected void assertMessagesAreReceived() throws JMSException { * Tests if the messages received are valid. * * @param receivedMessages - list of received messages. - * @throws JMSException */ protected void assertMessagesReceivedAreValid(List receivedMessages) throws JMSException { List copyOfMessages = Arrays.asList(receivedMessages.toArray()); @@ -189,11 +173,6 @@ protected void waitForMessagesToBeDelivered() { } } - /* - * (non-Javadoc) - * - * @see javax.jms.MessageListener#onMessage(javax.jms.Message) - */ @Override public synchronized void onMessage(Message message) { consumeMessage(message, messages); @@ -202,8 +181,8 @@ public synchronized void onMessage(Message message) { /** * Consumes messages. * - * @param message - message to be consumed. - * @param messageList -list of consumed messages. + * @param message message to be consumed. + * @param messageList list of consumed messages. */ protected void consumeMessage(Message message, List messageList) { if (verbose) { @@ -222,9 +201,7 @@ protected void consumeMessage(Message message, List messageList) { } /** - * Returns the ArrayList as a synchronized list. - * - * @return List + * {@return the ArrayList as a synchronized list} */ protected List createConcurrentList() { return Collections.synchronizedList(new ArrayList<>()); @@ -232,8 +209,6 @@ protected List createConcurrentList() { /** * Just a hook so can insert failure tests - * - * @throws Exception */ protected void messageSent() throws Exception { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java index c10585b5797..06ea82db6e2 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java @@ -36,9 +36,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsSendReceiveWithMessageExpirationTest extends TestSupport { private static final Logger LOG = LoggerFactory.getLogger(JmsSendReceiveWithMessageExpirationTest.class); @@ -78,8 +75,6 @@ protected void setUp() throws Exception { /** * Test consuming an expired queue. - * - * @throws Exception */ public void testConsumeExpiredQueue() throws Exception { @@ -175,8 +170,6 @@ public void testConsumeExpiredQueueAndDlq() throws Exception { /** * Sends and consumes the messages to a queue destination. - * - * @throws Exception */ public void testConsumeQueue() throws Exception { @@ -208,8 +201,6 @@ public void testConsumeQueue() throws Exception { /** * Test consuming an expired topic. - * - * @throws Exception */ public void testConsumeExpiredTopic() throws Exception { @@ -245,8 +236,6 @@ public void testConsumeExpiredTopic() throws Exception { /** * Sends and consumes the messages to a topic destination. - * - * @throws Exception */ public void testConsumeTopic() throws Exception { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendWithAsyncCallbackTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendWithAsyncCallbackTest.java index 9b2941c14e7..32063832226 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendWithAsyncCallbackTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendWithAsyncCallbackTest.java @@ -29,9 +29,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsSendWithAsyncCallbackTest extends TestSupport { private static final Logger LOG = LoggerFactory.getLogger(JmsSendWithAsyncCallbackTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSessionRecoverTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSessionRecoverTest.java index 3ac5541127e..f1a323ea229 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSessionRecoverTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSessionRecoverTest.java @@ -43,18 +43,12 @@ public class JmsSessionRecoverTest extends TestCase { private ActiveMQConnectionFactory factory; private Destination dest; - /** - * @see junit.framework.TestCase#setUp() - */ @Override protected void setUp() throws Exception { factory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); connection = factory.createConnection(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { if (connection != null) { @@ -63,55 +57,31 @@ protected void tearDown() throws Exception { } } - /** - * @throws JMSException - * @throws InterruptedException - */ public void testQueueSynchRecover() throws JMSException, InterruptedException { dest = new ActiveMQQueue("Queue-" + System.currentTimeMillis()); doTestSynchRecover(); } - /** - * @throws JMSException - * @throws InterruptedException - */ public void testQueueAsynchRecover() throws JMSException, InterruptedException { dest = new ActiveMQQueue("Queue-" + System.currentTimeMillis()); doTestAsynchRecover(); } - /** - * @throws JMSException - * @throws InterruptedException - */ public void testTopicSynchRecover() throws JMSException, InterruptedException { dest = new ActiveMQTopic("Topic-" + System.currentTimeMillis()); doTestSynchRecover(); } - /** - * @throws JMSException - * @throws InterruptedException - */ public void testTopicAsynchRecover() throws JMSException, InterruptedException { dest = new ActiveMQTopic("Topic-" + System.currentTimeMillis()); doTestAsynchRecover(); } - /** - * @throws JMSException - * @throws InterruptedException - */ public void testQueueAsynchRecoverWithAutoAck() throws JMSException, InterruptedException { dest = new ActiveMQQueue("Queue-" + System.currentTimeMillis()); doTestAsynchRecoverWithAutoAck(); } - /** - * @throws JMSException - * @throws InterruptedException - */ public void testTopicAsynchRecoverWithAutoAck() throws JMSException, InterruptedException { dest = new ActiveMQTopic("Topic-" + System.currentTimeMillis()); doTestAsynchRecoverWithAutoAck(); @@ -119,8 +89,6 @@ public void testTopicAsynchRecoverWithAutoAck() throws JMSException, Interrupted /** * Test to make sure that a Sync recover works. - * - * @throws JMSException */ public void doTestSynchRecover() throws JMSException { Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE); @@ -152,9 +120,6 @@ public void doTestSynchRecover() throws JMSException { /** * Test to make sure that an Async recover works. - * - * @throws JMSException - * @throws InterruptedException */ public void doTestAsynchRecover() throws JMSException, InterruptedException { @@ -222,9 +187,6 @@ public void onMessage(Message msg) { /** * Test to make sure that an Async recover works when using AUTO_ACKNOWLEDGE. - * - * @throws JMSException - * @throws InterruptedException */ public void doTestAsynchRecoverWithAutoAck() throws JMSException, InterruptedException { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTempDestinationTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTempDestinationTest.java index 7dd3f244ad0..f74ed07e0f0 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTempDestinationTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTempDestinationTest.java @@ -42,9 +42,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * @version - */ public class JmsTempDestinationTest { private Connection connection; private ActiveMQConnectionFactory factory; @@ -58,9 +55,6 @@ public void setUp() throws Exception { connections.add(connection); } - /** - * @see junit.framework.TestCase#tearDown() - */ @After public void tearDown() throws Exception { for (Iterator iter = connections.iterator(); iter.hasNext(); ) { @@ -75,8 +69,6 @@ public void tearDown() throws Exception { /** * Make sure Temp destination can only be consumed by local connection - * - * @throws JMSException */ @Test public void testTempDestOnlyConsumedByLocalConn() throws JMSException { @@ -115,10 +107,7 @@ public void testTempDestOnlyConsumedByLocalConn() throws JMSException { } /** - * Make sure that a temp queue does not drop message if there is an active - * consumers. - * - * @throws JMSException + * Make sure that a temp queue does not drop message if there is an active consumers. */ @Test public void testTempQueueHoldsMessagesWithConsumers() throws JMSException { @@ -139,10 +128,7 @@ public void testTempQueueHoldsMessagesWithConsumers() throws JMSException { } /** - * Make sure that a temp queue does not drop message if there are no active - * consumers. - * - * @throws JMSException + * Make sure that a temp queue does not drop message if there are no active consumers. */ @Test public void testTempQueueHoldsMessagesWithoutConsumers() throws JMSException { @@ -165,8 +151,6 @@ public void testTempQueueHoldsMessagesWithoutConsumers() throws JMSException { /** * Test temp queue works under load - * - * @throws JMSException */ @Test public void testTmpQueueWorksUnderLoad() throws JMSException { @@ -199,12 +183,7 @@ public void testTmpQueueWorksUnderLoad() throws JMSException { } /** - * Make sure you cannot publish to a temp destination that does not exist - * anymore. - * - * @throws JMSException - * @throws InterruptedException - * @throws URISyntaxException + * Make sure you cannot publish to a temp destination that does not exist anymore. */ @Test public void testPublishFailsForClosedConnection() throws Exception { @@ -245,11 +224,7 @@ public void testPublishFailsForClosedConnection() throws Exception { } /** - * Make sure you cannot publish to a temp destination that does not exist - * anymore. - * - * @throws JMSException - * @throws InterruptedException + * Make sure you cannot publish to a temp destination that does not exist anymore. */ @Test public void testPublishFailsForDestroyedTempDestination() throws Exception { @@ -293,8 +268,6 @@ public void testPublishFailsForDestroyedTempDestination() throws Exception { /** * Test you can't delete a Destination with Active Subscribers - * - * @throws JMSException */ @Test public void testDeleteDestinationWithSubscribersFails() throws JMSException { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java index ad6eb9f6e10..4232f5aa586 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java @@ -23,9 +23,6 @@ import org.apache.activemq.test.JmsTopicSendReceiveTest; -/** - * - */ public class JmsTopicCompositeSendReceiveTest extends JmsTopicSendReceiveTest { private static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(JmsTopicCompositeSendReceiveTest.class); @@ -53,33 +50,16 @@ protected void setUp() throws Exception { } - /** - * Returns the consumer subject. - * - * @return String - consumer subject - * @see org.apache.activemq.test.TestSupport#getConsumerSubject() - */ @Override protected String getConsumerSubject() { return "FOO.BAR.HUMBUG"; } - /** - * Returns the producer subject. - * - * @return String - producer subject - * @see org.apache.activemq.test.TestSupport#getProducerSubject() - */ @Override protected String getProducerSubject() { return "FOO.BAR.HUMBUG,FOO.BAR.HUMBUG2"; } - /** - * Test if all the messages sent are being received. - * - * @throws Exception - */ @Override public void testSendReceive() throws Exception { super.testSendReceive(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicRedeliverTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicRedeliverTest.java index d65aa4f240c..da55f8e9afb 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicRedeliverTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicRedeliverTest.java @@ -29,9 +29,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsTopicRedeliverTest extends TestSupport { private static final Logger LOG = LoggerFactory.getLogger(JmsTopicRedeliverTest.class); @@ -96,33 +93,16 @@ protected void tearDown() throws Exception { super.tearDown(); } - /** - * Returns the consumer subject. - * - * @return String - consumer subject - * @see org.apache.activemq.test.TestSupport#getConsumerSubject() - */ @Override protected String getConsumerSubject() { return "TEST"; } - /** - * Returns the producer subject. - * - * @return String - producer subject - * @see org.apache.activemq.test.TestSupport#getProducerSubject() - */ @Override protected String getProducerSubject() { return "TEST"; } - /** - * Sends and consumes the messages. - * - * @throws Exception - */ public void testRecover() throws Exception { String text = "TEST"; Message sendMessage = session.createTextMessage(text); @@ -161,5 +141,4 @@ protected MessageConsumer createConsumer() throws JMSException { } return consumeSession.createConsumer(consumerDestination); } - } diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java index 5826c9e5d53..cd91fe9d20b 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java @@ -34,9 +34,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsTopicRequestReplyTest extends TestSupport implements MessageListener { private static final Logger LOG = LoggerFactory.getLogger(JmsTopicRequestReplyTest.class); @@ -71,11 +68,9 @@ public void testSendAndReceive() throws Exception { // same", clientSideClientID, value); LOG.info("Both the clientID and destination clientID match properly: " + clientSideClientID); - /* build queues */ MessageProducer requestProducer = session.createProducer(requestDestination); MessageConsumer replyConsumer = session.createConsumer(replyDestination); - /* build requestmessage */ TextMessage requestMessage = session.createTextMessage("Olivier"); requestMessage.setJMSReplyTo(replyDestination); requestProducer.send(requestMessage); @@ -170,7 +165,7 @@ protected void setUp() throws Exception { requestDestination = createDestination(serverSession); - /* build queues */ + // build queues final MessageConsumer requestConsumer = serverSession.createConsumer(requestDestination); if (useAsyncConsume) { requestConsumer.setMessageListener(this); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSelectorTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSelectorTest.java index 78bbe4bda4f..94148236839 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSelectorTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSelectorTest.java @@ -30,9 +30,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsTopicSelectorTest extends TestSupport { private static final Logger LOG = LoggerFactory.getLogger(JmsTopicSelectorTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java index bebd384a4f5..aa8e1955037 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java @@ -21,9 +21,6 @@ import javax.jms.Topic; import javax.jms.TopicSession; -/** - * - */ public class JmsTopicSendReceiveSubscriberTest extends JmsTopicSendReceiveTest { @Override diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java index 3453e1587b3..cd9683d826c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java @@ -26,9 +26,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport { private static final Logger LOG = LoggerFactory.getLogger(JmsTopicSendReceiveTest.class); @@ -87,7 +84,9 @@ protected void tearDown() throws Exception { LOG.info("Closing down connection"); - /** TODO we should be able to shut down properly */ + /** + * TODO we should be able to shut down properly + */ session.close(); connection.close(); } diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsTest.java index 3ece3f65a45..88140f466c5 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsTest.java @@ -25,9 +25,6 @@ import org.apache.activemq.transport.tcp.TcpTransportFactory; -/** - * @version - */ public class JmsTopicSendReceiveWithTwoConnectionsTest extends JmsSendReceiveTestSupport { private static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(JmsTopicSendReceiveWithTwoConnectionsTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsWithJMXTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsWithJMXTest.java index 59546c22765..6d4114d6c4c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsWithJMXTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendReceiveWithTwoConnectionsWithJMXTest.java @@ -16,10 +16,6 @@ */ package org.apache.activemq; -/** - * - * - */ public class JmsTopicSendReceiveWithTwoConnectionsWithJMXTest extends JmsTopicSendReceiveWithTwoConnectionsTest { @Override diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendSameMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendSameMessageTest.java index aba81131593..47545343b32 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendSameMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicSendSameMessageTest.java @@ -18,9 +18,6 @@ import javax.jms.TextMessage; -/** - * - */ public class JmsTopicSendSameMessageTest extends JmsTopicSendReceiveWithTwoConnectionsTest { private static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(JmsTopicSendSameMessageTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicTransactionTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicTransactionTest.java index 85d45740dd0..ddd941ffa25 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicTransactionTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicTransactionTest.java @@ -18,9 +18,6 @@ import org.apache.activemq.test.JmsResourceProvider; -/** - * - */ public class JmsTopicTransactionTest extends JmsTransactionTestSupport { /** diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java index 89cc65853cb..97575930789 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java @@ -28,9 +28,6 @@ import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.test.JmsTopicSendReceiveTest; -/** - * - */ public class JmsTopicWildcardSendReceiveTest extends JmsTopicSendReceiveTest { private String destination1String = "TEST.ONE.ONE"; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTransactionTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTransactionTestSupport.java index d20d3d1caf7..06665dda949 100755 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTransactionTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTransactionTestSupport.java @@ -39,9 +39,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public abstract class JmsTransactionTestSupport extends TestSupport implements MessageListener { private static final Logger LOG = LoggerFactory.getLogger(JmsTransactionTestSupport.class); @@ -72,11 +69,6 @@ public JmsTransactionTestSupport(String name) { super(name); } - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ @Override protected void setUp() throws Exception { broker = createBroker(); @@ -111,17 +103,10 @@ protected void rollbackTx() throws Exception { session.rollback(); } - /** - */ protected BrokerService createBroker() throws Exception, URISyntaxException { return BrokerFactory.createBroker(new URI("broker://()/localhost?persistent=false")); } - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { LOG.info("Closing down connection"); @@ -150,8 +135,6 @@ protected void tearDown() throws Exception { /** * Sends a batch of messages and validates that the messages are received. - * - * @throws Exception */ public void testSendReceiveTransactedBatches() throws Exception { @@ -182,10 +165,7 @@ protected void messageSent() throws Exception { } /** - * Sends a batch of messages and validates that the rollbacked message was - * not consumed. - * - * @throws Exception + * Sends a batch of messages and validates that the rollbacked message was not consumed. */ public void testSendRollback() throws Exception { Message[] outbound = new Message[]{session.createTextMessage("First Message"), session.createTextMessage("Second Message")}; @@ -228,7 +208,6 @@ public void testSendRollback() throws Exception { /** * spec section 3.6 acking a message with automation acks has no effect. - * @throws Exception */ public void testAckMessageInTx() throws Exception { Message[] outbound = new Message[]{session.createTextMessage("First Message")}; @@ -256,11 +235,9 @@ public void testAckMessageInTx() throws Exception { } /** - * Sends a batch of messages and validates that the message sent before - * session close is not consumed. - * + * Sends a batch of messages and validates that the message sent before session close is not consumed. + *

                      * This test only works with local transactions, not xa. - * @throws Exception */ public void testSendSessionClose() throws Exception { Message[] outbound = new Message[]{session.createTextMessage("First Message"), session.createTextMessage("Second Message")}; @@ -303,10 +280,7 @@ public void testSendSessionClose() throws Exception { } /** - * Sends a batch of messages and validates that the message sent before - * session close is not consumed. - * - * @throws Exception + * Sends a batch of messages and validates that the message sent before session close is not consumed. */ public void testSendSessionAndConnectionClose() throws Exception { Message[] outbound = new Message[]{session.createTextMessage("First Message"), session.createTextMessage("Second Message")}; @@ -351,10 +325,7 @@ public void testSendSessionAndConnectionClose() throws Exception { } /** - * Sends a batch of messages and validates that the rollbacked message was - * redelivered. - * - * @throws Exception + * Sends a batch of messages and validates that the rollbacked message was redelivered. */ public void testReceiveRollback() throws Exception { Message[] outbound = new Message[]{session.createTextMessage("First Message"), session.createTextMessage("Second Message")}; @@ -402,10 +373,7 @@ public void testReceiveRollback() throws Exception { } /** - * Sends a batch of messages and validates that the rollbacked message was - * redelivered. - * - * @throws Exception + * Sends a batch of messages and validates that the rollbacked message was redelivered. */ public void testReceiveTwoThenRollback() throws Exception { Message[] outbound = new Message[]{session.createTextMessage("First Message"), session.createTextMessage("Second Message")}; @@ -456,10 +424,7 @@ public void testReceiveTwoThenRollback() throws Exception { } /** - * Sends a batch of messages and validates that the rollbacked message was - * not consumed. - * - * @throws Exception + * Sends a batch of messages and validates that the rollbacked message was not consumed. */ public void testSendReceiveWithPrefetchOne() throws Exception { setPrefetchToOne(); @@ -486,10 +451,7 @@ public void testSendReceiveWithPrefetchOne() throws Exception { } /** - * Perform the test that validates if the rollbacked message was redelivered - * multiple times. - * - * @throws Exception + * Perform the test that validates if the rollbacked message was redelivered multiple times. */ public void testReceiveTwoThenRollbackManyTimes() throws Exception { for (int i = 0; i < 5; i++) { @@ -498,10 +460,8 @@ public void testReceiveTwoThenRollbackManyTimes() throws Exception { } /** - * Sends a batch of messages and validates that the rollbacked message was - * not consumed. This test differs by setting the message prefetch to one. - * - * @throws Exception + * Sends a batch of messages and validates that the rollbacked message was not consumed. This test differs by setting + * the message prefetch to one. */ public void testSendRollbackWithPrefetchOfOne() throws Exception { setPrefetchToOne(); @@ -509,11 +469,8 @@ public void testSendRollbackWithPrefetchOfOne() throws Exception { } /** - * Sends a batch of messages and and validates that the rollbacked message - * was redelivered. This test differs by setting the message prefetch to - * one. - * - * @throws Exception + * Sends a batch of messages and and validates that the rollbacked message was redelivered. This test differs by + * setting the message prefetch to one. */ public void testReceiveRollbackWithPrefetchOfOne() throws Exception { setPrefetchToOne(); @@ -521,8 +478,7 @@ public void testReceiveRollbackWithPrefetchOfOne() throws Exception { } /** - * Tests if the messages can still be received if the consumer is closed - * (session is not closed). + * Tests if the messages can still be received if the consumer is closed (session is not closed). * * @throws Exception see http://jira.codehaus.org/browse/AMQ-143 */ @@ -614,8 +570,6 @@ protected List assertReceivedObjectMessageWithListBody(Message message) /** * Recreates the connection. - * - * @throws javax.jms.JMSException */ protected void reconnect() throws Exception { @@ -631,8 +585,6 @@ protected void reconnect() throws Exception { /** * Recreates the connection. - * - * @throws javax.jms.JMSException */ protected void reconnectSession() throws JMSException { if (session != null) { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/LargeMessageTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/LargeMessageTestSupport.java index 2da9f2c438e..5acf78a7137 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/LargeMessageTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/LargeMessageTestSupport.java @@ -36,9 +36,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class LargeMessageTestSupport extends ClientTestSupport implements MessageListener { protected static final int LARGE_MESSAGE_SIZE = 128 * 1024; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageListenerRedeliveryTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageListenerRedeliveryTest.java index 095bf097986..8edd8dfc4ac 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageListenerRedeliveryTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageListenerRedeliveryTest.java @@ -51,9 +51,6 @@ protected void setUp() throws Exception { connection = createConnection(); } - /** - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { if (connection != null) { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageTransformationTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageTransformationTest.java index 1f1dabf8ab3..5159e32ed4e 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageTransformationTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageTransformationTest.java @@ -34,8 +34,6 @@ public class MessageTransformationTest extends TestCase { /** * Sets up the resources of the unit test. - * - * @throws Exception */ @Override protected void setUp() throws Exception { @@ -49,8 +47,7 @@ protected void tearDown() throws Exception { } /** - * Tests transforming destinations into ActiveMQ's destination - * implementation. + * Tests transforming destinations into ActiveMQ's destination implementation. */ public void testTransformDestination() throws Exception { assertTrue("Transforming a TempQueue destination to an ActiveMQTempQueue", ActiveMQMessageTransformation.transformDestination(new ActiveMQTempQueue()) instanceof ActiveMQTempQueue); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/RedeliveryPolicyTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/RedeliveryPolicyTest.java index 4e64d45ef26..591457e0254 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/RedeliveryPolicyTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/RedeliveryPolicyTest.java @@ -62,9 +62,6 @@ public void testGetNext() throws Exception { assertEquals(500, delay); } - /** - * @throws Exception - */ public void testExponentialRedeliveryPolicyDelaysDeliveryOnRollback() throws Exception { // Receive a message with the JMS API @@ -117,9 +114,6 @@ public void testExponentialRedeliveryPolicyDelaysDeliveryOnRollback() throws Exc } - /** - * @throws Exception - */ public void testNornalRedeliveryPolicyDelaysDeliveryOnRollback() throws Exception { // Receive a message with the JMS API @@ -168,9 +162,6 @@ public void testNornalRedeliveryPolicyDelaysDeliveryOnRollback() throws Exceptio } - /** - * @throws Exception - */ public void testDLQHandling() throws Exception { // Receive a message with the JMS API @@ -224,9 +215,6 @@ public void testDLQHandling() throws Exception { } - /** - * @throws Exception - */ public void testInfiniteMaximumNumberOfRedeliveries() throws Exception { // Receive a message with the JMS API @@ -288,9 +276,6 @@ public void testInfiniteMaximumNumberOfRedeliveries() throws Exception { } - /** - * @throws Exception - */ public void testMaximumRedeliveryDelay() throws Exception { // Receive a message with the JMS API @@ -338,9 +323,6 @@ public void testMaximumRedeliveryDelay() throws Exception { assertTrue(policy.getNextRedeliveryDelay(Long.MAX_VALUE) == 1000); } - /** - * @throws Exception - */ public void testZeroMaximumNumberOfRedeliveries() throws Exception { // Receive a message with the JMS API diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/TestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/TestSupport.java index 7407e4c4473..c9fc2687522 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/TestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/TestSupport.java @@ -63,17 +63,12 @@ protected Destination createDestination() { } /** - * Returns the name of the destination used in this test case + * {@return the name of the destination used in this test case} */ protected String getDestinationString() { return getClass().getName() + "." + getName(true); } - /** - * @param messsage - * @param firstSet - * @param secondSet - */ protected void assertTextMessagesEqual(String messsage, Message[] firstSet, Message[] secondSet) throws JMSException { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java index 8ac0326a5c0..f8c6f27a1da 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java @@ -38,9 +38,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class ZeroPrefetchConsumerTest extends EmbeddedBrokerTestSupport { private static final Logger LOG = LoggerFactory.getLogger(ZeroPrefetchConsumerTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/blob/BlobTransferPolicyUriTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/blob/BlobTransferPolicyUriTest.java index fbd2032cf13..b795c2c0895 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/blob/BlobTransferPolicyUriTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/blob/BlobTransferPolicyUriTest.java @@ -20,9 +20,6 @@ import org.apache.activemq.ActiveMQConnectionFactory; -/** - * - */ public class BlobTransferPolicyUriTest extends TestCase { public void testBlobTransferPolicyIsConfiguredViaUri() throws Exception { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerBenchmark.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerBenchmark.java index 9d05e311d33..b465bd6d745 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerBenchmark.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerBenchmark.java @@ -34,14 +34,12 @@ import org.slf4j.LoggerFactory; /** - * BrokerBenchmark is used to get an idea of the raw performance of a broker. - * Since the broker data structures using in message dispatching are under high - * contention from client requests, it's performance should be monitored closely - * since it typically is the biggest bottleneck in a high performance messaging - * fabric. The benchmarks are run under all the following combinations options: - * Queue vs. Topic, 1 vs. 10 producer threads, 1 vs. 10 consumer threads, and - * Persistent vs. Non-Persistent messages. Message Acking uses client ack style - * batch acking since that typically has the best ack performance. + * BrokerBenchmark is used to get an idea of the raw performance of a broker. Since the broker data structures using in + * message dispatching are under high contention from client requests, it's performance should be monitored closely + * since it typically is the biggest bottleneck in a high performance messaging fabric. The benchmarks are run under all + * the following combinations options: Queue vs. Topic, 1 vs. 10 producer threads, 1 vs. 10 consumer threads, and + * Persistent vs. Non-Persistent messages. Message Acking uses client ack style batch acking since that typically has + * the best ack performance. */ public class BrokerBenchmark extends BrokerTestSupport { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRestartTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRestartTestSupport.java index 9d520ee3842..1864fc3d75c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRestartTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRestartTestSupport.java @@ -36,10 +36,6 @@ protected BrokerService createBroker() throws Exception { return broker; } - /** - * @return - * @throws Exception - */ protected BrokerService createRestartedBroker() throws Exception { BrokerService broker = new BrokerService(); configureBroker(broker); @@ -51,11 +47,8 @@ protected void configureBroker(BrokerService broker) throws Exception { } /** - * Simulates a broker restart. The memory based persistence adapter is - * reused so that it does not "loose" it's "persistent" messages. - * - * @throws IOException - * @throws URISyntaxException + * Simulates a broker restart. The memory based persistence adapter is reused so that it does not "loose" it's + * "persistent" messages. */ protected void restartBroker() throws Exception { broker.stop(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java index bcd93851d69..d30fc9c0218 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java @@ -97,9 +97,7 @@ public void testQueueOnlyOnceDeliveryWith2Consumers() throws Exception { assertNoMessagesLeft(connection2); } - /* - * change the order of the above test - */ + // change the order of the above test public void testQueueBrowserWith2ConsumersBrowseFirst() throws Exception { ActiveMQDestination destination = new ActiveMQQueue("TEST"); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java index 11a9edbf3e1..3a03ebdd34a 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTestSupport.java @@ -57,8 +57,7 @@ public class BrokerTestSupport extends CombinationTestSupport { /** - * Setting this to false makes the test run faster but they may be less - * accurate. + * Setting this to false makes the test run faster but they may be less accurate. */ public static final boolean FAST_NO_MESSAGE_LEFT_ASSERT = System.getProperty("FAST_NO_MESSAGE_LEFT_ASSERT", "true").equals("true"); @@ -318,11 +317,6 @@ protected StubConnection createConnection() throws Exception { return new StubConnection(broker); } - /** - * @param connection - * @return - * @throws InterruptedException - */ public Message receiveMessage(StubConnection connection) throws InterruptedException { return receiveMessage(connection, maxWait); } diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java index a42f7b924a3..78082d11ba1 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQBytesMessageTest.java @@ -23,9 +23,6 @@ import junit.framework.TestCase; -/** - * - */ public class ActiveMQBytesMessageTest extends TestCase { public ActiveMQBytesMessageTest(String name) { @@ -36,17 +33,11 @@ public static void main(String[] args) { junit.textui.TestRunner.run(ActiveMQBytesMessageTest.class); } - /* - * @see TestCase#setUp() - */ @Override protected void setUp() throws Exception { super.setUp(); } - /* - * @see TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { super.tearDown(); @@ -209,9 +200,7 @@ public void testReadUTF() { } } - /* - * Class to test for int readBytes(byte[]) - */ + // Class to test for int readBytes(byte[]) public void testReadBytesbyteArray() { ActiveMQBytesMessage msg = new ActiveMQBytesMessage(); try { @@ -255,7 +244,6 @@ public void testWriteObject() throws JMSException { } } - /* new */ public void testClearBody() throws JMSException { ActiveMQBytesMessage bytesMessage = new ActiveMQBytesMessage(); try { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java index 1bdb96d13d6..28942db8dfa 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java @@ -31,20 +31,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class ActiveMQMapMessageTest extends TestCase { private static final Logger LOG = LoggerFactory.getLogger(ActiveMQMapMessageTest.class); private String name = "testName"; - /** - * Constructor for ActiveMQMapMessageTest. - * - * @param name - */ public ActiveMQMapMessageTest(String name) { super(name); } @@ -53,17 +45,11 @@ public static void main(String[] args) { junit.textui.TestRunner.run(ActiveMQMapMessageTest.class); } - /* - * @see TestCase#setUp() - */ @Override protected void setUp() throws Exception { super.setUp(); } - /* - * @see TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { super.tearDown(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java index c0cdb15962e..ad2c4e72972 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMessageTest.java @@ -52,11 +52,6 @@ public class ActiveMQMessageTest extends TestCase { private long jmsTimestamp; private long[] consumerIDs; - /** - * Constructor for ActiveMQMessageTest. - * - * @param name - */ public ActiveMQMessageTest(String name) { super(name); } @@ -64,9 +59,6 @@ public ActiveMQMessageTest(String name) { public static void main(String[] args) { } - /* - * @see TestCase#setUp() - */ @Override protected void setUp() throws Exception { super.setUp(); @@ -87,9 +79,6 @@ protected void setUp() throws Exception { } } - /* - * @see TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { super.tearDown(); @@ -126,9 +115,7 @@ public void testSetToForeignJMSID() throws Exception { msg.setJMSMessageID("ID:EMS-SERVER.8B443C380083:429"); } - /* - * Class to test for boolean equals(Object) - */ + // Class to test for boolean equals(Object) public void testEqualsObject() throws Exception { ActiveMQMessage msg1 = new ActiveMQMessage(); ActiveMQMessage msg2 = new ActiveMQMessage(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQObjectMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQObjectMessageTest.java index bb4703702ff..32a94ecba66 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQObjectMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQObjectMessageTest.java @@ -23,16 +23,8 @@ import junit.framework.TestCase; -/** - * - */ public class ActiveMQObjectMessageTest extends TestCase { - /** - * Constructor for ActiveMQObjectMessageTest. - * - * @param name - */ public ActiveMQObjectMessageTest(String name) { super(name); } @@ -41,17 +33,11 @@ public static void main(String[] args) { junit.textui.TestRunner.run(ActiveMQObjectMessageTest.class); } - /* - * @see TestCase#setUp() - */ @Override protected void setUp() throws Exception { super.setUp(); } - /* - * @see TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { super.tearDown(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java index c8ad9b6943d..2e6a3227d48 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java @@ -23,16 +23,8 @@ import junit.framework.TestCase; -/** - * - */ public class ActiveMQStreamMessageTest extends TestCase { - /** - * Constructor for ActiveMQStreamMessageTest. - * - * @param name - */ public ActiveMQStreamMessageTest(String name) { super(name); } @@ -41,17 +33,11 @@ public static void main(String[] args) { junit.textui.TestRunner.run(ActiveMQStreamMessageTest.class); } - /* - * @see TestCase#setUp() - */ @Override protected void setUp() throws Exception { super.setUp(); } - /* - * @see TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { super.tearDown(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQTextMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQTextMessageTest.java index 51ee1b6b821..8bc4b0abc8d 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQTextMessageTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQTextMessageTest.java @@ -29,9 +29,6 @@ import org.apache.activemq.util.ByteSequence; import org.apache.activemq.util.MarshallingSupport; -/** - * - */ public class ActiveMQTextMessageTest extends TestCase { public static void main(String[] args) { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/DefaultQueueSender.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/DefaultQueueSender.java index 7429cda4c53..87e81a9e293 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/DefaultQueueSender.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/DefaultQueueSender.java @@ -16,13 +16,11 @@ */ /** - * The SimpleQueueSender class consists only of a main method, - * which sends several messages to a queue. - * - * Run this program in conjunction with SimpleQueueReceiver. - * Specify a queue name on the command line when you run the - * program. By default, the program sends one message. Specify - * a number after the queue name to send that number of messages. + * The SimpleQueueSender class consists only of a main method, which sends several messages to a queue. + *

                      + * Run this program in conjunction with SimpleQueueReceiver. Specify a queue name on the command line when you run the + * program. By default, the program sends one message. Specify a number after the queue name to send that number of + * messages. */ package org.apache.activemq.demo; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleConsumer.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleConsumer.java index e69f41cf1f1..7ebb91e3dbe 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleConsumer.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleConsumer.java @@ -16,11 +16,9 @@ */ /** - * The SimpleQueueReceiver class consists only of a main method, - * which fetches one or more messages from a queue using - * synchronous message delivery. Run this program in conjunction - * with SimpleQueueSender. Specify a queue name on the command - * line when you run the program. + * The SimpleQueueReceiver class consists only of a main method, which fetches one or more messages from a queue using + * synchronous message delivery. Run this program in conjunction with SimpleQueueSender. Specify a queue name on the + * command line when you run the program. */ package org.apache.activemq.demo; @@ -37,8 +35,8 @@ import javax.naming.NamingException; /** - * A simple polymorphic JMS consumer which can work with Queues or Topics which - * uses JNDI to lookup the JMS connection factory and destination + * A simple polymorphic JMS consumer which can work with Queues or Topics which uses JNDI to lookup the JMS connection + * factory and destination */ public final class SimpleConsumer { @@ -59,9 +57,7 @@ public static void main(String[] args) { Destination destination = null; MessageConsumer consumer = null; - /* - * Read destination name from command line and display it. - */ + // Read destination name from command line and display it. if (args.length != 1) { LOG.info("Usage: java SimpleConsumer "); System.exit(1); @@ -69,9 +65,7 @@ public static void main(String[] args) { destinationName = args[0]; LOG.info("Destination name is " + destinationName); - /* - * Create a JNDI API InitialContext object - */ + // Create a JNDI API InitialContext object try { jndiContext = new InitialContext(); } catch (NamingException e) { @@ -79,9 +73,7 @@ public static void main(String[] args) { System.exit(1); } - /* - * Look up connection factory and destination. - */ + // Look up connection factory and destination. try { connectionFactory = (ConnectionFactory) jndiContext.lookup("ConnectionFactory"); destination = (Destination) jndiContext.lookup(destinationName); @@ -90,13 +82,11 @@ public static void main(String[] args) { System.exit(1); } - /* - * Create connection. Create session from connection; false means - * session is not transacted. Create receiver, then start message - * delivery. Receive all text messages from destination until a non-text - * message is received indicating end of message stream. Close - * connection. - */ + /* + * Create connection. Create session from connection; false means session is not transacted. Create receiver, then + * start message delivery. Receive all text messages from destination until a non-text message is received + * indicating end of message stream. Close connection. + */ try { connection = connectionFactory.createConnection(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleProducer.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleProducer.java index b5896f2646d..a0d9fc1f443 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleProducer.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleProducer.java @@ -16,13 +16,11 @@ */ /** - * The SimpleQueueSender class consists only of a main method, - * which sends several messages to a queue. - * - * Run this program in conjunction with SimpleQueueReceiver. - * Specify a queue name on the command line when you run the - * program. By default, the program sends one message. Specify - * a number after the queue name to send that number of messages. + * The SimpleQueueSender class consists only of a main method, which sends several messages to a queue. + *

                      + * Run this program in conjunction with SimpleQueueReceiver. Specify a queue name on the command line when you run the + * program. By default, the program sends one message. Specify a number after the queue name to send that number of + * messages. */ package org.apache.activemq.demo; @@ -43,8 +41,8 @@ import org.slf4j.LoggerFactory; /** - * A simple polymorphic JMS producer which can work with Queues or Topics which - * uses JNDI to lookup the JMS connection factory and destination + * A simple polymorphic JMS producer which can work with Queues or Topics which uses JNDI to lookup the JMS connection + * factory and destination */ public final class SimpleProducer { @@ -54,8 +52,7 @@ private SimpleProducer() { } /** - * @param args the destination name to send to and optionally, the number of - * messages to send + * @param args the destination name to send to and optionally, the number of messages to send */ public static void main(String[] args) { Context jndiContext = null; @@ -79,9 +76,7 @@ public static void main(String[] args) { numMsgs = 1; } - /* - * Create a JNDI API InitialContext object - */ + // Create a JNDI API InitialContext object try { jndiContext = new InitialContext(); } catch (NamingException e) { @@ -89,9 +84,7 @@ public static void main(String[] args) { System.exit(1); } - /* - * Look up connection factory and destination. - */ + // Look up connection factory and destination. try { connectionFactory = (ConnectionFactory) jndiContext.lookup("ConnectionFactory"); destination = (Destination) jndiContext.lookup(destinationName); @@ -100,12 +93,10 @@ public static void main(String[] args) { System.exit(1); } - /* - * Create connection. Create session from connection; false means - * session is not transacted. Create sender and text message. Send - * messages, varying text slightly. Send end-of-messages message. - * Finally, close connection. - */ + /* + * Create connection. Create session from connection; false means session is not transacted. Create sender and text + * message. Send messages, varying text slightly. Send end-of-messages message. Finally, close connection. + */ try { connection = connectionFactory.createConnection(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); @@ -117,9 +108,7 @@ public static void main(String[] args) { producer.send(message); } - /* - * Send a non-text control message indicating end of messages. - */ + // Send a non-text control message indicating end of messages. producer.send(session.createMessage()); } catch (JMSException e) { LOG.info("Exception occurred: " + e); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueReceiver.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueReceiver.java index 959e14d4454..c850d881d6a 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueReceiver.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueReceiver.java @@ -16,11 +16,9 @@ */ /** - * The SimpleQueueReceiver class consists only of a main method, - * which fetches one or more messages from a queue using - * synchronous message delivery. Run this program in conjunction - * with SimpleQueueSender. Specify a queue name on the command - * line when you run the program. + * The SimpleQueueReceiver class consists only of a main method, which fetches one or more messages from a queue using + * synchronous message delivery. Run this program in conjunction with SimpleQueueSender. Specify a queue name on the + * command line when you run the program. */ package org.apache.activemq.demo; @@ -62,9 +60,7 @@ public static void main(String[] args) { QueueReceiver queueReceiver = null; TextMessage message = null; - /* - * Read queue name from command line and display it. - */ + // Read queue name from command line and display it. if (args.length != 1) { LOG.info("Usage: java " + "SimpleQueueReceiver "); System.exit(1); @@ -72,9 +68,7 @@ public static void main(String[] args) { queueName = args[0]; LOG.info("Queue name is " + queueName); - /* - * Create a JNDI API InitialContext object if none exists yet. - */ + // Create a JNDI API InitialContext object if none exists yet. try { jndiContext = new InitialContext(); } catch (NamingException e) { @@ -82,9 +76,7 @@ public static void main(String[] args) { System.exit(1); } - /* - * Look up connection factory and queue. If either does not exist, exit. - */ + // Look up connection factory and queue. If either does not exist, exit. try { queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("QueueConnectionFactory"); queue = (Queue) jndiContext.lookup(queueName); @@ -93,13 +85,11 @@ public static void main(String[] args) { System.exit(1); } - /* - * Create connection. Create session from connection; false means - * session is not transacted. Create receiver, then start message - * delivery. Receive all text messages from queue until a non-text - * message is received indicating end of message stream. Close - * connection. - */ + /* + * Create connection. Create session from connection; false means session is not transacted. Create receiver, then + * start message delivery. Receive all text messages from queue until a non-text message is received indicating end + * of message stream. Close connection. + */ try { queueConnection = queueConnectionFactory.createQueueConnection(); queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java index c42ff5ed96d..f8d05b0908c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/demo/SimpleQueueSender.java @@ -16,13 +16,11 @@ */ /** - * The SimpleQueueSender class consists only of a main method, - * which sends several messages to a queue. - * - * Run this program in conjunction with SimpleQueueReceiver. - * Specify a queue name on the command line when you run the - * program. By default, the program sends one message. Specify - * a number after the queue name to send that number of messages. + * The SimpleQueueSender class consists only of a main method, which sends several messages to a queue. + *

                      + * Run this program in conjunction with SimpleQueueReceiver. Specify a queue name on the command line when you run the + * program. By default, the program sends one message. Specify a number after the queue name to send that number of + * messages. */ package org.apache.activemq.demo; @@ -53,8 +51,7 @@ private SimpleQueueSender() { /** * Main method. * - * @param args the queue used by the example and, optionally, the number of - * messages to send + * @param args the queue used by the example and, optionally, the number of messages to send */ public static void main(String[] args) { String queueName = null; @@ -79,9 +76,7 @@ public static void main(String[] args) { numMsgs = 1; } - /* - * Create a JNDI API InitialContext object if none exists yet. - */ + // Create a JNDI API InitialContext object if none exists yet. try { jndiContext = new InitialContext(); } catch (NamingException e) { @@ -89,9 +84,7 @@ public static void main(String[] args) { System.exit(1); } - /* - * Look up connection factory and queue. If either does not exist, exit. - */ + // Look up connection factory and queue. If either does not exist, exit. try { queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("QueueConnectionFactory"); queue = (Queue) jndiContext.lookup(queueName); @@ -100,12 +93,10 @@ public static void main(String[] args) { System.exit(1); } - /* - * Create connection. Create session from connection; false means - * session is not transacted. Create sender and text message. Send - * messages, varying text slightly. Send end-of-messages message. - * Finally, close connection. - */ + /* + * Create connection. Create session from connection; false means session is not transacted. Create sender and text + * message. Send messages, varying text slightly. Send end-of-messages message. Finally, close connection. + */ try { queueConnection = queueConnectionFactory.createQueueConnection(); queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); @@ -117,9 +108,7 @@ public static void main(String[] args) { queueSender.send(message); } - /* - * Send a non-text control message indicating end of messages. - */ + // Send a non-text control message indicating end of messages. queueSender.send(queueSession.createMessage()); } catch (JMSException e) { LOG.info("Exception occurred: " + e.toString()); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/NetworkTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/NetworkTestSupport.java index e97b34b6dd8..bfd2b64a184 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/NetworkTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/network/NetworkTestSupport.java @@ -67,23 +67,10 @@ protected BrokerService createBroker() throws Exception { return broker; } - /** - * @return - * @throws Exception - * @throws IOException - * @throws URISyntaxException - */ protected TransportConnector createRemoteConnector() throws Exception, IOException, URISyntaxException { return new TransportConnector(TransportFactory.bind(new URI(getRemoteURI()))); } - /** - * @param value - * @return - * @throws Exception - * @throws IOException - * @throws URISyntaxException - */ protected TransportConnector createConnector() throws Exception, IOException, URISyntaxException { return new TransportConnector(TransportFactory.bind(new URI(getLocalURI()))); } @@ -137,10 +124,8 @@ protected Transport createRemoteTransport() throws Exception { } /** - * Simulates a broker restart. The memory based persistence adapter is - * reused so that it does not "loose" it's "persistent" messages. - * - * @throws Exception + * Simulates a broker restart. The memory based persistence adapter is reused so that it does not "loose" it's + * "persistent" messages. */ protected void restartRemoteBroker() throws Exception { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/BooleanStreamTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/BooleanStreamTest.java index d2e11c9aab2..71b3d9799dc 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/BooleanStreamTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/BooleanStreamTest.java @@ -25,9 +25,6 @@ import junit.framework.AssertionFailedError; import junit.framework.TestCase; -/** - * - */ public class BooleanStreamTest extends TestCase { protected OpenWireFormat openWireformat; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGenerator.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGenerator.java index 11362158d84..2f2ba5cf24c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGenerator.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/DataFileGenerator.java @@ -43,13 +43,6 @@ public static void main(String[] args) throws Exception { generateControlFiles(); } - /** - * @param srcdir - * @return - * @throws ClassNotFoundException - * @throws InstantiationException - * @throws IllegalAccessException - */ public static List getAllDataFileGenerators() throws Exception { // System.out.println("Looking for generators in : "+classFileDir); List l = new ArrayList<>(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java index 2ffd91382a3..adb7b2ab742 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/openwire/NumberRangesWhileMarshallingTest.java @@ -29,9 +29,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class NumberRangesWhileMarshallingTest extends TestCase { private static final Logger LOG = LoggerFactory.getLogger(NumberRangesWhileMarshallingTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsResourceProvider.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsResourceProvider.java index 88295d42b5e..74573d89df9 100755 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsResourceProvider.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsResourceProvider.java @@ -30,9 +30,6 @@ import org.apache.activemq.ActiveMQConnectionFactory; -/** - * - */ public class JmsResourceProvider { private String serverUri = "vm://localhost?broker.persistent=false"; @@ -73,8 +70,7 @@ public Session createSession(Connection conn) throws JMSException { } /** - * @see org.apache.activemq.test.JmsResourceProvider#createConsumer(javax.jms.Session, - * javax.jms.Destination) + * @see org.apache.activemq.test.JmsResourceProvider#createConsumer(javax.jms.Session, javax.jms.Destination) */ public MessageConsumer createConsumer(Session session, Destination destination) throws JMSException { if (isDurableSubscriber()) { @@ -98,8 +94,7 @@ public ConnectionConsumer createConnectionConsumer(Connection connection, /** * Creates a producer. * - * @see org.apache.activemq.test.JmsResourceProvider#createProducer(javax.jms.Session, - * javax.jms.Destination) + * @see org.apache.activemq.test.JmsResourceProvider#createProducer(javax.jms.Session, javax.jms.Destination) */ public MessageProducer createProducer(Session session, Destination destination) throws JMSException { MessageProducer producer = session.createProducer(destination); @@ -110,8 +105,7 @@ public MessageProducer createProducer(Session session, Destination destination) /** * Creates a destination, which can either a topic or a queue. * - * @see org.apache.activemq.test.JmsResourceProvider#createDestination(javax.jms.Session, - * String) + * @see org.apache.activemq.test.JmsResourceProvider#createDestination(javax.jms.Session, String) */ public Destination createDestination(Session session, String name) throws JMSException { if (isTopic) { @@ -121,82 +115,38 @@ public Destination createDestination(Session session, String name) throws JMSExc } } - /** - * Returns true if the subscriber is durable. - * - * @return isDurableSubscriber - */ public boolean isDurableSubscriber() { return isTopic && durableName != null; } - /** - * Returns the acknowledgement mode. - * - * @return Returns the ackMode. - */ public int getAckMode() { return ackMode; } - /** - * Sets the acnknowledgement mode. - * - * @param ackMode The ackMode to set. - */ public void setAckMode(int ackMode) { this.ackMode = ackMode; } - /** - * Returns true if the destination is a topic, false if the destination is a - * queue. - * - * @return Returns the isTopic. - */ public boolean isTopic() { return isTopic; } - /** - * @param isTopic The isTopic to set. - */ public void setTopic(boolean isTopic) { this.isTopic = isTopic; } - /** - * Returns the server URI. - * - * @return Returns the serverUri. - */ public String getServerUri() { return serverUri; } - /** - * Sets the server URI. - * - * @param serverUri - the server URI to set. - */ public void setServerUri(String serverUri) { this.serverUri = serverUri; } - /** - * Return true if the session is transacted. - * - * @return Returns the transacted. - */ public boolean isTransacted() { return transacted; } - /** - * Sets the session to be transacted. - * - * @param transacted - */ public void setTransacted(boolean transacted) { this.transacted = transacted; if (transacted) { @@ -204,56 +154,26 @@ public void setTransacted(boolean transacted) { } } - /** - * Returns the delivery mode. - * - * @return deliveryMode - */ public int getDeliveryMode() { return deliveryMode; } - /** - * Sets the delivery mode. - * - * @param deliveryMode - */ public void setDeliveryMode(int deliveryMode) { this.deliveryMode = deliveryMode; } - /** - * Returns the client id. - * - * @return clientID - */ public String getClientID() { return clientID; } - /** - * Sets the client id. - * - * @param clientID - */ public void setClientID(String clientID) { this.clientID = clientID; } - /** - * Returns the durable name of the provider. - * - * @return durableName - */ public String getDurableName() { return durableName; } - /** - * Sets the durable name of the provider. - * - * @param durableName - */ public void setDurableName(String durableName) { this.durableName = durableName; } diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java index 16f8bf3fcf3..61872d4007b 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java @@ -37,9 +37,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public abstract class JmsSendReceiveTestSupport extends org.apache.activemq.TestSupport implements MessageListener { private static final Logger LOG = LoggerFactory.getLogger(JmsSendReceiveTestSupport.class); @@ -62,9 +59,6 @@ public abstract class JmsSendReceiveTestSupport extends org.apache.activemq.Test protected boolean largeMessages; protected int largeMessageLoopSize = 4 * 1024; - /* - * @see junit.framework.TestCase#setUp() - */ @Override protected void setUp() throws Exception { super.setUp(); @@ -102,8 +96,6 @@ protected String createMessageBodyText() { /** * Test if all the messages sent are being received. - * - * @throws Exception */ public void testSendReceive() throws Exception { @@ -139,8 +131,6 @@ protected Message createMessage(int index) throws JMSException { /** * A hook to allow the message to be configured such as adding extra headers - * - * @throws JMSException */ protected void configureMessage(Message message) throws JMSException { } @@ -148,8 +138,6 @@ protected void configureMessage(Message message) throws JMSException { /** * Waits to receive the messages and performs the test if all messages have * been received and are in sequential order. - * - * @throws JMSException */ protected void assertMessagesAreReceived() throws JMSException { waitForMessagesToBeDelivered(); @@ -158,9 +146,6 @@ protected void assertMessagesAreReceived() throws JMSException { /** * Tests if the messages have all been received and are in sequential order. - * - * @param receivedMessages - * @throws JMSException */ protected void assertMessagesReceivedAreValid(List receivedMessages) throws JMSException { List copyOfMessages = Arrays.asList(receivedMessages.toArray()); @@ -253,7 +238,7 @@ protected void consumeMessage(Message message, List messageList) { /** * Creates a synchronized list. * - * @return a synchronized view of the specified list. + * @return a synchronized view of the specified list */ protected List createConcurrentList() { return Collections.synchronizedList(new ArrayList<>()); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveTest.java index 8167f178a41..6ef54f7215c 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveTest.java @@ -28,9 +28,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport { private static final Logger LOG = LoggerFactory.getLogger(JmsTopicSendReceiveTest.class); @@ -88,7 +85,7 @@ protected void tearDown() throws Exception { LOG.info("Closing down connection"); - /** TODO we should be able to shut down properly */ + // TODO we should be able to shut down properly session.close(); connection.close(); ArtemisBrokerHelper.stopArtemisBroker(); @@ -99,7 +96,6 @@ protected void tearDown() throws Exception { * Creates a session. * * @return session - * @throws JMSException */ protected Session createConsumerSession() throws JMSException { if (useSeparateSession) { @@ -112,8 +108,7 @@ protected Session createConsumerSession() throws JMSException { /** * Creates a durable suscriber or a consumer. * - * @return MessageConsumer - durable suscriber or consumer. - * @throws JMSException + * @return MessageConsumer durable suscriber or consumer */ protected MessageConsumer createConsumer() throws JMSException { if (durable) { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java index b92cad5c59d..29fd3f38f4b 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java @@ -28,9 +28,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class JmsTopicSendReceiveWithTwoConnectionsTest extends JmsSendReceiveTestSupport { private static final Logger LOG = LoggerFactory.getLogger(JmsTopicSendReceiveWithTwoConnectionsTest.class); @@ -41,8 +38,6 @@ public class JmsTopicSendReceiveWithTwoConnectionsTest extends JmsSendReceiveTes /** * Sets up a test where the producer and consumer have their own connection. - * - * @see junit.framework.TestCase#setUp() */ @Override protected void setUp() throws Exception { @@ -95,9 +90,6 @@ protected MessageConsumer createConsumer() throws JMSException { return receiveSession.createConsumer(consumerDestination); } - /* - * @see junit.framework.TestCase#tearDown() - */ @Override protected void tearDown() throws Exception { session.close(); @@ -108,31 +100,14 @@ protected void tearDown() throws Exception { ArtemisBrokerHelper.stopArtemisBroker(); } - /** - * Creates a connection. - * - * @return Connection - * @throws Exception - */ protected Connection createReceiveConnection() throws Exception { return createConnection(); } - /** - * Creates a connection. - * - * @return Connection - * @throws Exception - */ protected Connection createSendConnection() throws Exception { return createConnection(); } - /** - * Creates an ActiveMQConnectionFactory. - * - * @see org.apache.activemq.test.TestSupport#createConnectionFactory() - */ @Override protected ActiveMQConnectionFactory createConnectionFactory() throws Exception { return new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/TestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/TestSupport.java index 9370c8cbf09..b36bae7ff0d 100755 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/TestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/test/TestSupport.java @@ -35,8 +35,6 @@ /** * Useful base class for unit test cases - * - * */ public abstract class TestSupport extends TestCase { @@ -51,38 +49,24 @@ public TestSupport(String name) { super(name); } - /** - * Creates an ActiveMQMessage. - * - * @return ActiveMQMessage - */ protected ActiveMQMessage createMessage() { return new ActiveMQMessage(); } - /** - * Creates a destination. - * - * @param subject - topic or queue name. - * @return Destination - either an ActiveMQTopic or ActiveMQQUeue. - */ - protected Destination createDestination(String subject) { + protected Destination createDestination(String name) { if (topic) { - return new ActiveMQTopic(subject); + return new ActiveMQTopic(name); } else { - return new ActiveMQQueue(subject); + return new ActiveMQQueue(name); } } /** * Tests if firstSet and secondSet are equal. * - * @param messsage - string to be displayed when the assertion fails. - * @param firstSet[] - set of messages to be compared with its counterpart - * in the secondset. - * @param secondSet[] - set of messages to be compared with its counterpart - * in the firstset. - * @throws javax.jms.JMSException + * @param messsage - string to be displayed when the assertion fails. + * @param firstSet[] - set of messages to be compared with its counterpart in the secondset. + * @param secondSet[] - set of messages to be compared with its counterpart in the firstset. */ protected void assertTextMessagesEqual(Message[] firstSet, Message[] secondSet) throws JMSException { assertTextMessagesEqual("", firstSet, secondSet); @@ -91,11 +75,9 @@ protected void assertTextMessagesEqual(Message[] firstSet, Message[] secondSet) /** * Tests if firstSet and secondSet are equal. * - * @param messsage - string to be displayed when the assertion fails. - * @param firstSet[] - set of messages to be compared with its counterpart - * in the secondset. - * @param secondSet[] - set of messages to be compared with its counterpart - * in the firstset. + * @param messsage - string to be displayed when the assertion fails. + * @param firstSet[] - set of messages to be compared with its counterpart in the secondset. + * @param secondSet[] - set of messages to be compared with its counterpart in the firstset. */ protected void assertTextMessagesEqual(String messsage, Message[] firstSet, @@ -114,7 +96,6 @@ protected void assertTextMessagesEqual(String messsage, * * @param m1 - message to be compared with m2. * @param m2 - message to be compared with m1. - * @throws javax.jms.JMSException */ protected void assertEquals(TextMessage m1, TextMessage m2) throws JMSException { assertEquals("", m1, m2); @@ -123,9 +104,9 @@ protected void assertEquals(TextMessage m1, TextMessage m2) throws JMSException /** * Tests if m1 and m2 are equal. * - * @param message - string to be displayed when the assertion fails. - * @param m1 - message to be compared with m2. - * @param m2 - message to be compared with m1. + * @param message string to be displayed when the assertion fails. + * @param m1 message to be compared with m2. + * @param m2 message to be compared with m1. */ protected void assertTextMessageEqual(String message, TextMessage m1, TextMessage m2) throws JMSException { assertFalse(message + ": expected {" + m1 + "}, but was {" + m2 + "}", m1 == null ^ m2 == null); @@ -140,9 +121,8 @@ protected void assertTextMessageEqual(String message, TextMessage m1, TextMessag /** * Tests if m1 and m2 are equal. * - * @param m1 - message to be compared with m2. - * @param m2 - message to be compared with m1. - * @throws javax.jms.JMSException + * @param m1 message to be compared with m2. + * @param m2 message to be compared with m1. */ protected void assertEquals(Message m1, Message m2) throws JMSException { assertEquals("", m1, m2); @@ -152,8 +132,8 @@ protected void assertEquals(Message m1, Message m2) throws JMSException { * Tests if m1 and m2 are equal. * * @param message - error message. - * @param m1 - message to be compared with m2. - * @param m2 -- message to be compared with m1. + * @param m1 message to be compared with m2. + * @param m2 message to be compared with m1. */ protected void assertEquals(String message, Message m1, Message m2) throws JMSException { assertFalse(message + ": expected {" + m1 + "}, but was {" + m2 + "}", m1 == null ^ m2 == null); @@ -182,7 +162,6 @@ protected void assertBaseDirectoryContainsSpaces() { * Creates an ActiveMQConnectionFactory. * * @return ActiveMQConnectionFactory - * @throws Exception */ protected ActiveMQConnectionFactory createConnectionFactory() throws Exception { return new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); @@ -192,7 +171,6 @@ protected ActiveMQConnectionFactory createConnectionFactory() throws Exception { * Factory method to create a new connection. * * @return connection - * @throws Exception */ protected Connection createConnection() throws Exception { return getConnectionFactory().createConnection(); @@ -202,7 +180,6 @@ protected Connection createConnection() throws Exception { * Creates an ActiveMQ connection factory. * * @return connectionFactory - * @throws Exception */ public ActiveMQConnectionFactory getConnectionFactory() throws Exception { if (connectionFactory == null) { @@ -213,29 +190,14 @@ public ActiveMQConnectionFactory getConnectionFactory() throws Exception { return connectionFactory; } - /** - * Returns the consumer subject. - * - * @return String - */ protected String getConsumerSubject() { return getSubject(); } - /** - * Returns the producer subject. - * - * @return String - */ protected String getProducerSubject() { return getSubject(); } - /** - * Returns the subject. - * - * @return String - */ protected String getSubject() { return getClass().getName() + "." + getName(); } diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/QueueClusterTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/QueueClusterTest.java index 93bcf0680de..033498ed88b 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/QueueClusterTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/QueueClusterTest.java @@ -18,9 +18,6 @@ import org.junit.Before; -/** - * - */ public class QueueClusterTest extends TopicClusterTest { @Override diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubCompositeTransport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubCompositeTransport.java index 2fe7f509246..63c446f9b98 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubCompositeTransport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubCompositeTransport.java @@ -21,9 +21,6 @@ import java.util.Arrays; import java.util.List; -/** - * - */ public class StubCompositeTransport extends StubTransport implements CompositeTransport { private List transportURIs = new ArrayList<>(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransport.java index a934f0b9c8a..dab9ea5d187 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransport.java @@ -25,10 +25,6 @@ import org.apache.activemq.util.ServiceStopper; import org.apache.activemq.wireformat.WireFormat; -/** - * - * - */ public class StubTransport extends TransportSupport { private Queue queue = new ConcurrentLinkedQueue<>(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransportListener.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransportListener.java index 9fb87dd8ef8..c5c55c7c625 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransportListener.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/StubTransportListener.java @@ -20,10 +20,6 @@ import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; -/** - * - * - */ public class StubTransportListener implements TransportListener { private final Queue commands = new ConcurrentLinkedQueue<>(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TopicClusterTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TopicClusterTest.java index 9bb93e724a0..7e2a04b6210 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TopicClusterTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TopicClusterTest.java @@ -41,9 +41,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class TopicClusterTest extends OpenwireArtemisBaseTest implements MessageListener { protected static final int MESSAGE_COUNT = 50; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverComplexClusterTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverComplexClusterTest.java index f1a427dc936..516eca39794 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverComplexClusterTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverComplexClusterTest.java @@ -42,11 +42,10 @@ import org.junit.Test; /** - * Complex cluster test that will exercise the dynamic failover capabilities of - * a network of brokers. Using a networking of 3 brokers where the 3rd broker is - * removed and then added back in it is expected in each test that the number of - * connections on the client should start with 3, then have two after the 3rd - * broker is removed and then show 3 after the 3rd broker is reintroduced. + * Complex cluster test that will exercise the dynamic failover capabilities of a network of brokers. Using a networking + * of 3 brokers where the 3rd broker is removed and then added back in it is expected in each test that the number of + * connections on the client should start with 3, then have two after the 3rd broker is removed and then show 3 after + * the 3rd broker is reintroduced. */ @Ignore public class FailoverComplexClusterTest extends OpenwireArtemisBaseTest { @@ -105,8 +104,6 @@ public void tearDown() throws Exception { /** * Basic dynamic failover 3 broker test - * - * @throws Exception */ @Test public void testThreeBrokerClusterSingleConnectorBasic() throws Exception { @@ -119,12 +116,9 @@ public void testThreeBrokerClusterSingleConnectorBasic() throws Exception { } /** - * Tests a 3 broker configuration to ensure that the backup is random and - * supported in a cluster. useExponentialBackOff is set to false and - * maxReconnectAttempts is set to 1 to move through the list quickly for + * Tests a 3 broker configuration to ensure that the backup is random and supported in a cluster. + * useExponentialBackOff is set to false and maxReconnectAttempts is set to 1 to move through the list quickly for * this test. - * - * @throws Exception */ @Test public void testThreeBrokerClusterSingleConnectorBackupFailoverConfig() throws Exception { @@ -139,12 +133,9 @@ public void testThreeBrokerClusterSingleConnectorBackupFailoverConfig() throws E } /** - * Tests a 3 broker cluster that passes in connection params on the - * transport connector. Prior versions of AMQ passed the TC connection - * params to the client and this should not happen. The chosen param is not - * compatible with the client and will throw an error if used. - * - * @throws Exception + * Tests a 3 broker cluster that passes in connection params on the transport connector. Prior versions of AMQ passed + * the TC connection params to the client and this should not happen. The chosen param is not compatible with the + * client and will throw an error if used. */ @Test public void testThreeBrokerClusterSingleConnectorWithParams() throws Exception { @@ -159,8 +150,6 @@ public void testThreeBrokerClusterSingleConnectorWithParams() throws Exception { /** * Tests a 3 broker cluster using a cluster filter of * - * - * @throws Exception */ @Test public void testThreeBrokerClusterWithClusterFilter() throws Exception { @@ -173,10 +162,8 @@ public void testThreeBrokerClusterWithClusterFilter() throws Exception { } /** - * Test to verify that a broker with multiple transport connections only the - * one marked to update clients is propagate - * - * @throws Exception + * Test to verify that a broker with multiple transport connections only the one marked to update clients is + * propagate */ @Test public void testThreeBrokerClusterMultipleConnectorBasic() throws Exception { @@ -192,8 +179,6 @@ public void testThreeBrokerClusterMultipleConnectorBasic() throws Exception { /** * Test to verify the reintroduction of the A Broker - * - * @throws Exception */ @Test public void testOriginalBrokerRestart() throws Exception { @@ -221,8 +206,6 @@ public void testOriginalBrokerRestart() throws Exception { /** * Test to ensure clients are evenly to all available brokers in the * network. - * - * @throws Exception */ @Test public void testThreeBrokerClusterClientDistributions() throws Exception { @@ -236,10 +219,7 @@ public void testThreeBrokerClusterClientDistributions() throws Exception { } /** - * Test to verify that clients are distributed with no less than 20% of the - * clients on any one broker. - * - * @throws Exception + * Test to verify that clients are distributed with no less than 20% of the clients on any one broker. */ @Test public void testThreeBrokerClusterDestinationFilter() throws Exception { @@ -288,20 +268,12 @@ public void testFailOverWithUpdateClientsOnRemove() throws Exception { } /** - * Runs a 3 Broker dynamic failover test:
                      + * Runs a 3 Broker dynamic failover test: *
                        *
                      • asserts clients are distributed across all 3 brokers
                      • *
                      • asserts clients are distributed across 2 brokers after removing the 3rd
                      • - *
                      • asserts clients are distributed across all 3 brokers after - * reintroducing the 3rd broker
                      • + *
                      • asserts clients are distributed across all 3 brokers after reintroducing the 3rd broker
                      • *
                      - * - * @param multi - * @param tcParams - * @param clusterFilter - * @param destinationFilter - * @throws Exception - * @throws InterruptedException */ private void runTests(boolean multi, String tcParams, diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/multicast/MulticastTransportTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/multicast/MulticastTransportTest.java index 4f646709cdf..dd271884cf4 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/multicast/MulticastTransportTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/multicast/MulticastTransportTest.java @@ -26,10 +26,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - * - */ public class MulticastTransportTest extends UdpTransportTest { private static final Logger LOG = LoggerFactory.getLogger(MulticastTransportTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsSendAndReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsSendAndReceiveTest.java index 614eb770bdd..50b0e034ff3 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsSendAndReceiveTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/nio/NIOJmsSendAndReceiveTest.java @@ -20,9 +20,6 @@ import org.apache.activemq.broker.BrokerService; import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest; -/** - * - */ public class NIOJmsSendAndReceiveTest extends JmsTopicSendReceiveWithTwoConnectionsTest { protected BrokerService broker; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java index e207afb031d..5dc20e8e143 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/peer/PeerTransportTest.java @@ -39,9 +39,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class PeerTransportTest extends TestCase { protected static final int MESSAGE_COUNT = 50; @@ -133,9 +130,6 @@ protected ActiveMQDestination createDestination(String name) { } } - /** - * @throws Exception - */ public void testSendReceive() throws Exception { for (int i = 0; i < MESSAGE_COUNT; i++) { for (int x = 0; x < producers.length; x++) { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/DropCommandStrategy.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/DropCommandStrategy.java index 98c61530f46..df6e2f6265f 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/DropCommandStrategy.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/DropCommandStrategy.java @@ -18,15 +18,10 @@ import java.net.SocketAddress; -/** - * - * - */ public interface DropCommandStrategy { /** - * Returns true if the command should be dropped for - * the given command ID and address + * {@return {@code true} if the command should be dropped for the given command ID and address} */ boolean shouldDropCommand(int commandId, SocketAddress address, boolean redelivery); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/ReliableTransportTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/ReliableTransportTest.java index 49be25ad409..f07ddcb06c0 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/ReliableTransportTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/ReliableTransportTest.java @@ -26,9 +26,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class ReliableTransportTest extends TestCase { private static final Logger LOG = LoggerFactory.getLogger(ReliableTransportTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java index 672cc8eed5f..58dc3b9c60b 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramChannel.java @@ -29,9 +29,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class UnreliableCommandDatagramChannel extends CommandDatagramChannel { private static final Logger LOG = LoggerFactory.getLogger(UnreliableCommandDatagramChannel.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramSocket.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramSocket.java index 14060ebedaf..d043f02f248 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramSocket.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableCommandDatagramSocket.java @@ -27,9 +27,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class UnreliableCommandDatagramSocket extends CommandDatagramSocket { private static final Logger LOG = LoggerFactory.getLogger(UnreliableCommandDatagramSocket.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java index 3cf19b811d5..8af62e35964 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransport.java @@ -26,8 +26,8 @@ import org.apache.activemq.transport.udp.UdpTransport; /** - * An unreliable UDP transport that will randomly discard packets to simulate a - * bad network (or UDP buffers being flooded). + * An unreliable UDP transport that will randomly discard packets to simulate a bad network (or UDP buffers being + * flooded). */ public class UnreliableUdpTransport extends UdpTransport { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java index 7d44f7916b5..7a1b3138619 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/reliable/UnreliableUdpTransportTest.java @@ -28,10 +28,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - * - */ public class UnreliableUdpTransportTest extends UdpTransportTest { private static final Logger LOG = LoggerFactory.getLogger(UnreliableUdpTransportTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java index 14bef1f63ff..a00887aad12 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/InactivityMonitorTest.java @@ -60,10 +60,6 @@ protected void setUp() throws Exception { startTransportServer(); } - /** - * @throws Exception - * @throws URISyntaxException - */ private void startClient() throws Exception, URISyntaxException { clientTransport = TransportFactory.connect(new URI("tcp://localhost:" + serverPort + "?trace=true&wireFormat.maxInactivityDuration=1000")); clientTransport.setTransportListener(new TransportListener() { @@ -95,11 +91,6 @@ public void transportResumed() { clientTransport.start(); } - /** - * @throws IOException - * @throws URISyntaxException - * @throws Exception - */ private void startTransportServer() throws IOException, URISyntaxException, Exception { server = TransportFactory.bind(new URI("tcp://localhost:0?trace=true&wireFormat.maxInactivityDuration=1000")); server.setAcceptListener(this); @@ -230,11 +221,7 @@ public void testNoClientHang() throws Exception { } /** - * Used to test when an operation blocks. This should not cause transport to - * get disconnected. - * - * @throws Exception - * @throws URISyntaxException + * Used to test when an operation blocks. This should not cause transport to get disconnected. */ public void initCombosForTestNoClientHangWithServerBlock() throws Exception { startClient(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/QualityOfServiceUtilsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/QualityOfServiceUtilsTest.java index fb9359a6459..bd8a78b5d4d 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/QualityOfServiceUtilsTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/QualityOfServiceUtilsTest.java @@ -25,9 +25,8 @@ public class QualityOfServiceUtilsTest extends TestCase { /** - * Keeps track of the value that the System has set for the ECN bits, which - * should not be overridden when Differentiated Services is set, but may be - * overridden when Type of Service is set. + * Keeps track of the value that the System has set for the ECN bits, which should not be overridden when + * Differentiated Services is set, but may be overridden when Type of Service is set. */ private int ECN; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/ServerSocketTstFactory.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/ServerSocketTstFactory.java index 83519a92a0e..8645e2a2f9d 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/ServerSocketTstFactory.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/ServerSocketTstFactory.java @@ -25,8 +25,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - */ public class ServerSocketTstFactory extends ServerSocketFactory { private static final Logger LOG = LoggerFactory.getLogger(ServerSocketTstFactory.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextBrokerServiceTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextBrokerServiceTest.java index ae70aef0aa6..5e4d81ac4c1 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextBrokerServiceTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslContextBrokerServiceTest.java @@ -26,9 +26,6 @@ import org.apache.activemq.broker.TransportConnector; import org.springframework.context.support.ClassPathXmlApplicationContext; -/** - * - */ public class SslContextBrokerServiceTest extends TestCase { private ClassPathXmlApplicationContext context; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransport.java index d864fc46eb5..186b0ee2d91 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransport.java @@ -27,8 +27,6 @@ /** * An implementation of the {@link Transport} interface using raw tcp/ip - * - * @author David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com (logging improvement modifications) */ public class TcpFaultyTransport extends TcpTransport implements Transport, Service, Runnable { @@ -39,9 +37,6 @@ public TcpFaultyTransport(WireFormat wireFormat, super(wireFormat, socketFactory, remoteLocation, localLocation); } - /** - * @return pretty print of 'this' - */ @Override public String toString() { return "tcpfaulty://" + socket.getInetAddress() + ":" + socket.getPort(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportServer.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportServer.java index 36cb5b1280e..c9c69edda11 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportServer.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpFaultyTransportServer.java @@ -25,8 +25,6 @@ /** * A TCP based implementation of {@link TransportServer} - * - * @author David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com (logging improvement modifications) */ public class TcpFaultyTransportServer extends TcpTransportServer implements ServiceListener { @@ -37,9 +35,6 @@ public TcpFaultyTransportServer(TcpFaultyTransportFactory transportFactory, super(transportFactory, location, serverSocketFactory); } - /** - * @return pretty print of this - */ @Override public String toString() { return "" + getBindLocation(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBindTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBindTest.java index 79e67bdded5..259035b8ec8 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBindTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportBindTest.java @@ -31,8 +31,6 @@ public class TcpTransportBindTest extends EmbeddedBrokerTestSupport { /** * exercise some server side socket options - * - * @throws Exception */ @Override protected void setUp() throws Exception { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportServerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportServerTest.java index edf28d5eec5..0426f98b837 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportServerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TcpTransportServerTest.java @@ -28,9 +28,6 @@ import org.apache.activemq.transport.TransportFilter; import org.apache.activemq.transport.TransportLogger; -/** - * @author Christian Posta - */ public class TcpTransportServerTest extends TestCase { public void testDefaultPropertiesSetOnTransport() throws Exception { diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java index 57ffe55861b..f42f8702dc5 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/TransportUriTest.java @@ -26,9 +26,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public class TransportUriTest extends EmbeddedBrokerTestSupport { private static final Logger LOG = LoggerFactory.getLogger(TransportUriTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java index bbefd3b70db..a17333150d5 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/WireformatNegociationTest.java @@ -55,10 +55,6 @@ protected void setUp() throws Exception { super.setUp(); } - /** - * @throws Exception - * @throws URISyntaxException - */ private void startClient(String uri) throws Exception, URISyntaxException { clientTransport = TransportFactory.connect(new URI(uri)); clientTransport.setTransportListener(new TransportListener() { @@ -90,11 +86,6 @@ public void transportResumed() { clientTransport.start(); } - /** - * @throws IOException - * @throws URISyntaxException - * @throws Exception - */ private void startServer(String uri) throws IOException, URISyntaxException, Exception { server = TransportFactory.bind(new URI(uri)); server.setAcceptListener(new TransportAcceptListener() { @@ -162,9 +153,6 @@ protected void tearDown() throws Exception { super.tearDown(); } - /** - * @throws Exception - */ public void testWireFormatInfoSeverVersion1() throws Exception { startServer("tcp://localhost:61616?wireFormat.version=1"); @@ -180,9 +168,6 @@ public void testWireFormatInfoSeverVersion1() throws Exception { assertEquals(1, serverWF.get().getVersion()); } - /** - * @throws Exception - */ public void testWireFormatInfoClientVersion1() throws Exception { startServer("tcp://localhost:61616"); @@ -198,9 +183,6 @@ public void testWireFormatInfoClientVersion1() throws Exception { assertEquals(1, serverWF.get().getVersion()); } - /** - * @throws Exception - */ public void testWireFormatInfoCurrentVersion() throws Exception { startServer("tcp://localhost:61616"); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsAndLargeMessagesTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsAndLargeMessagesTest.java index c59cdc0dbf4..d4e1fb3bb7d 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsAndLargeMessagesTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsAndLargeMessagesTest.java @@ -16,10 +16,6 @@ */ package org.apache.activemq.transport.udp; -/** - * - * - */ public class UdpSendReceiveWithTwoConnectionsAndLargeMessagesTest extends UdpSendReceiveWithTwoConnectionsTest { @Override diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsTest.java index f120613998e..dc0d01ba26e 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpSendReceiveWithTwoConnectionsTest.java @@ -20,9 +20,6 @@ import org.apache.activemq.broker.BrokerService; import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest; -/** - * @version - */ public class UdpSendReceiveWithTwoConnectionsTest extends JmsTopicSendReceiveWithTwoConnectionsTest { protected String brokerURI = "udp://localhost:8891"; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTestSupport.java index 0c842283714..179ac3e16c0 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTestSupport.java @@ -36,9 +36,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - */ public abstract class UdpTestSupport extends TestCase implements TransportListener { private static final Logger LOG = LoggerFactory.getLogger(UdpTestSupport.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTransportTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTransportTest.java index a08769a3763..236f6c51907 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTransportTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTransportTest.java @@ -25,10 +25,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - * - */ public class UdpTransportTest extends UdpTestSupport { private static final Logger LOG = LoggerFactory.getLogger(UdpTransportTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTransportUsingServerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTransportUsingServerTest.java index e1ea6504060..76e74ab2a76 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTransportUsingServerTest.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/udp/UdpTransportUsingServerTest.java @@ -26,10 +26,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * - * - */ public class UdpTransportUsingServerTest extends UdpTestSupport { private static final Logger LOG = LoggerFactory.getLogger(UdpTransportUsingServerTest.class); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/util/MessageIdList.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/util/MessageIdList.java index 7f3e29fa40c..a96111c14e9 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/util/MessageIdList.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/util/MessageIdList.java @@ -162,8 +162,6 @@ public void waitForMessagesToArrive(int messageCount) { /** * Performs a testing assertion that the correct number of messages have * been received without waiting - * - * @param messageCount */ public void assertMessagesReceivedNoWait(int messageCount) { assertEquals("expected number of messages when received", messageCount, getMessageCount()); @@ -173,8 +171,6 @@ public void assertMessagesReceivedNoWait(int messageCount) { * Performs a testing assertion that the correct number of messages have * been received waiting for the messages to arrive up to a fixed amount of * time. - * - * @param messageCount */ public void assertMessagesReceived(int messageCount) { waitForMessagesToArrive(messageCount); @@ -194,8 +190,6 @@ public void assertAtLeastMessagesReceived(int messageCount) { /** * Asserts that there are at most the number of messages received without * waiting - * - * @param messageCount */ public void assertAtMostMessagesReceived(int messageCount) { int actual = getMessageCount(); @@ -251,8 +245,6 @@ public void setCountDownLatch(CountDownLatch countDownLatch) { /** * Gets the amount of time the message listener will spend sleeping to * simulate a processing delay. - * - * @return */ public long getProcessingDelay() { return processingDelay; @@ -261,8 +253,6 @@ public long getProcessingDelay() { /** * Sets the amount of time the message listener will spend sleeping to * simulate a processing delay. - * - * @param processingDelay */ public void setProcessingDelay(long processingDelay) { this.processingDelay = processingDelay; diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/util/SocketProxy.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/util/SocketProxy.java index ab1ce550884..d2bd6a72162 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/util/SocketProxy.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/util/SocketProxy.java @@ -124,8 +124,8 @@ public URI getUrl() { return proxyUrl; } - /* - * close all proxy connections and acceptor + /** + * Close all proxy connections and acceptor */ public void close() { List connections; @@ -140,9 +140,8 @@ public void close() { closed.countDown(); } - /* - * close all proxy receive connections, leaving acceptor - * open + /** + * Close all proxy receive connections, leaving acceptor open */ public void halfClose() { List connections; @@ -159,8 +158,8 @@ public boolean waitUntilClosed(long timeoutSeconds) throws InterruptedException return closed.await(timeoutSeconds, TimeUnit.SECONDS); } - /* - * called after a close to restart the acceptor on the same port + /** + * Called after a close to restart the acceptor on the same port */ public void reopen() { LOG.info("reopen"); @@ -171,9 +170,8 @@ public void reopen() { } } - /* - * pause accepting new connections and data transfer through existing proxy - * connections. All sockets remain open + /** + * Pause accepting new connections and data transfer through existing proxy connections. All sockets remain open. */ public void pause() { synchronized (connections) { @@ -185,8 +183,8 @@ public void pause() { } } - /* - * continue after pause + /** + * Continue after pause */ public void goOn() { synchronized (connections) { @@ -391,5 +389,4 @@ public void close() { } } } - } diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java index 4eada1ad902..81cb80329f9 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java @@ -228,7 +228,6 @@ public void run(final ClientSessionFactory sf, final int threadNum) throws Excep }, NUM_THREADS, false); } - // Added do replicate HORNETQ-264 @Test public void testO() throws Exception { runTestMultipleThreads(new RunnableT() { @@ -1002,9 +1001,7 @@ protected void doTestK(final ClientSessionFactory sf, final int threadNum) throw s.close(); } - /* - * This test tests failure during create connection - */ + // This test tests failure during create connection protected void doTestL(final ClientSessionFactory sf) throws Exception { final int numSessions = 100; @@ -1100,9 +1097,6 @@ private void runTestMultipleThreads(final RunnableT runnable, runMultipleThreadsFailoverTest(runnable, numThreads, getNumIterations(), failOnCreateConnection, failDelay); } - /** - * @return - */ @Override protected ServerLocator createLocator() throws Exception { ServerLocator locator = createInVMNonHALocator().setReconnectAttempts(15).setConfirmationWindowSize(1024 * 1024); diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java index 214dcf3e145..1644cade2ef 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/largemessage/LargeMessageTestBase.java @@ -486,16 +486,6 @@ public void write(final int b) throws IOException { } } - /** - * @param numberOfMessages - * @param numberOfBytes - * @param delayDelivery - * @param session - * @param producer - * @throws Exception - * @throws IOException - * @throws ActiveMQException - */ private void sendMessages(final int numberOfMessages, final long numberOfBytes, final long delayDelivery, @@ -566,13 +556,6 @@ protected ClientMessage createLargeClientMessageStreaming(final ClientSession se return clientMessage; } - /** - * @param session - * @param queueToRead - * @param numberOfBytes - * @throws ActiveMQException - * @throws IOException - */ protected void readMessage(final ClientSession session, final SimpleString queueToRead, final int numberOfBytes) throws ActiveMQException, IOException { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/ra/DummyTransaction.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/ra/DummyTransaction.java index a5cbb61ed09..c53e47f6224 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/ra/DummyTransaction.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/ra/DummyTransaction.java @@ -25,13 +25,6 @@ import javax.transaction.Transaction; import javax.transaction.xa.XAResource; -/** - * Created with IntelliJ IDEA. - * User: andy - * Date: 13/08/13 - * Time: 15:13 - * To change this template use File | Settings | File Templates. - */ class DummyTransaction implements Transaction { public boolean rollbackOnly = false; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrame.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrame.java index 1b77e127d48..c46da069116 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrame.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrame.java @@ -21,7 +21,7 @@ import io.netty.buffer.ByteBuf; /** - * pls use factory to create frames. + * Use factory to create frames. */ public interface ClientStompFrame { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrameV10.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrameV10.java index 92629ab4b74..f0031b9bc13 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrameV10.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrameV10.java @@ -17,7 +17,7 @@ package org.apache.activemq.artemis.tests.integration.stomp.util; /** - * pls use factory to create frames. + * Use factory to create frames. */ public class ClientStompFrameV10 extends AbstractClientStompFrame { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrameV12.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrameV12.java index eaffd1c815c..abbf29cb920 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrameV12.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/ClientStompFrameV12.java @@ -24,7 +24,7 @@ public ClientStompFrameV12(String command) { public ClientStompFrameV12(String command, boolean newEol, boolean validate) { super(command, validate); - /** + /* * Stomp 1.2 frames allow a carriage return (octet 13) to optionally * precedes the required line feed (octet 10) as their internal line breaks. * Stomp 1.0 and 1.1 only allow line feeds. diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompFrameFactoryV11.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompFrameFactoryV11.java index 21702a5e488..2416b486cba 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompFrameFactoryV11.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/integration/stomp/util/StompFrameFactoryV11.java @@ -18,7 +18,7 @@ /** * 1.1 frames - *
                      + *

                      * 1. CONNECT/STOMP(new) * 2. CONNECTED * 3. SEND diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java index 35b8ac9c38c..bc216d8a0bb 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestBase.java @@ -253,9 +253,6 @@ protected void stopJournal(final boolean reclaim) throws Exception { journal.stop(); } - /** - * @throws Exception - */ protected void exportImportJournal() throws Exception { logger.debug("Exporting to {}/output.log", getTestDir()); @@ -281,11 +278,6 @@ protected void loadAndCheck() throws Exception { loadAndCheck(false); } - /** - * @param fileFactory - * @param journal - * @throws Exception - */ private static void describeJournal(SequentialFileFactory fileFactory, JournalImpl journal, final File path, @@ -658,10 +650,6 @@ protected void checkRecordsEquivalent(final List expected, final Lis } } - /** - * @param expected - * @param actual - */ protected void printJournalLists(final List expected, final List actual) { try { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java index e5710ca7d9f..5e3be3911c2 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java @@ -472,9 +472,6 @@ private int calculateRecordsPerFile(final int fileSize, final int alignment, int return (fileSize - headerSize) / recordSize; } - /** - * Use: calculateNumberOfFiles (fileSize, numberOfRecords, recordSize, numberOfRecords2, recordSize2, , ...., numberOfRecordsN, recordSizeN); - */ private int calculateNumberOfFiles(TestableJournal journal, final int fileSize, final int alignment, @@ -3080,9 +3077,7 @@ public void testReclaimAfterUpdate() throws Exception { update(i); } - /** - * Enable System.outs again if test fails and needs to be debugged - */ + // Enable System.outs again if test fails and needs to be debugged // logger.debug("Before stop ****************************"); // logger.debug(journal.debug()); diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java index f7e95774725..25764efe81a 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java @@ -223,8 +223,6 @@ protected FakeSequentialFile newSequentialFile(final String fileName) { return new FakeSequentialFile(fileName); } - - /** * This listener will return a message to the test with each callback added */ @@ -461,9 +459,6 @@ public void writeDirect(final ByteBuffer bytes, final boolean sync) throws Excep writeDirect(bytes, sync, null); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#writeInternal(java.nio.ByteBuffer) - */ public void writeInternal(ByteBuffer bytes) throws Exception { writeDirect(bytes, true); } @@ -484,10 +479,6 @@ private void checkAndResize(final int size) { } } - /** - * @param bytes - * @param action - */ private void addCallback(final ByteBuffer bytes, final CallbackRunnable action) { synchronized (FakeSequentialFileFactory.this) { callbacksInHold.add(action); @@ -515,9 +506,6 @@ private void checkAlignment(final long position) { } } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#renameTo(org.apache.activemq.artemis.core.io.SequentialFile) - */ @Override public void renameTo(final String newFileName) throws Exception { fileMap.remove(fileName); @@ -525,29 +513,17 @@ public void renameTo(final String newFileName) throws Exception { fileMap.put(newFileName, this); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#fits(int) - */ @Override public boolean fits(final int size) { return data.position() + size <= data.limit(); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#setBuffering(boolean) - */ public void setBuffering(final boolean buffering) { } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#lockBuffer() - */ public void disableAutoFlush() { } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#unlockBuffer() - */ public void enableAutoFlush() { } @@ -556,9 +532,6 @@ public SequentialFile cloneFile() { return null; // To change body of implemented methods use File | Settings | File Templates. } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#write(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer, boolean, org.apache.activemq.artemis.core.journal.IOCallback) - */ @Override public void write(final ActiveMQBuffer bytes, final boolean sync, final IOCallback callback) throws Exception { bytes.writerIndex(bytes.capacity()); @@ -567,9 +540,6 @@ public void write(final ActiveMQBuffer bytes, final boolean sync, final IOCallba } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#write(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer, boolean) - */ @Override public void write(final ActiveMQBuffer bytes, final boolean sync) throws Exception { bytes.writerIndex(bytes.capacity()); @@ -577,9 +547,6 @@ public void write(final ActiveMQBuffer bytes, final boolean sync) throws Excepti writeDirect(bytes.toByteBuffer(), sync); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#write(org.apache.activemq.artemis.core.journal.EncodingSupport, boolean, org.apache.activemq.artemis.core.journal.IOCompletion) - */ @Override public void write(final EncodingSupport bytes, final boolean sync, final IOCallback callback) throws Exception { ByteBuffer buffer = newBuffer(bytes.getEncodeSize()); @@ -588,9 +555,6 @@ public void write(final EncodingSupport bytes, final boolean sync, final IOCallb write(outbuffer, sync, callback); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#write(org.apache.activemq.artemis.core.journal.EncodingSupport, boolean) - */ @Override public void write(final EncodingSupport bytes, final boolean sync) throws Exception { ByteBuffer buffer = newBuffer(bytes.getEncodeSize()); @@ -599,9 +563,6 @@ public void write(final EncodingSupport bytes, final boolean sync) throws Except write(outbuffer, sync); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#exists() - */ @Override public boolean exists() { FakeSequentialFile file = fileMap.get(fileName); @@ -609,27 +570,18 @@ public boolean exists() { return file != null && file.data != null && file.data.capacity() > 0; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#setTimedBuffer(org.apache.activemq.artemis.core.io.buffer.TimedBuffer) - */ @Override public void setTimedBuffer(final TimedBuffer buffer) { } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.io.SequentialFile#copyTo(org.apache.activemq.artemis.core.io.SequentialFile) - */ @Override public void copyTo(SequentialFile newFileName) { - // TODO Auto-generated method stub - } @Override public File getJavaFile() { throw new UnsupportedOperationException(); } - } @Override @@ -676,7 +628,6 @@ public void releaseDirectBuffer(ByteBuffer buffer) { @Override public File getDirectory() { - // TODO Auto-generated method stub return null; } diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/fakes/FakeQueue.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/fakes/FakeQueue.java index 470705d16bc..437c94e6847 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/fakes/FakeQueue.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/fakes/FakeQueue.java @@ -964,16 +964,10 @@ public void deleteQueue() throws Exception { // no-op } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.server.Queue#destroyPaging() - */ @Override public void destroyPaging() { } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.server.Queue#getDeliveringMessages() - */ @Override public Map> getDeliveringMessages() { return null; @@ -981,7 +975,6 @@ public Map> getDeliveringMessages() { @Override public LinkedListIterator browserIterator() { - // TODO Auto-generated method stub return null; } diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java index 5d319708ef3..b9fca4bf92c 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java @@ -192,8 +192,7 @@ public abstract class ActiveMQTestBase extends ArtemisTestCase { public static final String CLUSTER_PASSWORD = "UnitTestsClusterPassword"; /** - * Add a "sendCallNumber" property to messages sent using helper classes. Meant to help in - * debugging. + * Add a "sendCallNumber" property to messages sent using helper classes. Meant to help in debugging. */ private static final String SEND_CALL_NUMBER = "sendCallNumber"; private static final String OS_TYPE = System.getProperty("os.name").toLowerCase(); @@ -489,8 +488,10 @@ protected DatabaseStorageConfiguration createDefaultDatabaseStorageConfiguration DatabaseStorageConfiguration dbStorageConfiguration = new DatabaseStorageConfiguration(); String connectionURI = getTestJDBCConnectionUrl(); - /** The connectionURI could be passed into the testsuite as a system property (say you are testing against Oracle). - * So, we only schedule the drop on Derby if we are using a derby memory database */ + /* + * The connectionURI could be passed into the testsuite as a system property (say you are testing against Oracle). + * So, we only schedule the drop on Derby if we are using a derby memory database + */ if (connectionURI.contains("derby") && connectionURI.contains("memory") && !derbyDropped) { // some tests will reinitialize the server and call this method more than one time // and we should only schedule one task @@ -535,7 +536,9 @@ protected Map generateInVMParams(final int node) { } - /** This exists as an extension point for tests, so tests can replace it */ + /** + * This exists as an extension point for tests, so tests can replace it + */ protected ClusterConnectionConfiguration createBasicClusterConfig(String connectorName, String... connectors) { return basicClusterConnectionConfig(connectorName, connectors); @@ -599,8 +602,6 @@ public static JournalType getDefaultJournalType() { /** * Verifies whether weak references are released after a few GCs. - * - * @param references */ public static void checkWeakReferences(final WeakReference... references) { int i = 0; @@ -749,10 +750,6 @@ protected static Object checkBinding(final Context context, final String binding return o; } - /** - * @param connectorConfigs - * @return - */ protected List registerConnectors(final ActiveMQServer server, final List connectorConfigs) { // The connectors need to be pre-configured at main config object but this method is taking @@ -769,9 +766,6 @@ protected List registerConnectors(final ActiveMQServer server, return connectors; } - /** - * @return the testDir - */ protected final String getTestDir() { return temporaryFolder.getAbsolutePath(); } @@ -832,9 +826,6 @@ protected void recreateDataDirectories(String testDir1, int index, boolean backu recreateDirectory(getTemporaryDir(testDir1)); } - /** - * @return the journalDir - */ public String getJournalDir() { return getJournalDir(0, false); } @@ -851,23 +842,14 @@ public static String getJournalDir(final String testDir, final int index, final return getJournalDir(testDir) + directoryNameSuffix(index, backup); } - /** - * @return the bindingsDir - */ protected String getBindingsDir() { return getBindingsDir(0, false); } - /** - * @return the bindingsDir - */ protected static String getBindingsDir(final String testDir1) { return testDir1 + "/bindings"; } - /** - * @return the bindingsDir - */ protected String getBindingsDir(final int index, final boolean backup) { return getBindingsDir(getTestDir(), index, backup); } @@ -876,9 +858,6 @@ public static String getBindingsDir(final String testDir, final int index, final return getBindingsDir(testDir) + directoryNameSuffix(index, backup); } - /** - * @return the pageDir - */ protected String getPageDir() { return getPageDir(0, false); } @@ -888,9 +867,6 @@ protected File getPageDirFile() { } - /** - * @return the pageDir - */ protected static String getPageDir(final String testDir1) { return testDir1 + "/page"; } @@ -903,16 +879,10 @@ public static String getPageDir(final String testDir, final int index, final boo return getPageDir(testDir) + directoryNameSuffix(index, backup); } - /** - * @return the largeMessagesDir - */ protected String getLargeMessagesDir() { return getLargeMessagesDir(0, false); } - /** - * @return the largeMessagesDir - */ protected static String getLargeMessagesDir(final String testDir1) { return testDir1 + "/large-msg"; } @@ -931,30 +901,18 @@ private static String directoryNameSuffix(int index, boolean backup) { return index + "-" + (backup ? "B" : "L"); } - /** - * @return the clientLargeMessagesDir - */ protected String getClientLargeMessagesDir() { return getClientLargeMessagesDir(getTestDir()); } - /** - * @return the clientLargeMessagesDir - */ protected String getClientLargeMessagesDir(final String testDir1) { return testDir1 + "/client-large-msg"; } - /** - * @return the temporaryDir - */ protected final String getTemporaryDir() { return getTemporaryDir(getTestDir()); } - /** - * @return the temporaryDir - */ protected String getTemporaryDir(final String testDir1) { return testDir1 + "/temp"; } @@ -1018,8 +976,9 @@ public int read() throws IOException { } /** - * It validates a Bean (POJO) using simple setters and getters with random values. - * You can pass a list of properties to be ignored, as some properties will have a pre-defined domain (not being possible to use random-values on them) + * It validates a Bean (POJO) using simple setters and getters with random values. You can pass a list of properties + * to be ignored, as some properties will have a pre-defined domain (not being possible to use random-values on + * them) */ protected void validateGettersAndSetters(final Object pojo, final String... ignoredProperties) throws Exception { Set ignoreSet = new HashSet<>(); @@ -1063,10 +1022,6 @@ protected void validateGettersAndSetters(final Object pojo, final String... igno } } - /** - * @param queue - * @throws InterruptedException - */ protected void waitForNotPaging(Queue queue) throws InterruptedException { waitForNotPaging(queue.getPagingStore()); } @@ -1302,19 +1257,10 @@ protected void waitForServerToStop(ActiveMQServer server) throws InterruptedExce } } - /** - * @param backup - */ public static final void waitForRemoteBackupSynchronization(final ActiveMQServer backup) { waitForRemoteBackup(null, 20, true, backup); } - /** - * @param sessionFactoryP - * @param seconds - * @param waitForSync - * @param backup - */ public static final void waitForRemoteBackup(ClientSessionFactory sessionFactoryP, int seconds, boolean waitForSync, @@ -1655,10 +1601,6 @@ protected final ServerLocator createInVMLocator(final int serverID) { return addServerLocator(locator); } - /** - * @param serverID - * @return - */ protected final TransportConfiguration createInVMTransportConnectorConfig(final int serverID, String name1) { Map server1Params = new HashMap<>(); @@ -1694,11 +1636,6 @@ protected void assertMessageBody(final int i, final ClientMessage message) { /** * Send durable messages with pre-specified body. - * - * @param session - * @param producer - * @param numMessages - * @throws ActiveMQException */ public final void sendMessages(ClientSession session, ClientProducer producer, @@ -1783,8 +1720,7 @@ protected final void receiveMessages(ClientConsumer consumer, } /** - * Reads a journal system and returns a Pair of List of RecordInfo, - * independent of being deleted or not + * Reads a journal system and returns a Pair of List of RecordInfo, independent of being deleted or not */ protected Pair, List> loadMessageJournal(Configuration config) throws Exception { JournalImpl messagesJournal = null; @@ -1812,12 +1748,8 @@ protected Pair, List> loadMessageJourn } /** - * Reads a journal system and returns a {@literal Map} of recordTypes and the number of records per type, - * independent of being deleted or not - * - * @param config - * @return - * @throws Exception + * Reads a journal system and returns a {@literal Map} of recordTypes and the number of + * records per type, independent of being deleted or not */ protected HashMap countJournal(Configuration config) throws Exception { File location = config.getJournalLocation(); @@ -1852,10 +1784,6 @@ protected HashMap countBindingJournal(Configuration conf /** * This method will load a journal and count the living records - * - * @param config - * @return - * @throws Exception */ protected HashMap countJournalLivingRecords(Configuration config) throws Exception { return internalCountJournalLivingRecords(config, true); @@ -1864,10 +1792,7 @@ protected HashMap countJournalLivingRecords(Configuratio /** * This method will load a journal and count the living records * - * @param config - * @param messageJournal if true counts MessageJournal, if false counts BindingsJournal - * @return - * @throws Exception + * @param messageJournal if {@code true} counts MessageJournal, if false counts BindingsJournal */ protected HashMap internalCountJournalLivingRecords(Configuration config, boolean messageJournal) throws Exception { @@ -1909,9 +1834,6 @@ private static final class RecordTypeCounter implements JournalReaderCallback { private final Map recordsType; - /** - * @param recordsType - */ private RecordTypeCounter(Map recordsType) { this.recordsType = recordsType; } @@ -1972,15 +1894,15 @@ public void markAsDataFile(JournalFile file0) { } /** + * Block calling thread and wait for a specified number of bindings. + * * @param server the server where's being checked * @param address the name of the address being checked - * @param local if true we are looking for local bindings, false we are looking for remoting servers + * @param local if {@code true} we are looking for local bindings, false we are looking for remoting + * servers * @param expectedBindingCount the expected number of counts * @param expectedConsumerCount the expected number of consumers * @param timeout the timeout used on the check - * @return - * @throws Exception - * @throws InterruptedException */ protected boolean waitForBindings(final ActiveMQServer server, final String address, @@ -2028,9 +1950,10 @@ protected boolean waitForBindings(final ActiveMQServer server, protected int getNumberOfFiles(File directory) { return directory.listFiles().length; } + /** - * Deleting a file on LargeDir is an asynchronous process. We need to keep looking for a while if - * the file hasn't been deleted yet. + * Deleting a file on LargeDir is an asynchronous process. We need to keep looking for a while if the file hasn't + * been deleted yet. */ protected void validateNoFilesOnLargeDir(final String directory, final int expect) throws Exception { File largeMessagesFileDir = new File(directory); @@ -2038,8 +1961,8 @@ protected void validateNoFilesOnLargeDir(final String directory, final int expec } /** - * Deleting a file on LargeDire is an asynchronous process. Wee need to keep looking for a while - * if the file hasn't been deleted yet + * Deleting a file on LargeDire is an asynchronous process. Wee need to keep looking for a while if the file hasn't + * been deleted yet */ protected void validateNoFilesOnLargeDir() throws Exception { validateNoFilesOnLargeDir(getLargeMessagesDir(), 0); @@ -2092,9 +2015,6 @@ private void assertAllClientProducersAreClosed() { } } - /** - * - */ private void closeAllOtherComponents() { synchronized (otherComponents) { for (ActiveMQComponent c : otherComponents) { @@ -2231,12 +2151,6 @@ protected int getMessageCount(final ActiveMQServer service, final String address return getMessageCount(service.getPostOffice(), address); } - /** - * @param address - * @param postOffice - * @return - * @throws Exception - */ protected int getMessageCount(final PostOffice postOffice, final String address) throws Exception { int messageCount = 0; @@ -2259,12 +2173,6 @@ protected int getMessageCount(final Queue queue) { return (int) queue.getMessageCount(); } - /** - * @param postOffice - * @param address - * @return - * @throws Exception - */ protected int getMessagesAdded(final PostOffice postOffice, final String address) throws Exception { int messageCount = 0; @@ -2311,10 +2219,9 @@ protected final ServerLocator createNonHALocator(final boolean isNetty) { } /** - * Creates the Locator without adding it to the list where the tearDown will take place - * This is because we don't want it closed in certain tests where we are issuing failures + * Creates the Locator without adding it to the list where the tearDown will take place This is because we don't want + * it closed in certain tests where we are issuing failures * - * @param isNetty * @return the locator */ public ServerLocator internalCreateNonHALocator(boolean isNetty) { @@ -2593,11 +2500,8 @@ protected interface ActiveMQAction { /** * Asserts that latch completes within a (rather large interval). *

                      - * Use this instead of just calling {@code latch.await()}. Otherwise your test may hang the whole - * test run if it fails to count-down the latch. - * - * @param latch - * @throws InterruptedException + * Use this instead of just calling {@code latch.await()}. Otherwise your test may hang the whole test run if it + * fails to count-down the latch. */ public static void waitForLatch(CountDownLatch latch) throws InterruptedException { assertTrue(latch.await(1, TimeUnit.MINUTES), "Latch has got to return within a minute"); diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/JMSTestBase.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/JMSTestBase.java index cf067c31067..3d8ca65d946 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/JMSTestBase.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/JMSTestBase.java @@ -92,9 +92,6 @@ protected final JMSContext createContext(int sessionMode) { return addContext(cf.createContext(null, null, sessionMode)); } - /** - * @throws Exception - */ protected Queue createQueue(final String queueName) throws Exception { return createQueue(false, queueName); } @@ -108,9 +105,6 @@ protected long getMessageCount(QueueControl control) throws Exception { return control.getMessageCount(); } - /** - * @throws Exception - */ protected Queue createQueue(final boolean storeConfig, final String queueName) throws Exception { jmsServer.createQueue(storeConfig, queueName, null, true, "/jms/" + queueName); @@ -226,12 +220,12 @@ protected void createCF(final List connectorConfigs, createCF(name, connectorConfigs, jndiBindings); } - /** - * @param cfName the unique ConnectionFactory's name + * Create a {@link ConnectionFactory}. + * + * @param cfName the unique ConnectionFactory's name * @param connectorConfigs initial static connectors' config - * @param jndiBindings JNDI binding names for the CF - * @throws Exception + * @param jndiBindings JNDI binding names for the CF */ protected void createCF(final String cfName, final List connectorConfigs, @@ -245,8 +239,6 @@ protected void createCF(final String cfName, /** * Allows test-cases to set their own options to the {@link ConnectionFactoryConfiguration} - * - * @param configuration */ protected void testCaseCfExtraConfig(ConnectionFactoryConfiguration configuration) { // no-op diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/SingleServerTestBase.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/SingleServerTestBase.java index 10fa7bc981d..ec79706b2b6 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/SingleServerTestBase.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/SingleServerTestBase.java @@ -23,8 +23,8 @@ import org.junit.jupiter.api.BeforeEach; /** - * Any test based on a single server can extend this class. - * This is useful for quick writing tests with starting a server, locator, factory... etc + * Any test based on a single server can extend this class. This is useful for quick writing tests with starting a + * server, locator, factory... etc */ public abstract class SingleServerTestBase extends ActiveMQTestBase { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/TcpProxy.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/TcpProxy.java index e6a31874519..65c7b9ae2d2 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/TcpProxy.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/TcpProxy.java @@ -44,9 +44,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** This Proxy is based in one of the Netty Examples: +/** + * This Proxy is based in one of the Netty Examples: * https://github.com/netty/netty/tree/ccc5e01f0444301561f055b02cd7c1f3e875bca7/example/src/main/java/io/netty/example/proxy - * */ + */ public final class TcpProxy implements Runnable { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -88,7 +89,9 @@ public TcpProxy(String remoteHost, int remotePort, int localPort, boolean loggin this.logging = logging; } - /** Try a Core Protocol connection until successful */ + /** + * Try a Core Protocol connection until successful + */ public void tryCore(String user, String password) { ConnectionFactory cf = CFUtil.createConnectionFactory("CORE", "tcp://" + remoteHost + ":" + localPort); // try to connect a few time, to make sure the proxy is up diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/TestParameters.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/TestParameters.java index 1563d278b01..2e20f597868 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/TestParameters.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/TestParameters.java @@ -24,7 +24,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** Encapsulates System properties that could be passed on to the test. */ +/** + * Encapsulates System properties that could be passed on to the test. + */ public class TestParameters { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/network/NetUtil.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/network/NetUtil.java index 8c82c2955e1..de2592e670d 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/network/NetUtil.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/network/NetUtil.java @@ -36,19 +36,21 @@ import org.junit.jupiter.api.Test; /** - * This utility class will use sudo commands to start "fake" network cards on a given address. - * It's used on tests that need to emmulate network outages and split brains. - * - * If you write a new test using this class, please make special care on undoing the config, - * especially in case of failures, by calling the {@link #cleanup()} method. - * + * This utility class will use sudo commands to start "fake" network cards on a given address. It's used on tests that + * need to emmulate network outages and split brains. + *

                      + * If you write a new test using this class, please make special care on undoing the config, especially in case of + * failures, by calling the {@link #cleanup()} method. + *

                      * You need special sudo authorizations on your system to let this class work: - * + *

                      * Add the following at the end of your /etc/sudoers (use the sudo visudo command)"); + *

                        * # ------------------------------------------------------- ");
                        * yourUserName ALL = NOPASSWD: /sbin/ifconfig");
                        * # ------------------------------------------------------- ");
                      - * */
                      + * 
                      + */ public class NetUtil extends ExecuteUtil { public static boolean checkIP(String ip) throws Exception { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/AmqpSupport.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/AmqpSupport.java index eeb5c060d48..91e08d9a853 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/AmqpSupport.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/AmqpSupport.java @@ -64,7 +64,7 @@ public class AmqpSupport { * * @param symbols the set of Symbols to search. * @param key the value to try and find in the Symbol array. - * @return true if the key is found in the given Symbol array. + * @return {@code true} if the key is found in the given Symbol array */ public static boolean contains(Symbol[] symbols, Symbol key) { if (symbols == null || symbols.length == 0) { @@ -86,7 +86,7 @@ public static boolean contains(Symbol[] symbols, Symbol key) { * * @param filters The filters map that should be searched. * @param filterIds The aliases for the target filter to be located. - * @return the filter if found in the mapping or null if not found. + * @return the filter if found in the mapping or null if not found */ public static Map.Entry findFilter(Map filters, Object[] filterIds) { 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 71bf1e2ce0c..9e076d98a71 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 @@ -28,9 +28,9 @@ /** * Abstract base for all AmqpResource implementations to extend. - * - * This abstract class wraps up the basic state management bits so that the concrete object - * don't have to reproduce it. Provides hooks for the subclasses to initialize and shutdown. + *

                      + * This abstract class wraps up the basic state management bits so that the concrete object don't have to reproduce it. + * Provides hooks for the subclasses to initialize and shutdown. */ public abstract class AmqpAbstractResource implements AmqpResource { @@ -250,17 +250,16 @@ public void processFlowUpdates(AmqpConnection connection) throws IOException { } /** - * Perform the open operation on the managed endpoint. A subclass may override this method to - * provide additional open actions or configuration updates. + * Perform the open operation on the managed endpoint. A subclass may override this method to provide additional open + * actions or configuration updates. */ protected void doOpen() { getEndpoint().open(); } /** - * Perform the close operation on the managed endpoint. A subclass may override this method - * to provide additional close actions or alter the standard close path such as endpoint - * detach etc. + * Perform the close operation on the managed endpoint. A subclass may override this method to provide additional + * close actions or alter the standard close path such as endpoint detach etc. */ protected void doClose() { getEndpoint().close(); @@ -268,17 +267,17 @@ protected void doClose() { /** * Perform the detach operation on the managed endpoint. - * - * By default this method throws an UnsupportedOperationException, a subclass must implement - * this and do a detach if its resource supports that. + *

                      + * By default this method throws an UnsupportedOperationException, a subclass must implement this and do a detach if + * its resource supports that. */ protected void doDetach() { throw new UnsupportedOperationException("Endpoint cannot be detached."); } /** - * Complete the open operation on the managed endpoint. A subclass may override this method - * to provide additional verification actions or configuration updates. + * Complete the open operation on the managed endpoint. A subclass may override this method to provide additional + * verification actions or configuration updates. */ protected void doOpenCompletion() { logger.debug("{} is now open: ", this); @@ -286,9 +285,8 @@ protected void doOpenCompletion() { } /** - * When aborting the open operation, and there isn't an error condition, provided by the - * peer, the returned exception will be used instead. A subclass may override this method to - * provide alternative behaviour. + * When aborting the open operation, and there isn't an error condition, provided by the peer, the returned exception + * will be used instead. A subclass may override this method to provide alternative behaviour. */ protected Exception getOpenAbortException() { return new IOException("Open failed unexpectedly."); 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 fa925277615..ec1ca0e7fcc 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 @@ -29,8 +29,7 @@ import java.lang.invoke.MethodHandles; /** - * Connection instance used to connect to the Broker using Proton as - * the AMQP protocol handler. + * Connection instance used to connect to the Broker using Proton as the AMQP protocol handler. */ public class AmqpClient { @@ -60,11 +59,11 @@ public AmqpClient(URI remoteURI, String username, String password) { } /** - * Creates a connection with the broker at the given location, this method initiates a - * connect attempt immediately and will fail if the remote peer cannot be reached. + * Creates a connection with the broker at the given location, this method initiates a connect attempt immediately + * and will fail if the remote peer cannot be reached. * + * @return a new connection object used to interact with the connected peer * @throws Exception if an error occurs attempting to connect to the Broker. - * @return a new connection object used to interact with the connected peer. */ public AmqpConnection connect() throws Exception { @@ -77,11 +76,11 @@ public AmqpConnection connect() throws Exception { } /** - * Creates a connection with the broker at the given location, this method initiates a - * connect attempt immediately and will fail if the remote peer cannot be reached. + * Creates a connection with the broker at the given location, this method initiates a connect attempt immediately + * and will fail if the remote peer cannot be reached. * + * @return a new connection object used to interact with the connected peer * @throws Exception if an error occurs attempting to connect to the Broker. - * @return a new connection object used to interact with the connected peer. */ public AmqpConnection connect(boolean noContainerId) throws Exception { @@ -94,13 +93,12 @@ public AmqpConnection connect(boolean noContainerId) throws Exception { return connection; } - /** - * Creates a connection with the broker at the given location, this method initiates a - * connect attempt immediately and will fail if the remote peer cannot be reached. + * Creates a connection with the broker at the given location, this method initiates a connect attempt immediately + * and will fail if the remote peer cannot be reached. * + * @return a new connection object used to interact with the connected peer * @throws Exception if an error occurs attempting to connect to the Broker. - * @return a new connection object used to interact with the connected peer. */ public AmqpConnection connect(String containerId) throws Exception { @@ -113,15 +111,13 @@ public AmqpConnection connect(String containerId) throws Exception { return connection; } - /** - * Creates a connection object using the configured values for user, password, remote URI - * etc. This method does not immediately initiate a connection to the remote leaving that - * to the caller which provides a connection object that can have additional configuration - * changes applied before the connect method is invoked. + * Creates a connection object using the configured values for user, password, remote URI etc. This method does not + * immediately initiate a connection to the remote leaving that to the caller which provides a connection object that + * can have additional configuration changes applied before the {@code connect} method is invoked. * + * @return a new connection object used to interact with the connected peer * @throws Exception if an error occurs attempting to connect to the Broker. - * @return a new connection object used to interact with the connected peer. */ public AmqpConnection createConnection() throws Exception { if (username == null && password != null) { @@ -142,14 +138,14 @@ public AmqpConnection createConnection() throws Exception { } /** - * @return the user name value given when constructed. + * {@return the user name value given when constructed} */ public String getUsername() { return username; } /** - * @return the password value given when constructed. + * {@return the password value given when constructed} */ public String getPassword() { return password; @@ -178,15 +174,14 @@ public String getMechanismRestriction() { } /** - * @return the currently set address to use to connect to the AMQP peer. + * {@return the currently set address to use to connect to the AMQP peer} */ public URI getRemoteURI() { return remoteURI; } /** - * Sets the offered capabilities that should be used when a new connection attempt - * is made. + * Sets the offered capabilities that should be used when a new connection attempt is made. * * @param offeredCapabilities the list of capabilities to offer when connecting. */ @@ -199,15 +194,14 @@ public void setOfferedCapabilities(List offeredCapabilities) { } /** - * @return an unmodifiable view of the currently set offered capabilities + * {@return an unmodifiable view of the currently set offered capabilities} */ public List getOfferedCapabilities() { return Collections.unmodifiableList(offeredCapabilities); } /** - * Sets the offered connection properties that should be used when a new connection - * attempt is made. + * Sets the offered connection properties that should be used when a new connection attempt is made. * * @param offeredProperties the map of properties to offer when connecting. */ @@ -220,22 +214,22 @@ public void setOfferedProperties(Map offeredProperties) { } /** - * @return an unmodifiable view of the currently set connection properties. + * {@return an unmodifiable view of the currently set connection properties} */ public Map getOfferedProperties() { return Collections.unmodifiableMap(offeredProperties); } /** - * @return the currently set state inspector used to check state after various events. + * {@return the currently set state inspector used to check state after various events} */ public AmqpValidator getStateInspector() { return stateInspector; } /** - * Sets the state inspector used to check that the AMQP resource is valid after - * specific lifecycle events such as open and close. + * Sets the state inspector used to check that the AMQP resource is valid after specific lifecycle events such as + * open and close. * * @param stateInspector the new state inspector to use. */ @@ -256,8 +250,8 @@ public String toString() { * Creates an anonymous connection with the broker at the given location. * * @param broker the address of the remote broker instance. + * @return a new connection object used to interact with the connected peer * @throws Exception if an error occurs attempting to connect to the Broker. - * @return a new connection object used to interact with the connected peer. */ public static AmqpConnection connect(URI broker) throws Exception { return connect(broker, null, null); @@ -269,8 +263,8 @@ public static AmqpConnection connect(URI broker) throws Exception { * @param broker the address of the remote broker instance. * @param username the user name to use to connect to the broker or null for anonymous. * @param password the password to use to connect to the broker, must be null if user name is null. + * @return a new connection object used to interact with the connected peer * @throws Exception if an error occurs attempting to connect to the Broker. - * @return a new connection object used to interact with the connected peer. */ public static AmqpConnection connect(URI broker, String username, String password) throws Exception { if (username == null && password != null) { 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 cd36899ad36..d703fb79e4c 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 @@ -251,10 +251,9 @@ public void close() { } /** - * Creates a new Session instance used to create AMQP resources like - * senders and receivers. + * Creates a new Session instance used to create AMQP resources like senders and receivers. * - * @return a new AmqpSession that can be used to create links. + * @return a new AmqpSession that can be used to create links * @throws Exception if an error occurs during creation. */ public AmqpSession createSession() throws Exception { @@ -281,14 +280,14 @@ public AmqpSession createSession() throws Exception { //----- Configuration accessors ------------------------------------------// /** - * @return the user name that was used to authenticate this connection. + * {@return the user name that was used to authenticate this connection} */ public String getUsername() { return username; } /** - * @return the password that was used to authenticate this connection. + * {@return the password that was used to authenticate this connection} */ public String getPassword() { return password; @@ -303,22 +302,22 @@ public String getAuthzid() { } /** - * @return the URI of the remote peer this connection attached to. + * {@return the URI of the remote peer this connection attached to} */ public URI getRemoteURI() { return remoteURI; } /** - * @return the container ID that will be set as the container Id. + * {@return the container ID that will be set as the container Id} */ public String getContainerId() { return this.containerId; } /** - * Sets the container Id that will be configured on the connection prior to - * connecting to the remote peer. Calling this after connect has no effect. + * Sets the container Id that will be configured on the connection prior to connecting to the remote peer. Calling + * this after connect has no effect. * * @param containerId the container Id to use on the connection. */ @@ -327,7 +326,7 @@ public void setContainerId(String containerId) { } /** - * @return the currently set Max Frame Size value. + * {@return the currently set Max Frame Size value} */ public int getMaxFrameSize() { return maxFrameSize; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpEventSink.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpEventSink.java index 55813285b70..29917771afa 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpEventSink.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpEventSink.java @@ -21,8 +21,7 @@ import org.apache.qpid.proton.engine.Delivery; /** - * Interface used by classes that want to process AMQP events sent from - * the transport layer. + * Interface used by classes that want to process AMQP events sent from the transport layer. */ public interface AmqpEventSink { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpFrameValidator.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpFrameValidator.java index 7f6471812cf..c496621f05e 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpFrameValidator.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpFrameValidator.java @@ -30,8 +30,7 @@ import org.apache.qpid.proton.amqp.transport.Transfer; /** - * Abstract base for a validation hook that is used in tests to check - * the values of incoming or outgoing AMQP frames. + * Abstract base for a validation hook that is used in tests to check the values of incoming or outgoing AMQP frames. */ public class AmqpFrameValidator { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpMessage.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpMessage.java index 77242709784..0c190ac5eb5 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpMessage.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpMessage.java @@ -47,8 +47,7 @@ public class AmqpMessage { private Map applicationPropertiesMap; /** - * Creates a new AmqpMessage that wraps the information necessary to handle - * an outgoing message. + * Creates a new AmqpMessage that wraps the information necessary to handle an outgoing message. */ public AmqpMessage() { receiver = null; @@ -58,8 +57,7 @@ public AmqpMessage() { } /** - * Creates a new AmqpMessage that wraps the information necessary to handle - * an outgoing message. + * Creates a new AmqpMessage that wraps the information necessary to handle an outgoing message. * * @param message the Proton message that is to be sent. */ @@ -68,8 +66,7 @@ public AmqpMessage(Message message) { } /** - * Creates a new AmqpMessage that wraps the information necessary to handle - * an incoming delivery. + * Creates a new AmqpMessage that wraps the information necessary to handle an incoming delivery. * * @param receiver the AmqpReceiver that received this message. * @param message the Proton message that was received. @@ -97,7 +94,7 @@ public AmqpMessage(AmqpReceiver receiver, Message message, Delivery delivery) { //----- Access to interal client resources -------------------------------// /** - * @return the AMQP Delivery object linked to a received message. + * {@return the AMQP Delivery object linked to a received message} */ public Delivery getWrappedDelivery() { if (delivery != null) { @@ -108,14 +105,14 @@ public Delivery getWrappedDelivery() { } /** - * @return the AMQP Message that is wrapped by this object. + * {@return the AMQP Message that is wrapped by this object} */ public Message getWrappedMessage() { return message; } /** - * @return the AmqpReceiver that consumed this message. + * {@return the AmqpReceiver that consumed this message} */ public AmqpReceiver getAmqpReceiver() { return receiver; @@ -135,9 +132,7 @@ public void accept() throws Exception { /** * Accepts the message marking it as consumed on the remote peer. * - * @param settle - * true if the client should also settle the delivery when sending the accept. - * + * @param settle {@code true} if the client should also settle the delivery when sending the accept. * @throws Exception if an error occurs during the accept. */ public void accept(boolean settle) throws Exception { @@ -161,9 +156,7 @@ public void accept(AmqpSession txnSession) throws Exception { /** * Accepts the message marking it as consumed on the remote peer. * - * @param txnSession - * The session that is used to manage acceptance of the message. - * + * @param txnSession The session that is used to manage acceptance of the message. * @throws Exception if an error occurs during the accept. */ public void accept(AmqpSession txnSession, boolean settle) throws Exception { @@ -229,9 +222,7 @@ public void setAddress(String address) { } /** - * Return the set address that was set in the Message To field. - * - * @return the set address String form or null if not set. + * {@return the address that was set in the Message To field or {@code null} if not set} */ public String getAddress() { if (message.getProperties() == null) { @@ -253,9 +244,7 @@ public void setReplyToAddress(String address) { } /** - * Return the set replyTo address that was set in the Message To field. - * - * @return the set replyTo address String form or null if not set. + * {@return the replyTo address that was set in the Message To field or {@code null} if not set} */ public String getReplyToAddress() { if (message.getProperties() == null) { @@ -277,10 +266,7 @@ public void setMessageId(String messageId) { } /** - * Return the set MessageId value in String form, if there are no properties - * in the given message return null. - * - * @return the set message ID in String form or null if not set. + * {@return the the set MessageId value in String form or {@code null} if not set} */ public String getMessageId() { if (message.getProperties() == null || message.getProperties().getMessageId() == null) { @@ -291,10 +277,7 @@ public String getMessageId() { } /** - * Return the set MessageId value in the original form, if there are no properties - * in the given message return null. - * - * @return the set message ID in its original form or null if not set. + * {@return the set MessageId value in the original form or {@code null} if not set} */ public Object getRawMessageId() { if (message.getProperties() == null) { @@ -327,10 +310,7 @@ public void setCorrelationId(String correlationId) { } /** - * Return the set CorrelationId value in String form, if there are no properties - * in the given message return null. - * - * @return the set correlation ID in String form or null if not set. + * {@return the set correlation ID in String form or {@code null} if not set} */ public String getCorrelationId() { if (message.getProperties() == null || message.getProperties().getCorrelationId() == null) { @@ -341,10 +321,7 @@ public String getCorrelationId() { } /** - * Return the set CorrelationId value in the original form, if there are no properties - * in the given message return null. - * - * @return the set message ID in its original form or null if not set. + * {@return the set CorrelationId value in the original form or {@code null} if not set} */ public Object getRawCorrelationId() { if (message.getProperties() == null) { @@ -377,10 +354,7 @@ public void setGroupId(String groupId) { } /** - * Return the set GroupId value in String form, if there are no properties - * in the given message return null. - * - * @return the set GroupID in String form or null if not set. + * {@return the set GroupID in String form or {@code null} if not set} */ public String getGroupId() { if (message.getProperties() == null) { @@ -402,10 +376,7 @@ public void setSubject(String subject) { } /** - * Return the set Subject value in String form, if there are no properties - * in the given message return null. - * - * @return the set Subject in String form or null if not set. + * {@return the set Subject in String form or {@code null} if not set} */ public String getSubject() { if (message.getProperties() == null) { @@ -427,10 +398,7 @@ public void setDurable(boolean durable) { } /** - * Checks the durable value in the Message Headers to determine if - * the message was sent as a durable Message. - * - * @return true if the message is marked as being durable. + * {@return {@code true} if the message is marked as being durable; otherwise {@code false}} */ public boolean isDurable() { if (message.getHeader() == null || message.getHeader().getDurable() == null) { @@ -461,7 +429,7 @@ public void setPriority(short priority) { } /** - * Gets the priority header on the message. + * {@return the priority header on the message} */ public short getPriority() { return getWrappedMessage().getPriority(); @@ -479,7 +447,7 @@ public void setTimeToLive(long timeToLive) { } /** - * Sets the ttl header on the outgoing message. + * {@return the ttl header on the outgoing message} */ public long getTimeToLive() { return getWrappedMessage().getTtl(); @@ -534,11 +502,11 @@ public void setApplicationProperty(String key, Object value) { } /** - * Gets the application property that is mapped to the given name or null - * if no property has been set with that name. + * Gets the application property that is mapped to the given name or null if no property has been set with that + * name. * * @param key the name used to lookup the property in the application properties. - * @return the property value or null if not set. + * @return the property value or null if not set */ public Object getApplicationProperty(String key) { if (applicationPropertiesMap == null) { @@ -549,8 +517,8 @@ public Object getApplicationProperty(String key) { } /** - * Perform a proper annotation set on the AMQP Message based on a Symbol key and - * the target value to append to the current annotations. + * Perform a proper annotation set on the AMQP Message based on a Symbol key and the target value to append to the + * current annotations. * * @param key The name of the Symbol whose value is being set. * @param value The new value to set in the annotations of this message. @@ -562,12 +530,11 @@ public void setMessageAnnotation(String key, Object value) { } /** - * Given a message annotation name, lookup and return the value associated with - * that annotation name. If the message annotations have not been created yet - * then this method will always return null. + * Given a message annotation name, lookup and return the value associated with that annotation name. If the message + * annotations have not been created yet then this method will always return null. * * @param key the Symbol name that should be looked up in the message annotations. - * @return the value of the annotation if it exists, or null if not set or not accessible. + * @return the value of the annotation if it exists, or null if not set or not accessible */ public Object getMessageAnnotation(String key) { if (messageAnnotationsMap == null) { @@ -578,8 +545,8 @@ public Object getMessageAnnotation(String key) { } /** - * Perform a proper delivery annotation set on the AMQP Message based on a Symbol - * key and the target value to append to the current delivery annotations. + * Perform a proper delivery annotation set on the AMQP Message based on a Symbol key and the target value to append + * to the current delivery annotations. * * @param key The name of the Symbol whose value is being set. * @param value The new value to set in the delivery annotations of this message. @@ -591,12 +558,11 @@ public void setDeliveryAnnotation(String key, Object value) { } /** - * Given a message annotation name, lookup and return the value associated with - * that annotation name. If the message annotations have not been created yet - * then this method will always return null. + * Given a message annotation name, lookup and return the value associated with that annotation name. If the message + * annotations have not been created yet then this method will always return null. * * @param key the Symbol name that should be looked up in the message annotations. - * @return the value of the annotation if it exists, or null if not set or not accessible. + * @return the value of the annotation if it exists, or null if not set or not accessible */ public Object getDeliveryAnnotation(String key) { if (deliveryAnnotationsMap == null) { @@ -609,8 +575,8 @@ public Object getDeliveryAnnotation(String key) { //----- Methods for manipulating the Message body ------------------------// /** - * Sets a String value into the body of an outgoing Message, throws - * an exception if this is an incoming message instance. + * Sets a String value into the body of an outgoing Message, throws an exception if this is an incoming message + * instance. * * @param value the String value to store in the Message body. * @throws IllegalStateException if the message is read only. @@ -622,9 +588,8 @@ public void setText(String value) throws IllegalStateException { } /** - * Attempts to retrieve the message body as a String from an AmqpValue body. + * {@return the message body as a String from an AmqpValue body} * - * @return the string * @throws NoSuchElementException if the body does not contain a AmqpValue with String. */ public String getText() throws NoSuchElementException { @@ -640,8 +605,8 @@ public String getText() throws NoSuchElementException { } /** - * Sets a byte array value into the body of an outgoing Message, throws - * an exception if this is an incoming message instance. + * Sets a byte array value into the body of an outgoing Message, throws an exception if this is an incoming message + * instance. * * @param bytes the byte array value to store in the Message body. * @throws IllegalStateException if the message is read only. @@ -653,8 +618,8 @@ public void setBytes(byte[] bytes) throws IllegalStateException { } /** - * Sets a described type into the body of an outgoing Message, throws - * an exception if this is an incoming message instance. + * Sets a described type into the body of an outgoing Message, throws an exception if this is an incoming message + * instance. * * @param described the described type value to store in the Message body. * @throws IllegalStateException if the message is read only. @@ -666,9 +631,8 @@ public void setDescribedType(DescribedType described) throws IllegalStateExcepti } /** - * Attempts to retrieve the message body as an DescribedType instance. + * {@return the message body as an DescribedType instance if possible; {@code null} otherwise} * - * @return an DescribedType instance if one is stored in the message body. * @throws NoSuchElementException if the body does not contain a DescribedType. */ public DescribedType getDescribedType() throws NoSuchElementException { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpOperationTimedOutException.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpOperationTimedOutException.java index 3ada8e1910f..9fe441b5d93 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpOperationTimedOutException.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpOperationTimedOutException.java @@ -19,8 +19,7 @@ import javax.jms.JMSException; /** - * Exception that indicates a blocking operation timed out while waiting - * for the remote to acknowledge or process it. + * Exception that indicates a blocking operation timed out while waiting for the remote to acknowledge or process it. */ public class AmqpOperationTimedOutException extends JMSException { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpReceiver.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpReceiver.java index 9a8dbafa48f..27ef5791503 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpReceiver.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpReceiver.java @@ -91,12 +91,9 @@ public int getPrefetchSize() { /** * Create a new receiver instance. * - * @param session - * The parent session that created the receiver. - * @param address - * The address that this receiver should listen on. - * @param receiverId - * The unique ID assigned to this receiver. + * @param session The parent session that created the receiver. + * @param address The address that this receiver should listen on. + * @param receiverId The unique ID assigned to this receiver. */ public AmqpReceiver(AmqpSession session, String address, String receiverId) { this(session, address, receiverId, null, null); @@ -105,16 +102,11 @@ public AmqpReceiver(AmqpSession session, String address, String receiverId) { /** * Create a new receiver instance. * - * @param session - * The parent session that created the receiver. - * @param address - * The address that this receiver should listen on. - * @param receiverId - * The unique ID assigned to this receiver. - * @param senderMode - * The {@link SenderSettleMode} to use on open. - * @param receiverMode - * The {@link ReceiverSettleMode} to use on open. + * @param session The parent session that created the receiver. + * @param address The address that this receiver should listen on. + * @param receiverId The unique ID assigned to this receiver. + * @param senderMode The {@link SenderSettleMode} to use on open. + * @param receiverMode The {@link ReceiverSettleMode} to use on open. */ public AmqpReceiver(AmqpSession session, String address, String receiverId, SenderSettleMode senderMode, ReceiverSettleMode receiverMode) { @@ -133,12 +125,9 @@ public AmqpReceiver(AmqpSession session, String address, String receiverId, Send /** * Create a new receiver instance. * - * @param session - * The parent session that created the receiver. - * @param source - * The Source instance to use instead of creating and configuring one. - * @param receiverId - * The unique ID assigned to this receiver. + * @param session The parent session that created the receiver. + * @param source The Source instance to use instead of creating and configuring one. + * @param receiverId The unique ID assigned to this receiver. */ public AmqpReceiver(AmqpSession session, Source source, String receiverId) { @@ -155,11 +144,9 @@ public AmqpReceiver(AmqpSession session, Source source, String receiverId) { } /** - * Close the receiver, a closed receiver will throw exceptions if any further send calls are - * made. + * Close the receiver, a closed receiver will throw exceptions if any further send calls are made. * - * @throws IOException - * if an error occurs while closing the receiver. + * @throws IOException if an error occurs while closing the receiver. */ public void close() throws IOException { if (closed.compareAndSet(false, true)) { @@ -183,11 +170,9 @@ public void setProperties(Map properties) { } /** - * Detach the receiver, a closed receiver will throw exceptions if any further send calls are - * made. + * Detach the receiver, a closed receiver will throw exceptions if any further send calls are made. * - * @throws IOException - * if an error occurs while closing the receiver. + * @throws IOException if an error occurs while closing the receiver. */ public void detach() throws IOException { if (closed.compareAndSet(false, true)) { @@ -203,26 +188,25 @@ public void detach() throws IOException { } /** - * @return this session's parent AmqpSession. + * {@return this session's parent AmqpSession} */ public AmqpSession getSession() { return session; } /** - * @return the address that this receiver has been configured to listen on. + * {@return the address that this receiver has been configured to listen on} */ public String getAddress() { return address; } /** - * Attempts to wait on a message to be delivered to this receiver. The receive call will wait - * indefinitely for a message to be delivered. + * Attempts to wait on a message to be delivered to this receiver. The receive call will wait indefinitely for a + * message to be delivered. * - * @return a newly received message sent to this receiver. - * @throws Exception - * if an error occurs during the receive attempt. + * @return a newly received message sent to this receiver + * @throws Exception if an error occurs during the receive attempt. */ public AmqpMessage receive() throws Exception { checkClosed(); @@ -230,16 +214,13 @@ public AmqpMessage receive() throws Exception { } /** - * Attempts to receive a message sent to this receiver, waiting for the given timeout value - * before giving up and returning null. + * Attempts to receive a message sent to this receiver, waiting for the given timeout value before giving up and + * returning null. * - * @param timeout - * the time to wait for a new message to arrive. - * @param unit - * the unit of time that the timeout value represents. - * @return a newly received message or null if the time to wait period expires. - * @throws Exception - * if an error occurs during the receive attempt. + * @param timeout the time to wait for a new message to arrive. + * @param unit the unit of time that the timeout value represents. + * @return a newly received message or null if the time to wait period expires + * @throws Exception if an error occurs during the receive attempt. */ public AmqpMessage receive(long timeout, TimeUnit unit) throws Exception { checkClosed(); @@ -247,12 +228,11 @@ public AmqpMessage receive(long timeout, TimeUnit unit) throws Exception { } /** - * If a message is already available in this receiver's prefetch buffer then it is returned - * immediately otherwise this methods return null without waiting. + * If a message is already available in this receiver's prefetch buffer then it is returned immediately otherwise + * this methods return null without waiting. * - * @return a newly received message or null if there is no currently available message. - * @throws Exception - * if an error occurs during the receive attempt. + * @return a newly received message or null if there is no currently available message + * @throws Exception if an error occurs during the receive attempt. */ public AmqpMessage receiveNoWait() throws Exception { checkClosed(); @@ -262,9 +242,8 @@ public AmqpMessage receiveNoWait() throws Exception { /** * Request a remote peer send a Message to this client waiting until one arrives. * - * @return the pulled AmqpMessage or null if none was pulled from the remote. - * @throws IOException - * if an error occurs + * @return the pulled AmqpMessage or null if none was pulled from the remote + * @throws IOException if an error occurs */ public AmqpMessage pull() throws IOException { return pull(-1, TimeUnit.MILLISECONDS); @@ -273,9 +252,8 @@ public AmqpMessage pull() throws IOException { /** * Request a remote peer send a Message to this client using an immediate drain request. * - * @return the pulled AmqpMessage or null if none was pulled from the remote. - * @throws IOException - * if an error occurs + * @return the pulled AmqpMessage or null if none was pulled from the remote + * @throws IOException if an error occurs */ public AmqpMessage pullImmediate() throws IOException { return pull(0, TimeUnit.MILLISECONDS); @@ -283,20 +261,17 @@ public AmqpMessage pullImmediate() throws IOException { /** * Request a remote peer send a Message to this client. - * - * {@literal timeout < 0} then it should remain open until a message is received. - * {@literal timeout = 0} then it returns a message or null if none available - * {@literal timeout > 0} then it should remain open for timeout amount of time. - * + *

                      + * {@literal timeout < 0} then it should remain open until a message is received. {@literal timeout = 0} then it + * returns a message or null if none available {@literal timeout > 0} then it should remain open for timeout amount + * of time. + *

                      * The timeout value when positive is given in milliseconds. * - * @param timeout - * the amount of time to tell the remote peer to keep this pull request valid. - * @param unit - * the unit of measure that the timeout represents. - * @return the pulled AmqpMessage or null if none was pulled from the remote. - * @throws IOException - * if an error occurs + * @param timeout the amount of time to tell the remote peer to keep this pull request valid. + * @param unit the unit of measure that the timeout represents. + * @return the pulled AmqpMessage or null if none was pulled from the remote + * @throws IOException if an error occurs */ public AmqpMessage pull(final long timeout, final TimeUnit unit) throws IOException { checkClosed(); @@ -358,10 +333,8 @@ public AmqpMessage pull(final long timeout, final TimeUnit unit) throws IOExcept /** * Controls the amount of credit given to the receiver link. * - * @param credit - * the amount of credit to grant. - * @throws IOException - * if an error occurs while sending the flow. + * @param credit the amount of credit to grant. + * @throws IOException if an error occurs while sending the flow. */ public void flow(final int credit) throws IOException { flow(credit, false); @@ -370,12 +343,9 @@ public void flow(final int credit) throws IOException { /** * Controls the amount of credit given to the receiver link. * - * @param credit - * the amount of credit to grant. - * @param deferWrite - * defer writing to the wire, hold until for the next operation writes. - * @throws IOException - * if an error occurs while sending the flow. + * @param credit the amount of credit to grant. + * @param deferWrite defer writing to the wire, hold until for the next operation writes. + * @throws IOException if an error occurs while sending the flow. */ public void flow(final int credit, final boolean deferWrite) throws IOException { checkClosed(); @@ -399,10 +369,8 @@ public void flow(final int credit, final boolean deferWrite) throws IOException /** * Attempts to drain a given amount of credit from the link. * - * @param credit - * the amount of credit to drain. - * @throws IOException - * if an error occurs while sending the drain. + * @param credit the amount of credit to drain. + * @throws IOException if an error occurs while sending the drain. */ public void drain(final int credit) throws IOException { checkClosed(); @@ -424,8 +392,7 @@ public void drain(final int credit) throws IOException { /** * Stops the receiver, using all link credit and waiting for in-flight messages to arrive. * - * @throws IOException - * if an error occurs while sending the drain. + * @throws IOException if an error occurs while sending the drain. */ public void stop() throws IOException { checkClosed(); @@ -444,14 +411,10 @@ public void stop() throws IOException { } /** - * Accepts a message that was dispatched under the given Delivery instance and settles the - * delivery. + * Accepts a message that was dispatched under the given Delivery instance and settles the delivery. * - * @param delivery - * the Delivery instance to accept. - * - * @throws IOException - * if an error occurs while sending the accept. + * @param delivery the Delivery instance to accept. + * @throws IOException if an error occurs while sending the accept. */ public void accept(Delivery delivery) throws IOException { accept(delivery, this.session, true); @@ -460,33 +423,24 @@ public void accept(Delivery delivery) throws IOException { /** * Accepts a message that was dispatched under the given Delivery instance. * - * @param delivery - * the Delivery instance to accept. - * @param settle - * true if the receiver should settle the delivery or just send the disposition. - * - * @throws IOException - * if an error occurs while sending the accept. + * @param delivery the Delivery instance to accept. + * @param settle {@code true} if the receiver should settle the delivery or just send the disposition. + * @throws IOException if an error occurs while sending the accept. */ public void accept(Delivery delivery, boolean settle) throws IOException { accept(delivery, this.session, settle); } /** - * Accepts a message that was dispatched under the given Delivery instance and settles the - * delivery. + * Accepts a message that was dispatched under the given Delivery instance and settles the delivery. + *

                      + * This method allows for the session that is used in the accept to be specified by the caller. This allows for an + * accepted message to be involved in a transaction that is being managed by some other session other than the one + * that created this receiver. * - * This method allows for the session that is used in the accept to be specified by the - * caller. This allows for an accepted message to be involved in a transaction that is being - * managed by some other session other than the one that created this receiver. - * - * @param delivery - * the Delivery instance to accept. - * @param session - * the session under which the message is being accepted. - * - * @throws IOException - * if an error occurs while sending the accept. + * @param delivery the Delivery instance to accept. + * @param session the session under which the message is being accepted. + * @throws IOException if an error occurs while sending the accept. */ public void accept(final Delivery delivery, final AmqpSession session) throws IOException { accept(delivery, session, true); @@ -494,20 +448,15 @@ public void accept(final Delivery delivery, final AmqpSession session) throws IO /** * Accepts a message that was dispatched under the given Delivery instance. + *

                      + * This method allows for the session that is used in the accept to be specified by the caller. This allows for an + * accepted message to be involved in a transaction that is being managed by some other session other than the one + * that created this receiver. * - * This method allows for the session that is used in the accept to be specified by the - * caller. This allows for an accepted message to be involved in a transaction that is being - * managed by some other session other than the one that created this receiver. - * - * @param delivery - * the Delivery instance to accept. - * @param session - * the session under which the message is being accepted. - * @param settle - * true if the receiver should settle the delivery or just send the disposition. - * - * @throws IOException - * if an error occurs while sending the accept. + * @param delivery the Delivery instance to accept. + * @param session the session under which the message is being accepted. + * @param settle {@code true} if the receiver should settle the delivery or just send the disposition. + * @throws IOException if an error occurs while sending the accept. */ public void accept(final Delivery delivery, final AmqpSession session, final boolean settle) throws IOException { checkClosed(); @@ -559,14 +508,10 @@ public void accept(final Delivery delivery, final AmqpSession session, final boo /** * Mark a message that was dispatched under the given Delivery instance as Modified. * - * @param delivery - * the Delivery instance to mark modified. - * @param deliveryFailed - * indicates that the delivery failed for some reason. - * @param undeliverableHere - * marks the delivery as not being able to be process by link it was sent to. - * @throws IOException - * if an error occurs while sending the reject. + * @param delivery the Delivery instance to mark modified. + * @param deliveryFailed indicates that the delivery failed for some reason. + * @param undeliverableHere marks the delivery as not being able to be process by link it was sent to. + * @throws IOException if an error occurs while sending the reject. */ public void modified(final Delivery delivery, final Boolean deliveryFailed, final Boolean undeliverableHere) throws IOException { checkClosed(); @@ -599,10 +544,8 @@ public void modified(final Delivery delivery, final Boolean deliveryFailed, fina /** * Release a message that was dispatched under the given Delivery instance. * - * @param delivery - * the Delivery instance to release. - * @throws IOException - * if an error occurs while sending the release. + * @param delivery the Delivery instance to release. + * @throws IOException if an error occurs while sending the release. */ public void release(final Delivery delivery) throws IOException { checkClosed(); @@ -632,10 +575,8 @@ public void release(final Delivery delivery) throws IOException { /** * Reject a message that was dispatched under the given Delivery instance. * - * @param delivery - * the Delivery instance to reject. - * @throws IOException - * if an error occurs while sending the release. + * @param delivery the Delivery instance to reject. + * @throws IOException if an error occurs while sending the release. */ public void reject(final Delivery delivery) throws IOException { checkClosed(); @@ -663,7 +604,7 @@ public void reject(final Delivery delivery) throws IOException { } /** - * @return an unmodifiable view of the underlying Receiver instance. + * {@return an unmodifiable view of the underlying Receiver instance} */ public Receiver getReceiver() { return UnmodifiableProxy.receiverProxy(getEndpoint()); diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpRedirectedException.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpRedirectedException.java index e0369ad69c2..ab850e4fb79 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpRedirectedException.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpRedirectedException.java @@ -19,8 +19,8 @@ import java.io.IOException; /** - * {@link IOException} derivative that defines that the remote peer has requested that this - * connection be redirected to some alternative peer. + * {@link IOException} derivative that defines that the remote peer has requested that this connection be redirected to + * some alternative peer. */ public class AmqpRedirectedException extends IOException { @@ -39,21 +39,21 @@ public AmqpRedirectedException(String reason, String hostname, String networkHos } /** - * @return the host name of the container being redirected to. + * @return the host name of the container being redirected to */ public String getHostname() { return hostname; } /** - * @return the DNS host name or IP address of the peer this connection is being redirected to. + * @return the DNS host name or IP address of the peer this connection is being redirected to */ public String getNetworkHost() { return networkHost; } /** - * @return the port number on the peer this connection is being redirected to. + * @return the port number on the peer this connection is being redirected to */ public int getPort() { return port; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpResource.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpResource.java index bd66659c7ff..cf16e471a6f 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpResource.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpResource.java @@ -20,77 +20,73 @@ /** * AmqpResource specification. - * - * All AMQP types should implement this interface to allow for control of state - * and configuration details. + *

                      + * All AMQP types should implement this interface to allow for control of state and configuration details. */ public interface AmqpResource extends AmqpEventSink { /** - * Perform all the work needed to open this resource and store the request - * until such time as the remote peer indicates the resource has become active. + * Perform all the work needed to open this resource and store the request until such time as the remote peer + * indicates the resource has become active. * * @param request The initiating request that triggered this open call. */ void open(AsyncResult request); /** - * @return if the resource has moved to the opened state on the remote. + * {@return if the resource has moved to the opened state on the remote} */ boolean isOpen(); /** - * Called to indicate that this resource is now remotely opened. Once opened a - * resource can start accepting incoming requests. + * Called to indicate that this resource is now remotely opened. Once opened a resource can start accepting incoming + * requests. */ void opened(); /** - * Perform all work needed to close this resource and store the request - * until such time as the remote peer indicates the resource has been closed. + * Perform all work needed to close this resource and store the request until such time as the remote peer indicates + * the resource has been closed. * * @param request The initiating request that triggered this close call. */ void close(AsyncResult request); /** - * Perform all work needed to detach this resource and store the request - * until such time as the remote peer indicates the resource has been detached. + * Perform all work needed to detach this resource and store the request until such time as the remote peer indicates + * the resource has been detached. * * @param request The initiating request that triggered this detach call. */ void detach(AsyncResult request); /** - * @return if the resource has moved to the closed state on the remote. + * {@return if the resource has moved to the closed state on the remote} */ boolean isClosed(); /** - * Called to indicate that this resource is now remotely closed. Once closed a - * resource can not accept any incoming requests. + * Called to indicate that this resource is now remotely closed. Once closed a resource can not accept any incoming + * requests. */ void closed(); /** - * Sets the failed state for this Resource and triggers a failure signal for - * any pending ProduverRequest. + * Sets the failed state for this Resource and triggers a failure signal for any pending ProduverRequest. */ void failed(); /** - * Called to indicate that the remote end has become closed but the resource - * was not awaiting a close. This could happen during an open request where - * the remote does not set an error condition or during normal operation. + * Called to indicate that the remote end has become closed but the resource was not awaiting a close. This could + * happen during an open request where the remote does not set an error condition or during normal operation. * * @param connection The connection that owns this resource. */ void remotelyClosed(AmqpConnection connection); /** - * Called to indicate that the local end has become closed but the resource - * was not awaiting a close. This could happen during an open request where - * the remote does not set an error condition or during normal operation. + * Called to indicate that the local end has become closed but the resource was not awaiting a close. This could + * happen during an open request where the remote does not set an error condition or during normal operation. * * @param connection The connection that owns this resource. * @param error The error that triggered the local close of this resource. @@ -98,8 +94,7 @@ public interface AmqpResource extends AmqpEventSink { void locallyClosed(AmqpConnection connection, Exception error); /** - * Sets the failed state for this Resource and triggers a failure signal for - * any pending ProduverRequest. + * Sets the failed state for this Resource and triggers a failure signal for any pending ProduverRequest. * * @param cause The Exception that triggered the failure. */ 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 c12c5fd91a9..cb34d4e3c26 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 @@ -87,12 +87,9 @@ public class AmqpSender extends AmqpAbstractResource { /** * Create a new sender instance. * - * @param session - * The parent session that created the session. - * @param address - * The address that this sender produces to. - * @param senderId - * The unique ID assigned to this sender. + * @param session The parent session that created the session. + * @param address The address that this sender produces to. + * @param senderId The unique ID assigned to this sender. */ public AmqpSender(AmqpSession session, String address, String senderId) { this(session, address, senderId, null, null, DEFAULT_OUTCOMES); @@ -101,18 +98,12 @@ public AmqpSender(AmqpSession session, String address, String senderId) { /** * Create a new sender instance. * - * @param session - * The parent session that created the session. - * @param address - * The address that this sender produces to. - * @param senderId - * The unique ID assigned to this sender. - * @param senderMode - * The {@link SenderSettleMode} to use on open. - * @param receiverMode - * The {@link ReceiverSettleMode} to use on open. - * @param outcomes - * The outcomes to use on open + * @param session The parent session that created the session. + * @param address The address that this sender produces to. + * @param senderId The unique ID assigned to this sender. + * @param senderMode The {@link SenderSettleMode} to use on open. + * @param receiverMode The {@link ReceiverSettleMode} to use on open. + * @param outcomes The outcomes to use on open */ public AmqpSender(AmqpSession session, String address, @@ -137,12 +128,9 @@ public AmqpSender(AmqpSession session, /** * Create a new sender instance using the given Target when creating the link. * - * @param session - * The parent session that created the session. - * @param target - * The target that this sender produces to. - * @param senderId - * The unique ID assigned to this sender. + * @param session The parent session that created the session. + * @param target The target that this sender produces to. + * @param senderId The unique ID assigned to this sender. */ public AmqpSender(AmqpSession session, Target target, String senderId) { @@ -162,10 +150,8 @@ public AmqpSender(AmqpSession session, Target target, String senderId) { /** * Sends the given message to this senders assigned address. * - * @param message - * the message to send. - * @throws IOException - * if an error occurs during the send. + * @param message the message to send. + * @throws IOException if an error occurs during the send. */ public void send(final AmqpMessage message) throws IOException { checkClosed(); @@ -173,15 +159,11 @@ public void send(final AmqpMessage message) throws IOException { } /** - * Sends the given message to this senders assigned address using the supplied transaction - * ID. + * Sends the given message to this senders assigned address using the supplied transaction ID. * - * @param message - * the message to send. - * @param txId - * the transaction ID to assign the outgoing send. - * @throws IOException - * if an error occurs during the send. + * @param message the message to send. + * @param txId the transaction ID to assign the outgoing send. + * @throws IOException if an error occurs during the send. */ public void send(final AmqpMessage message, final AmqpTransactionId txId) throws IOException { checkClosed(); @@ -205,11 +187,9 @@ public void send(final AmqpMessage message, final AmqpTransactionId txId) throws } /** - * Close the sender, a closed sender will throw exceptions if any further send calls are - * made. + * Close the sender, a closed sender will throw exceptions if any further send calls are made. * - * @throws IOException - * if an error occurs while closing the sender. + * @throws IOException if an error occurs while closing the sender. */ public void close() throws IOException { if (closed.compareAndSet(false, true)) { @@ -225,21 +205,21 @@ public void close() throws IOException { } /** - * @return this session's parent AmqpSession. + * {@return this session's parent AmqpSession} */ public AmqpSession getSession() { return session; } /** - * @return an unmodifiable view of the underlying Sender instance. + * {@return an unmodifiable view of the underlying Sender instance} */ public Sender getSender() { return UnmodifiableProxy.senderProxy(getEndpoint()); } /** - * @return the assigned address of this sender. + * {@return the assigned address of this sender} */ public String getAddress() { return address; @@ -248,7 +228,7 @@ public String getAddress() { // ----- Sender configuration ---------------------------------------------// /** - * @return will messages be settle on send. + * {@return will messages be settle on send} */ public boolean isPresettle() { return presettle; @@ -257,15 +237,14 @@ public boolean isPresettle() { /** * Configure is sent messages are marked as settled on send, defaults to false. * - * @param presettle - * configure if this sender will presettle all sent messages. + * @param presettle configure if this sender will presettle all sent messages. */ public void setPresettle(boolean presettle) { this.presettle = presettle; } /** - * @return the currently configured send timeout. + * {@return the currently configured send timeout} */ public long getSendTimeout() { return sendTimeout; @@ -274,8 +253,7 @@ public long getSendTimeout() { /** * Sets the amount of time the sender will block on a send before failing. * - * @param sendTimeout - * time in milliseconds to wait. + * @param sendTimeout time in milliseconds to wait. */ public void setSendTimeout(long sendTimeout) { this.sendTimeout = sendTimeout; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSession.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSession.java index f6b5553bb77..96d7ea2727a 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSession.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSession.java @@ -59,8 +59,7 @@ public AmqpSession(AmqpConnection connection, String sessionId) { } /** - * Close the receiver, a closed receiver will throw exceptions if any further send - * calls are made. + * Close the receiver, a closed receiver will throw exceptions if any further send calls are made. * * @throws IOException if an error occurs while closing the receiver. */ @@ -80,8 +79,7 @@ public void close() throws IOException { /** * Create an anonymous sender. * - * @return a newly created sender that is ready for use. - * + * @return a newly created sender that is ready for use * @throws Exception if an error occurs while creating the sender. */ public AmqpSender createSender() throws Exception { @@ -91,7 +89,7 @@ public AmqpSender createSender() throws Exception { /** * Create an anonymous sender instance using the anonymous relay support of the broker. * - * @return a newly created sender that is ready for use. + * @return a newly created sender that is ready for use * @throws Exception if an error occurs while creating the sender. */ public AmqpSender createAnonymousSender() throws Exception { @@ -102,7 +100,7 @@ public AmqpSender createAnonymousSender() throws Exception { * Create a sender instance using the given address * * @param address the address to which the sender will produce its messages. - * @return a newly created sender that is ready for use. + * @return a newly created sender that is ready for use * @throws Exception if an error occurs while creating the sender. */ public AmqpSender createSender(final String address) throws Exception { @@ -112,22 +110,21 @@ public AmqpSender createSender(final String address) throws Exception { /** * Create a sender instance using the given address * - * @param address the address to which the sender will produce its messages. + * @param address the address to which the sender will produce its messages. * @param desiredCapabilities the capabilities that the caller wants the remote to support. - * @return a newly created sender that is ready for use. + * @return a newly created sender that is ready for use * @throws Exception if an error occurs while creating the sender. */ public AmqpSender createSender(final String address, Symbol[] desiredCapabilities) throws Exception { return createSender(address, false, desiredCapabilities, null, null); } - /** * Create a sender instance using the given address * * @param address the address to which the sender will produce its messages. * @param presettle controls if the created sender produces message that have already been marked settled. - * @return a newly created sender that is ready for use. + * @return a newly created sender that is ready for use * @throws Exception if an error occurs while creating the sender. */ public AmqpSender createSender(final String address, boolean presettle) throws Exception { @@ -137,12 +134,12 @@ public AmqpSender createSender(final String address, boolean presettle) throws E /** * Create a sender instance using the given address * - * @param address the address to which the sender will produce its messages. - * @param presettle controls if the created sender produces message that have already been marked settled. + * @param address the address to which the sender will produce its messages. + * @param presettle controls if the created sender produces message that have already been marked settled. * @param desiredCapabilities the capabilities that the caller wants the remote to support. * @param offeredCapabilities the capabilities that the caller wants the advertise support for. - * @param properties the properties to send as part of the sender open. - * @return a newly created sender that is ready for use. + * @param properties the properties to send as part of the sender open. + * @return a newly created sender that is ready for use * @throws Exception if an error occurs while creating the sender. */ public AmqpSender createSender(final String address, boolean presettle, Symbol[] desiredCapabilities, Symbol[] offeredCapabilities, Map properties) throws Exception { @@ -170,15 +167,10 @@ public AmqpSender createSender(final String address, boolean presettle, Symbol[] /** * Create a sender instance using the given address * - * @param address - * the address to which the sender will produce its messages. - * @param senderMode - * controls the settlement mode used by the created Sender - * @param receiverMode - * controls the desired settlement mode used by the remote Receiver - * - * @return a newly created sender that is ready for use. - * + * @param address the address to which the sender will produce its messages. + * @param senderMode controls the settlement mode used by the created Sender + * @param receiverMode controls the desired settlement mode used by the remote Receiver + * @return a newly created sender that is ready for use * @throws Exception if an error occurs while creating the sender. */ public AmqpSender createSender(final String address, @@ -190,17 +182,11 @@ public AmqpSender createSender(final String address, /** * Create a sender instance using the given address * - * @param address - * the address to which the sender will produce its messages. - * @param senderMode - * controls the settlement mode used by the created Sender - * @param receiverMode - * controls the desired settlement mode used by the remote Receiver - * @param outcomes - * specifies the outcomes supported by the sender - * - * @return a newly created sender that is ready for use. - * + * @param address the address to which the sender will produce its messages. + * @param senderMode controls the settlement mode used by the created Sender + * @param receiverMode controls the desired settlement mode used by the remote Receiver + * @param outcomes specifies the outcomes supported by the sender + * @return a newly created sender that is ready for use * @throws Exception if an error occurs while creating the sender. */ public AmqpSender createSender(final String address, @@ -227,7 +213,7 @@ public AmqpSender createSender(final String address, * Create a sender instance using the given Target * * @param target the caller created and configured Target used to create the sender link. - * @return a newly created sender that is ready for use. + * @return a newly created sender that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpSender createSender(Target target) throws Exception { @@ -237,9 +223,9 @@ public AmqpSender createSender(Target target) throws Exception { /** * Create a sender instance using the given Target * - * @param target the caller created and configured Target used to create the sender link. + * @param target the caller created and configured Target used to create the sender link. * @param senderId the sender ID to assign to the newly created Sender. - * @return a newly created sender that is ready for use. + * @return a newly created sender that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpSender createSender(Target target, String senderId) throws Exception { @@ -249,12 +235,12 @@ public AmqpSender createSender(Target target, String senderId) throws Exception /** * Create a sender instance using the given Target * - * @param target the caller created and configured Target used to create the sender link. - * @param senderId the sender ID to assign to the newly created Sender. + * @param target the caller created and configured Target used to create the sender link. + * @param senderId the sender ID to assign to the newly created Sender. * @param desiredCapabilities the capabilities that the caller wants the remote to support. * @param offeredCapabilities the capabilities that the caller wants the advertise support for. - * @param properties the properties to send as part of the sender open. - * @return a newly created sender that is ready for use. + * @param properties the properties to send as part of the sender open. + * @return a newly created sender that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpSender createSender(Target target, String senderId, Symbol[] desiredCapabilities, Symbol[] offeredCapabilities, Map properties) throws Exception { @@ -282,7 +268,7 @@ public AmqpSender createSender(Target target, String senderId, Symbol[] desiredC * Create a receiver instance using the given address * * @param address the address to which the receiver will subscribe for its messages. - * @return a newly created receiver that is ready for use. + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createReceiver(String address) throws Exception { @@ -294,7 +280,7 @@ public AmqpReceiver createReceiver(String address) throws Exception { * * @param address the address to which the receiver will subscribe for its messages. * @param selector the JMS selector to use for the subscription - * @return a newly created receiver that is ready for use. + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createReceiver(String address, String selector) throws Exception { @@ -307,7 +293,7 @@ public AmqpReceiver createReceiver(String address, String selector) throws Excep * @param address the address to which the receiver will subscribe for its messages. * @param selector the JMS selector to use for the subscription * @param noLocal should the subscription have messages from its connection filtered. - * @return a newly created receiver that is ready for use. + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createReceiver(String address, String selector, boolean noLocal) throws Exception { @@ -320,15 +306,16 @@ public AmqpReceiver createReceiver(String address, boolean presettle) throws Exception { return createReceiver(address, selector, noLocal, presettle, null); } + /** * Create a receiver instance using the given address * - * @param address the address to which the receiver will subscribe for its messages. - * @param selector the JMS selector to use for the subscription - * @param noLocal should the subscription have messages from its connection filtered. - * @param presettle should the receiver be created with a settled sender mode. + * @param address the address to which the receiver will subscribe for its messages. + * @param selector the JMS selector to use for the subscription + * @param noLocal should the subscription have messages from its connection filtered. + * @param presettle should the receiver be created with a settled sender mode. * @param properties to set on the receiver - * @return a newly created receiver that is ready for use. + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createReceiver(String address, @@ -365,15 +352,10 @@ public AmqpReceiver createReceiver(String address, /** * Create a receiver instance using the given address * - * @param address - * the address to which the receiver will subscribe for its messages. - * @param senderMode - * controls the desired settlement mode used by the remote Sender - * @param receiverMode - * controls the settlement mode used by the created Receiver - * - * @return a newly created receiver that is ready for use. - * + * @param address the address to which the receiver will subscribe for its messages. + * @param senderMode controls the desired settlement mode used by the remote Sender + * @param receiverMode controls the settlement mode used by the created Receiver + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createReceiver(String address, SenderSettleMode senderMode, ReceiverSettleMode receiverMode) throws Exception { @@ -398,7 +380,7 @@ public AmqpReceiver createReceiver(String address, SenderSettleMode senderMode, * Create a receiver instance using the given Source * * @param source the caller created and configured Source used to create the receiver link. - * @return a newly created receiver that is ready for use. + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createReceiver(Source source) throws Exception { @@ -408,9 +390,9 @@ public AmqpReceiver createReceiver(Source source) throws Exception { /** * Create a receiver instance using the given Source * - * @param source the caller created and configured Source used to create the receiver link. + * @param source the caller created and configured Source used to create the receiver link. * @param receiverId the receiver id to use. - * @return a newly created receiver that is ready for use. + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createReceiver(Source source, String receiverId) throws Exception { @@ -431,12 +413,11 @@ public AmqpReceiver createReceiver(Source source, String receiverId) throws Exce return receiver; } - /** * Create a receiver instance using the given Source * * @param source the caller created and configured Source used to create the receiver link. - * @return a newly created receiver that is ready for use. + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createMulticastReceiver(Source source, String receiverId, String receiveName) throws Exception { @@ -461,7 +442,7 @@ public AmqpReceiver createMulticastReceiver(Source source, String receiverId, St /** * Create a receiver instance using the given receiverId * - * @return a newly created receiver that is ready for use. + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createMulticastReceiver(String receiverId, String address, String receiveName) throws Exception { @@ -488,7 +469,7 @@ public AmqpReceiver createMulticastReceiver(String receiverId, String address, S * * @param address the address to which the receiver will subscribe for its messages. * @param subscriptionName the name of the subscription that is being created. - * @return a newly created receiver that is ready for use. + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createDurableReceiver(String address, String subscriptionName) throws Exception { @@ -501,7 +482,7 @@ public AmqpReceiver createDurableReceiver(String address, String subscriptionNam * @param address the address to which the receiver will subscribe for its messages. * @param subscriptionName the name of the subscription that is being created. * @param selector the JMS selector to use for the subscription - * @return a newly created receiver that is ready for use. + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createDurableReceiver(String address, @@ -517,7 +498,7 @@ public AmqpReceiver createDurableReceiver(String address, * @param subscriptionName the name of the subscription that is being created. * @param selector the JMS selector to use for the subscription * @param noLocal should the subscription have messages from its connection filtered. - * @return a newly created receiver that is ready for use. + * @return a newly created receiver that is ready for use * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver createDurableReceiver(String address, @@ -554,7 +535,7 @@ public AmqpReceiver createDurableReceiver(String address, * Create a receiver instance using the given address that creates a durable subscription. * * @param subscriptionName the name of the subscription that should be queried for on the remote.. - * @return a newly created receiver that is ready for use if the subscription exists. + * @return a newly created receiver that is ready for use if the subscription exists * @throws Exception if an error occurs while creating the receiver. */ public AmqpReceiver lookupSubscription(String subscriptionName) throws Exception { @@ -581,7 +562,7 @@ public AmqpReceiver lookupSubscription(String subscriptionName) throws Exception } /** - * @return this session's parent AmqpConnection. + * {@return this session's parent AmqpConnection} */ public AmqpConnection getConnection() { return connection; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSupport.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSupport.java index d4f25323b3d..4a8bfcc8c20 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSupport.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpSupport.java @@ -84,11 +84,10 @@ public class AmqpSupport { //----- Utility Methods --------------------------------------------------// /** - * Given an ErrorCondition instance create a new Exception that best matches - * the error type. + * Given an ErrorCondition instance create a new Exception that best matches the error type. * * @param errorCondition The ErrorCondition returned from the remote peer. - * @return a new Exception instance that best matches the ErrorCondition value. + * @return a new Exception instance that best matches the ErrorCondition value */ public static Exception convertToException(ErrorCondition errorCondition) { Exception remoteError = null; @@ -125,11 +124,11 @@ public static Exception convertToException(ErrorCondition errorCondition) { } /** - * Attempt to read and return the embedded error message in the given ErrorCondition - * object. If no message can be extracted a generic message is returned. + * Attempt to read and return the embedded error message in the given ErrorCondition object. If no message can be + * extracted a generic message is returned. * * @param errorCondition The ErrorCondition to extract the error message from. - * @return an error message extracted from the given ErrorCondition. + * @return an error message extracted from the given ErrorCondition */ public static String extractErrorMessage(ErrorCondition errorCondition) { String message = "Received error from remote peer without description"; @@ -148,13 +147,13 @@ public static String extractErrorMessage(ErrorCondition errorCondition) { } /** - * When a redirect type exception is received this method is called to create the - * appropriate redirect exception type containing the error details needed. + * When a redirect type exception is received this method is called to create the appropriate redirect exception type + * containing the error details needed. * * @param error the Symbol that defines the redirection error type. * @param message the basic error message that should used or amended for the returned exception. * @param condition the ErrorCondition that describes the redirection. - * @return an Exception that captures the details of the redirection error. + * @return an Exception that captures the details of the redirection error */ public static Exception createRedirectException(Symbol error, String message, ErrorCondition condition) { Exception result = null; 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 f78e237830e..2f3d22f32dc 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 @@ -28,8 +28,7 @@ import java.lang.invoke.MethodHandles; /** - * Defines a context under which resources in a given session - * will operate inside transaction scoped boundaries. + * Defines a context under which resources in a given session will operate inside transaction scoped boundaries. */ public class AmqpTransactionContext { 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 7daf1773384..620f6cabc56 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 @@ -49,8 +49,8 @@ import java.lang.invoke.MethodHandles; /** - * Represents the AMQP Transaction coordinator link used by the transaction context - * of a session to control the lifetime of a given transaction. + * Represents the AMQP Transaction coordinator link used by the transaction context of a session to control the lifetime + * of a given transaction. */ public class AmqpTransactionCoordinator extends AmqpAbstractResource { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransferTagGenerator.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransferTagGenerator.java index 398762f6f9f..3f7b6a893f1 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransferTagGenerator.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpTransferTagGenerator.java @@ -22,8 +22,8 @@ import java.util.Set; /** - * Utility class that can generate and if enabled pool the binary tag values - * used to identify transfers over an AMQP link. + * Utility class that can generate and if enabled pool the binary tag values used to identify transfers over an AMQP + * link. */ public final class AmqpTransferTagGenerator { @@ -49,7 +49,7 @@ public AmqpTransferTagGenerator(boolean pool) { /** * Retrieves the next available tag. * - * @return a new or unused tag depending on the pool option. + * @return a new or unused tag depending on the pool option */ public byte[] getNextTag() { byte[] rc; @@ -64,8 +64,7 @@ public byte[] getNextTag() { } /** - * When used as a pooled cache of tags the unused tags should always be returned once - * the transfer has been settled. + * When used as a pooled cache of tags the unused tags should always be returned once the transfer has been settled. * * @param data a previously borrowed tag that is no longer in use. */ @@ -78,15 +77,15 @@ public void returnTag(byte[] data) { /** * Gets the current max pool size value. * - * @return the current max tag pool size. + * @return the current max tag pool size */ public int getMaxPoolSize() { return maxPoolSize; } /** - * Sets the max tag pool size. If the size is smaller than the current number - * of pooled tags the pool will drain over time until it matches the max. + * Sets the max tag pool size. If the size is smaller than the current number of pooled tags the pool will drain + * over time until it matches the max. * * @param maxPoolSize the maximum number of tags to hold in the pool. */ diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpValidator.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpValidator.java index 7c2fe8a692e..851d1319298 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpValidator.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/AmqpValidator.java @@ -25,8 +25,8 @@ import org.apache.qpid.proton.engine.Session; /** - * Abstract base for a validation hook that is used in tests to check - * the state of a remote resource after a variety of lifecycle events. + * Abstract base for a validation hook that is used in tests to check the state of a remote resource after a variety of + * lifecycle events. */ public class AmqpValidator { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/AbstractMechanism.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/AbstractMechanism.java index c2f9c21bdc8..90b6054195e 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/AbstractMechanism.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/AbstractMechanism.java @@ -20,8 +20,7 @@ import java.util.Map; /** - * Base class for SASL Authentication Mechanism that implements the basic - * methods of a Mechanism class. + * Base class for SASL Authentication Mechanism that implements the basic methods of a Mechanism class. */ public abstract class AbstractMechanism implements Mechanism { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/Mechanism.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/Mechanism.java index dbeb1335caa..88c67e10a29 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/Mechanism.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/Mechanism.java @@ -25,9 +25,8 @@ public interface Mechanism extends Comparable { /** - * Relative priority values used to arrange the found SASL - * mechanisms in a preferred order where the level of security - * generally defines the preference. + * Relative priority values used to arrange the found SASL mechanisms in a preferred order where the level of + * security generally defines the preference. */ enum PRIORITY { LOWEST(0), @@ -48,17 +47,17 @@ public int getValue() { } /** - * @return return the relative priority of this SASL mechanism. + * {@return return the relative priority of this SASL mechanism} */ int getPriority(); /** - * @return the well known name of this SASL mechanism. + * {@return the well known name of this SASL mechanism} */ String getName(); /** - * @return the response buffer used to answer the initial SASL cycle. + * {@return the response buffer used to answer the initial SASL cycle} * @throws SaslException if an error occurs computing the response. */ byte[] getInitialResponse() throws SaslException; @@ -67,38 +66,34 @@ public int getValue() { * Create a response based on a given challenge from the remote peer. * * @param challenge the challenge that this Mechanism should response to. - * @return the response that answers the given challenge. + * @return the response that answers the given challenge * @throws SaslException if an error occurs computing the response. */ byte[] getChallengeResponse(byte[] challenge) throws SaslException; /** - * Sets the user name value for this Mechanism. The Mechanism can ignore this - * value if it does not utilize user name in it's authentication processing. + * Sets the user name value for this Mechanism. The Mechanism can ignore this value if it does not utilize user name + * in it's authentication processing. * * @param username The user name given. */ void setUsername(String username); /** - * Returns the configured user name value for this Mechanism. - * - * @return the currently set user name value for this Mechanism. + * {@return the currently set user name value for this Mechanism} */ String getUsername(); /** - * Sets the password value for this Mechanism. The Mechanism can ignore this - * value if it does not utilize a password in it's authentication processing. + * Sets the password value for this Mechanism. The Mechanism can ignore this value if it does not utilize a password + * in it's authentication processing. * * @param password The password given. */ void setPassword(String password); /** - * Returns the configured password value for this Mechanism. - * - * @return the currently set password value for this Mechanism. + * {@return the currently set password value for this Mechanism} */ String getPassword(); @@ -110,9 +105,7 @@ public int getValue() { void setProperties(Map options); /** - * The currently set Properties for this Mechanism. - * - * @return the current set of configuration Properties for this Mechanism. + * {@return the current set of configuration Properties for this Mechanism} */ Map getProperties(); @@ -121,20 +114,17 @@ public int getValue() { * * @param username The user name that will be used with this mechanism * @param password The password that will be used with this mechanism - * @return true if the mechanism works with the provided credentials or not. + * @return true if the mechanism works with the provided credentials or not */ boolean isApplicable(String username, String password); /** - * Get the currently configured Authentication ID. - * - * @return the currently set Authentication ID. + * {@return the currently set Authentication ID} */ String getAuthzid(); /** - * Sets an Authentication ID that some mechanism can use during the - * challenge response phase. + * Sets an Authentication ID that some mechanism can use during the challenge response phase. * * @param authzid The Authentication ID to use. */ diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/PlainMechanism.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/PlainMechanism.java index f4e12a2a214..cbf0f9bdd37 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/PlainMechanism.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/sasl/PlainMechanism.java @@ -18,7 +18,7 @@ /** * Implements the SASL PLAIN authentication Mechanism. - * + *

                      * User name and Password values are sent without being encrypted. */ public class PlainMechanism extends AbstractMechanism { 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 63ce8fdb0f7..5faa44eb4c2 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 @@ -58,12 +58,9 @@ public SaslAuthenticator(Sasl sasl, String username, String password, String aut } /** - * Process the SASL authentication cycle until such time as an outcome is determine. This - * method must be called by the managing entity until the return value is true indicating a - * successful authentication or a JMSSecurityException is thrown indicating that the - * handshake failed. - * - * @throws SecurityException + * Process the SASL authentication cycle until such time as an outcome is determine. This method must be called by + * the managing entity until the return value is true indicating a successful authentication or a + * JMSSecurityException is thrown indicating that the handshake failed. */ public boolean authenticate() throws SecurityException { switch (sasl.getState()) { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/AsyncResult.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/AsyncResult.java index 53d2e67cd00..f6575a4a263 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/AsyncResult.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/AsyncResult.java @@ -22,25 +22,20 @@ public interface AsyncResult { /** - * If the operation fails this method is invoked with the Exception - * that caused the failure. + * If the operation fails this method is invoked with the Exception that caused the failure. * * @param result The error that resulted in this asynchronous operation failing. */ void onFailure(Throwable result); /** - * If the operation succeeds the resulting value produced is set to null and - * the waiting parties are signaled. + * If the operation succeeds the resulting value produced is set to null and the waiting parties are signaled. */ void onSuccess(); /** - * Returns true if the AsyncResult has completed. The task is considered complete - * regardless if it succeeded or failed. - * - * @return returns true if the asynchronous operation has completed. + * {@return {@code true} if the {@code AsyncResult} has completed. The task is considered complete regardless if it + * succeeded or failed} */ boolean isComplete(); - } diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/ClientFutureSynchronization.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/ClientFutureSynchronization.java index cf3f0228c10..e3eadb33b0a 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/ClientFutureSynchronization.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/ClientFutureSynchronization.java @@ -17,9 +17,8 @@ package org.apache.activemq.transport.amqp.client.util; /** - * Synchronization callback interface used to execute state updates - * or similar tasks in the thread context where the associated - * ProviderFuture is managed. + * Synchronization callback interface used to execute state updates or similar tasks in the thread context where the + * associated ProviderFuture is managed. */ public interface ClientFutureSynchronization { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/IOExceptionSupport.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/IOExceptionSupport.java index 2ba7f2ecb91..e525aecd1b2 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/IOExceptionSupport.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/IOExceptionSupport.java @@ -24,11 +24,11 @@ public class IOExceptionSupport { /** - * Checks the given cause to determine if it's already an IOException type and - * if not creates a new IOException to wrap it. + * Checks the given cause to determine if it's already an IOException type and if not creates a new IOException to + * wrap it. * * @param cause The initiating exception that should be cast or wrapped. - * @return an IOException instance. + * @return an IOException instance */ public static IOException create(Throwable cause) { if (cause instanceof IOException ioException) { 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 4d9cfc84a85..524be3354f9 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 @@ -116,8 +116,7 @@ public IdGenerator() { } /** - * As we have to find the host name as a side-affect of generating a unique stub, we allow - * it's easy retrieval here + * As we have to find the host name as a side-affect of generating a unique stub, we allow it's easy retrieval here * * @return the local host name */ @@ -126,9 +125,7 @@ public static String getHostName() { } /** - * Generate a unique id - * - * @return a unique id + * {@return a unique id} */ public synchronized String generateId() { StringBuilder sb = new StringBuilder(length); @@ -160,9 +157,7 @@ public static String sanitizeHostName(String hostName) { } /** - * Generate a unique ID - that is friendly for a URL or file system - * - * @return a unique id + * {@return a unique ID - that is friendly for a URL or file system} */ public String generateSanitizedId() { String result = generateId(); @@ -193,7 +188,7 @@ public static String getSeedFromId(String id) { * From a generated id - return the generator count * * @param id The ID that will be parsed for a sequence number. - * @return the sequence value parsed from the given ID. + * @return the sequence value parsed from the given ID */ public static long getSequenceFromId(String id) { long result = -1; @@ -213,7 +208,7 @@ public static long getSequenceFromId(String id) { * * @param id1 the lhs of the comparison. * @param id2 the rhs of the comparison. - * @return 0 if equal else a positive if {@literal id1 > id2} ... + * @return 0 if equal else a positive if {@literal id1 > id2} .. */ public static int compare(String id1, String id2) { int result = -1; @@ -231,18 +226,15 @@ public static int compare(String id1, String id2) { } /** - * When using the {@link java.net.InetAddress#getHostName()} method in an - * environment where neither a proper DNS lookup nor an /etc/hosts - * entry exists for a given host, the following exception will be thrown: - * - * java.net.UnknownHostException: <hostname>: <hostname> - * at java.net.InetAddress.getLocalHost(InetAddress.java:1425) - * ... - * - * Instead of just throwing an UnknownHostException and giving up, this - * method grabs a suitable hostname from the exception and prevents the - * exception from being thrown. If a suitable hostname cannot be acquired - * from the exception, only then is the UnknownHostException thrown. + * When using the {@link java.net.InetAddress#getHostName()} method in an environment where neither a proper DNS + * lookup nor an {@code /etc/hosts} entry exists for a given host, the following exception will be thrown: + *

                      {@code
                      +    * java.net.UnknownHostException: :  at
                      +    * java.net.InetAddress.getLocalHost(InetAddress.java:1425) ...
                      +    * }
                      + * Instead of just throwing an UnknownHostException and giving up, this method grabs a suitable hostname from the + * exception and prevents the exception from being thrown. If a suitable hostname cannot be acquired from the + * exception, only then is the {@code UnknownHostException} thrown. * * @return The hostname * @throws UnknownHostException if the given host cannot be looked up. diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/PropertyUtil.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/PropertyUtil.java index 9f1a24f3341..d3311668d7c 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/PropertyUtil.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/PropertyUtil.java @@ -45,8 +45,7 @@ public class PropertyUtil { * * @param originalURI The URI whose current parameters are removed and replaced with the given remainder value. * @param params The URI params that should be used to replace the current ones in the target. - * @return a new URI that matches the original one but has its query options replaced with - * the given ones. + * @return a new URI that matches the original one but has its query options replaced with the given ones. * @throws URISyntaxException if the given URI is invalid. */ public static URI replaceQuery(URI originalURI, Map params) throws URISyntaxException { @@ -62,7 +61,7 @@ public static URI replaceQuery(URI originalURI, Map params) thro * * @param uri The source URI whose existing query is replaced with the newly supplied one. * @param query The new URI query string that should be appended to the given URI. - * @return a new URI that is a combination of the original URI and the given query string. + * @return a new URI that is a combination of the original URI and the given query string * @throws URISyntaxException if the given URI is invalid. */ public static URI replaceQuery(URI uri, String query) throws URISyntaxException { @@ -86,7 +85,7 @@ public static URI replaceQuery(URI uri, String query) throws URISyntaxException * Creates a URI with the given query, removing an previous query value from the given URI. * * @param uri The source URI whose existing query is replaced with the newly supplied one. - * @return a new URI that is a combination of the original URI and the given query string. + * @return a new URI that is a combination of the original URI and the given query string * @throws URISyntaxException if the given URI is invalid. */ public static URI eraseQuery(URI uri) throws URISyntaxException { @@ -94,11 +93,11 @@ public static URI eraseQuery(URI uri) throws URISyntaxException { } /** - * Given a key / value mapping, create and return a URI formatted query string that is valid - * and can be appended to a URI. + * Given a key / value mapping, create and return a URI formatted query string that is valid and can be appended to a + * URI. * * @param options The Mapping that will create the new Query string. - * @return a URI formatted query string. + * @return a URI formatted query string */ public static String createQueryString(Map options) { if (!options.isEmpty()) { @@ -122,11 +121,11 @@ public static String createQueryString(Map options) { /** * Get properties from a URI and return them in a new {@code Map} instance. - * + *

                      * If the URI is null or the query string of the URI is null an empty Map is returned. * * @param uri the URI whose parameters are to be parsed. - * @return Map of properties + * @return {@code Map} of properties * @throws Exception if an error occurs while parsing the query options. */ public static Map parseParameters(URI uri) throws Exception { @@ -138,11 +137,10 @@ public static Map parseParameters(URI uri) throws Exception { } /** - * Parse properties from a named resource -eg. a URI or a simple name e.g. - * {@literal foo?name="fred"&size=2} + * Parse properties from a named resource -eg. a URI or a simple name e.g. {@literal foo?name="fred"&size=2} * * @param uri the URI whose parameters are to be parsed. - * @return Map of properties + * @return {@code Map} of properties * @throws Exception if an error occurs while parsing the query options. */ public static Map parseParameters(String uri) throws Exception { @@ -157,7 +155,7 @@ public static Map parseParameters(String uri) throws Exception { * Get properties from a URI query string. * * @param queryString the string value returned from a call to the URI class getQuery method. - * @return Map of properties from the parsed string. + * @return {@code Map} of properties from the parsed string */ public static Map parseQuery(String queryString) { if (queryString != null && !queryString.isEmpty()) { @@ -179,12 +177,12 @@ public static Map parseQuery(String queryString) { } /** - * Given a map of properties, filter out only those prefixed with the given value, the - * values filtered are returned in a new Map instance. + * Given a map of properties, filter out only those prefixed with the given value, the values filtered are returned + * in a new Map instance. * * @param properties The map of properties to filter. * @param optionPrefix The prefix value to use when filtering. - * @return a filter map with only values that match the given prefix. + * @return a filter map with only values that match the given prefix */ public static Map filterProperties(Map properties, String optionPrefix) { if (properties == null) { @@ -206,12 +204,12 @@ public static Map filterProperties(Map propertie } /** - * Enumerate the properties of the target object and add them as additional entries - * to the query string of the given string URI. + * Enumerate the properties of the target object and add them as additional entries to the query string of the given + * string URI. * * @param uri The string URI value to append the object properties to. * @param bean The Object whose properties will be added to the target URI. - * @return a new String value that is the original URI with the added bean properties. + * @return a new String value that is the original URI with the added bean properties * @throws Exception if an error occurs while enumerating the bean properties. */ public static String addPropertiesToURIFromBean(String uri, Object bean) throws Exception { @@ -220,12 +218,12 @@ public static String addPropertiesToURIFromBean(String uri, Object bean) throws } /** - * Enumerate the properties of the target object and add them as additional entries - * to the query string of the given URI. + * Enumerate the properties of the target object and add them as additional entries to the query string of the given + * URI. * * @param uri The URI value to append the object properties to. * @param properties The Object whose properties will be added to the target URI. - * @return a new String value that is the original URI with the added bean properties. + * @return a new String value that is the original URI with the added bean properties * @throws Exception if an error occurs while enumerating the bean properties. */ public static String addPropertiesToURI(URI uri, Map properties) throws Exception { @@ -237,7 +235,7 @@ public static String addPropertiesToURI(URI uri, Map properties) * * @param uri The string URI value to append the object properties to. * @param properties The properties that will be added to the target URI. - * @return a new String value that is the original URI with the added properties. + * @return a new String value that is the original URI with the added properties * @throws Exception if an error occurs while building the new URI string. */ public static String addPropertiesToURI(String uri, Map properties) throws Exception { @@ -267,12 +265,12 @@ public static String addPropertiesToURI(String uri, Map properti } /** - * Set properties on an object using the provided map. The return value - * indicates if all properties from the given map were set on the target object. + * Set properties on an object using the provided map. The return value indicates if all properties from the given + * map were set on the target object. * * @param target the object whose properties are to be set from the map options. * @param properties the properties that should be applied to the given object. - * @return true if all values in the properties map were applied to the target object. + * @return true if all values in the properties map were applied to the target object */ public static Map setProperties(Object target, Map properties) { if (target == null) { @@ -296,12 +294,12 @@ public static Map setProperties(Object target, Map setProperties(Object target, Properties properties) { if (target == null) { @@ -323,11 +321,10 @@ public static Map setProperties(Object target, Properties proper } /** - * Get properties from an object using reflection. If the passed object is null an - * empty Map is returned. + * Get properties from an object using reflection. If the passed object is null an empty {@code Map} is returned. * * @param object the Object whose properties are to be extracted. - * @return Map of properties extracted from the given object. + * @return {@code Map} of properties extracted from the given object * @throws Exception if an error occurs while examining the object's properties. */ public static Map getProperties(Object object) throws Exception { @@ -367,7 +364,7 @@ public static Map getProperties(Object object) throws Exception * * @param object the object to search. * @param name the property name to search for. - * @return the result of invoking the specific property get method. + * @return the result of invoking the specific property get method * @throws Exception if an error occurs while searching the object's bean info. */ public static Object getProperty(Object object, String name) throws Exception { @@ -386,14 +383,13 @@ public static Object getProperty(Object object, String name) throws Exception { /** * Set a property named property on a given Object. *

                      - * The object is searched for an set method that would match the given named - * property and if one is found. If necessary an attempt will be made to convert - * the new value to an acceptable type. + * The object is searched for an set method that would match the given named property and if one is found. If + * necessary an attempt will be made to convert the new value to an acceptable type. * * @param target The object whose property is to be set. * @param name The name of the property to set. * @param value The new value to set for the named property. - * @return true if the property was able to be set on the target object. + * @return true if the property was able to be set on the target object */ public static boolean setProperty(Object target, String name, Object value) { try { @@ -424,12 +420,12 @@ public static boolean setProperty(Object target, String name, Object value) { } /** - * Return a String minus the given prefix. If the string does not start - * with the given prefix the original string value is returned. + * Return a String minus the given prefix. If the string does not start with the given prefix the original string + * value is returned. * * @param value The String whose prefix is to be removed. * @param prefix The prefix string to remove from the target string. - * @return stripped version of the original input string. + * @return stripped version of the original input string */ public static String stripPrefix(String value, String prefix) { if (value != null && prefix != null && value.startsWith(prefix)) { @@ -439,12 +435,11 @@ public static String stripPrefix(String value, String prefix) { } /** - * Return a portion of a String value by looking beyond the given - * character. + * Return a portion of a String value by looking beyond the given character. * * @param value The string value to split * @param c The character that marks the split point. - * @return the sub-string value starting beyond the given character. + * @return the sub-string value starting beyond the given character */ public static String stripUpto(String value, char c) { String result = null; @@ -462,7 +457,7 @@ public static String stripUpto(String value, char c) { * * @param value The string value to split * @param c The character that marks the start of split point. - * @return the sub-string value starting from the given character. + * @return the sub-string value starting from the given character */ public static String stripBefore(String value, char c) { String result = value; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/StringArrayConverter.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/StringArrayConverter.java index d6a7c5bb026..826c923fa97 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/StringArrayConverter.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/StringArrayConverter.java @@ -21,10 +21,9 @@ import java.util.StringTokenizer; /** - * Class for converting to/from String[] to be used instead of a - * {@link java.beans.PropertyEditor} which otherwise causes memory leaks as the - * JDK {@link java.beans.PropertyEditorManager} is a static class and has strong - * references to classes, causing problems in hot-deployment environments. + * Class for converting to/from String[] to be used instead of a {@link java.beans.PropertyEditor} which otherwise + * causes memory leaks as the JDK {@link java.beans.PropertyEditorManager} is a static class and has strong references + * to classes, causing problems in hot-deployment environments. */ public class StringArrayConverter { diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/UnmodifiableProxy.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/UnmodifiableProxy.java index aa9f15e0d87..6b64a3b9117 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/UnmodifiableProxy.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/amqp/client/util/UnmodifiableProxy.java @@ -33,9 +33,8 @@ import org.apache.qpid.proton.engine.Transport; /** - * Utility that creates proxy objects for the Proton objects which won't allow any mutating - * operations to be applied so that the test code does not interact with the proton engine - * outside the client serialization thread. + * Utility that creates proxy objects for the Proton objects which won't allow any mutating operations to be applied so + * that the test code does not interact with the proton engine outside the client serialization thread. */ public final class UnmodifiableProxy { 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 dfe92800b99..234a46fa76d 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 @@ -78,10 +78,8 @@ public class NettyTcpTransport implements NettyTransport { /** * Create a new transport instance * - * @param remoteLocation - * the URI that defines the remote resource to connect to. - * @param options - * the transport options used to configure the socket connection. + * @param remoteLocation the URI that defines the remote resource to connect to. + * @param options the transport options used to configure the socket connection. */ public NettyTcpTransport(URI remoteLocation, NettyTransportOptions options) { this(null, remoteLocation, options); @@ -90,12 +88,9 @@ public NettyTcpTransport(URI remoteLocation, NettyTransportOptions options) { /** * Create a new transport instance * - * @param listener - * the TransportListener that will receive events from this Transport. - * @param remoteLocation - * the URI that defines the remote resource to connect to. - * @param options - * the transport options used to configure the socket connection. + * @param listener the TransportListener that will receive events from this Transport. + * @param remoteLocation the URI that defines the remote resource to connect to. + * @param options the transport options used to configure the socket connection. */ public NettyTcpTransport(NettyTransportListener listener, URI remoteLocation, NettyTransportOptions options) { if (options == null) { @@ -361,18 +356,14 @@ protected final void checkConnected() throws IOException { } } - /* - * Called when the transport has successfully connected and is ready for use. - */ + // Called when the transport has successfully connected and is ready for use. private void connectionEstablished(Channel connectedChannel) { channel = connectedChannel; connected.set(true); connectLatch.countDown(); } - /* - * Called when the transport connection failed and an error should be returned. - */ + // Called when the transport connection failed and an error should be returned. private void connectionFailed(Channel failedChannel, IOException cause) { failureCause = cause; channel = failedChannel; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportFactory.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportFactory.java index 5eab4041682..a89b3b911bf 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportFactory.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportFactory.java @@ -30,16 +30,12 @@ private NettyTransportFactory() { } /** - * Creates an instance of the given Transport and configures it using the properties set on - * the given remote broker URI. + * Creates an instance of the given Transport and configures it using the properties set on the given remote broker + * URI. * - * @param remoteURI - * The URI used to connect to a remote Peer. - * - * @return a new Transport instance. - * - * @throws Exception - * if an error occurs while creating the Transport instance. + * @param remoteURI The URI used to connect to a remote Peer. + * @return a new Transport instance + * @throws Exception if an error occurs while creating the Transport instance. */ public static NettyTransport createTransport(URI remoteURI) throws Exception { Map map = PropertyUtil.parseQuery(remoteURI.getQuery()); diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportListener.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportListener.java index 2921dc00c87..f779b84e31a 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportListener.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportListener.java @@ -19,16 +19,14 @@ import io.netty.buffer.ByteBuf; /** - * Listener interface that should be implemented by users of the various QpidJMS Transport - * classes. + * Listener interface that should be implemented by users of the various QpidJMS Transport classes. */ public interface NettyTransportListener { /** * Called when new incoming data has become available. * - * @param incoming - * the next incoming packet of data. + * @param incoming the next incoming packet of data. */ void onData(ByteBuf incoming); @@ -40,8 +38,7 @@ public interface NettyTransportListener { /** * Called when an error occurs during normal Transport operations. * - * @param cause - * the error that triggered this event. + * @param cause the error that triggered this event. */ void onTransportError(Throwable cause); diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportOptions.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportOptions.java index 4dda8898db8..026c49e44b9 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportOptions.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportOptions.java @@ -48,21 +48,18 @@ public class NettyTransportOptions implements Cloneable { private String wsSubProtocol = DEFAULT_WS_SUBPROTOCOL; /** - * @return the currently set send buffer size in bytes. + * {@return the currently set send buffer size in bytes} */ public int getSendBufferSize() { return sendBufferSize; } /** - * Sets the send buffer size in bytes, the value must be greater than zero or an - * {@link IllegalArgumentException} will be thrown. + * Sets the send buffer size in bytes, the value must be greater than zero or an {@link IllegalArgumentException} + * will be thrown. * - * @param sendBufferSize - * the new send buffer size for the TCP Transport. - * - * @throws IllegalArgumentException - * if the value given is not in the valid range. + * @param sendBufferSize the new send buffer size for the TCP Transport. + * @throws IllegalArgumentException if the value given is not in the valid range. */ public void setSendBufferSize(int sendBufferSize) { if (sendBufferSize <= 0) { @@ -73,21 +70,18 @@ public void setSendBufferSize(int sendBufferSize) { } /** - * @return the currently configured receive buffer size in bytes. + * {@return the currently configured receive buffer size in bytes} */ public int getReceiveBufferSize() { return receiveBufferSize; } /** - * Sets the receive buffer size in bytes, the value must be greater than zero or an - * {@link IllegalArgumentException} will be thrown. - * - * @param receiveBufferSize - * the new receive buffer size for the TCP Transport. + * Sets the receive buffer size in bytes, the value must be greater than zero or an {@link IllegalArgumentException} + * will be thrown. * - * @throws IllegalArgumentException - * if the value given is not in the valid range. + * @param receiveBufferSize the new receive buffer size for the TCP Transport. + * @throws IllegalArgumentException if the value given is not in the valid range. */ public void setReceiveBufferSize(int receiveBufferSize) { if (receiveBufferSize <= 0) { @@ -98,7 +92,7 @@ public void setReceiveBufferSize(int receiveBufferSize) { } /** - * @return the currently configured traffic class value. + * {@return the currently configured traffic class value} */ public int getTrafficClass() { return trafficClass; @@ -107,11 +101,8 @@ public int getTrafficClass() { /** * Sets the traffic class value used by the TCP connection, valid range is between 0 and 255. * - * @param trafficClass - * the new traffic class value. - * - * @throws IllegalArgumentException - * if the value given is not in the valid range. + * @param trafficClass the new traffic class value. + * @throws IllegalArgumentException if the value given is not in the valid range. */ public void setTrafficClass(int trafficClass) { if (trafficClass < 0 || trafficClass > 255) { @@ -170,7 +161,7 @@ public void setDefaultTcpPort(int defaultTcpPort) { } /** - * @return true if the transport should enable byte tracing + * {@return true if the transport should enable byte tracing} */ public boolean isTraceBytes() { return traceBytes; @@ -179,8 +170,7 @@ public boolean isTraceBytes() { /** * Determines if the transport should add a logger for bytes in / out * - * @param traceBytes - * should the transport log the bytes in and out. + * @param traceBytes should the transport log the bytes in and out. */ public void setTraceBytes(boolean traceBytes) { this.traceBytes = traceBytes; diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportSslOptions.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportSslOptions.java index c575bdacf83..425150e55b1 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportSslOptions.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/NettyTransportSslOptions.java @@ -21,8 +21,8 @@ import java.util.List; /** - * Holds the defined SSL options for connections that operate over a secure transport. Options - * are read from the environment and can be overridden by specifying them on the connection URI. + * Holds the defined SSL options for connections that operate over a secure transport. Options are read from the + * environment and can be overridden by specifying them on the connection URI. */ public class NettyTransportSslOptions extends NettyTransportOptions { @@ -58,115 +58,64 @@ public class NettyTransportSslOptions extends NettyTransportOptions { INSTANCE.setTrustStorePassword(System.getProperty("javax.net.ssl.keyStorePassword")); } - /** - * @return the keyStoreLocation currently configured. - */ public String getKeyStoreLocation() { return keyStoreLocation; } - /** - * Sets the location on disk of the key store to use. - * - * @param keyStoreLocation - * the keyStoreLocation to use to create the key manager. - */ public void setKeyStoreLocation(String keyStoreLocation) { this.keyStoreLocation = keyStoreLocation; } - /** - * @return the keyStorePassword - */ public String getKeyStorePassword() { return keyStorePassword; } - /** - * @param keyStorePassword - * the keyStorePassword to set - */ public void setKeyStorePassword(String keyStorePassword) { this.keyStorePassword = keyStorePassword; } - /** - * @return the trustStoreLocation - */ public String getTrustStoreLocation() { return trustStoreLocation; } - /** - * @param trustStoreLocation - * the trustStoreLocation to set - */ public void setTrustStoreLocation(String trustStoreLocation) { this.trustStoreLocation = trustStoreLocation; } - /** - * @return the trustStorePassword - */ public String getTrustStorePassword() { return trustStorePassword; } - /** - * @param trustStorePassword - * the trustStorePassword to set - */ public void setTrustStorePassword(String trustStorePassword) { this.trustStorePassword = trustStorePassword; } - /** - * @return the storeType - */ public String getStoreType() { return storeType; } - /** - * @param storeType - * the format that the store files are encoded in. - */ public void setStoreType(String storeType) { this.storeType = storeType; } - /** - * @return the enabledCipherSuites - */ public String[] getEnabledCipherSuites() { return enabledCipherSuites; } - /** - * @param enabledCipherSuites - * the enabledCipherSuites to set - */ public void setEnabledCipherSuites(String[] enabledCipherSuites) { this.enabledCipherSuites = enabledCipherSuites; } - /** - * @return the disabledCipherSuites - */ public String[] getDisabledCipherSuites() { return disabledCipherSuites; } - /** - * @param disabledCipherSuites - * the disabledCipherSuites to set - */ public void setDisabledCipherSuites(String[] disabledCipherSuites) { this.disabledCipherSuites = disabledCipherSuites; } /** - * @return the enabledProtocols or null if the defaults should be used + * {@return the enabledProtocols or null if the defaults should be used} */ public String[] getEnabledProtocols() { return enabledProtocols; @@ -175,16 +124,14 @@ public String[] getEnabledProtocols() { /** * The protocols to be set as enabled. * - * @param enabledProtocols - * the enabled protocols to set, or null if the defaults should be used. + * @param enabledProtocols the enabled protocols to set, or null if the defaults should be used. */ public void setEnabledProtocols(String[] enabledProtocols) { this.enabledProtocols = enabledProtocols; } /** - * - * @return the protocols to disable or null if none should be + * {@return the protocols to disable or null if none should be} */ public String[] getDisabledProtocols() { return disabledProtocols; @@ -193,72 +140,40 @@ public String[] getDisabledProtocols() { /** * The protocols to be disable. * - * @param disabledProtocols - * the protocols to disable, or null if none should be. + * @param disabledProtocols the protocols to disable, or null if none should be. */ public void setDisabledProtocols(String[] disabledProtocols) { this.disabledProtocols = disabledProtocols; } - /** - * @return the context protocol to use - */ public String getContextProtocol() { return contextProtocol; } - /** - * The protocol value to use when creating an SSLContext via - * SSLContext.getInstance(protocol). - * - * @param contextProtocol - * the context protocol to use. - */ public void setContextProtocol(String contextProtocol) { this.contextProtocol = contextProtocol; } - /** - * @return the trustAll - */ public boolean isTrustAll() { return trustAll; } - /** - * @param trustAll - * the trustAll to set - */ public void setTrustAll(boolean trustAll) { this.trustAll = trustAll; } - /** - * @return the verifyHost - */ public boolean isVerifyHost() { return verifyHost; } - /** - * @param verifyHost - * the verifyHost to set - */ public void setVerifyHost(boolean verifyHost) { this.verifyHost = verifyHost; } - /** - * @return the key alias - */ public String getKeyAlias() { return keyAlias; } - /** - * @param keyAlias - * the key alias to use - */ public void setKeyAlias(String keyAlias) { this.keyAlias = keyAlias; } 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 1fd9c6d79a1..52058855130 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 @@ -53,34 +53,23 @@ public class NettyTransportSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** - * Creates a Netty SslHandler instance for use in Transports that require an SSL encoder / - * decoder. + * Creates a Netty SslHandler instance for use in Transports that require an SSL encoder / decoder. * - * @param remote - * The URI of the remote peer that the SslHandler will be used against. - * @param options - * The SSL options object to build the SslHandler instance from. - * - * @return a new SslHandler that is configured from the given options. - * - * @throws Exception - * if an error occurs while creating the SslHandler instance. + * @param remote The URI of the remote peer that the SslHandler will be used against. + * @param options The SSL options object to build the SslHandler instance from. + * @return a new SslHandler that is configured from the given options + * @throws Exception if an error occurs while creating the SslHandler instance. */ public static SslHandler createSslHandler(URI remote, NettyTransportSslOptions options) throws Exception { return new SslHandler(createSslEngine(remote, createSslContext(options), options)); } /** - * Create a new SSLContext using the options specific in the given TransportSslOptions - * instance. - * - * @param options - * the configured options used to create the SSLContext. - * - * @return a new SSLContext instance. + * Create a new SSLContext using the options specific in the given TransportSslOptions instance. * - * @throws Exception - * if an error occurs while creating the context. + * @param options the configured options used to create the SSLContext. + * @return a new SSLContext instance + * @throws Exception if an error occurs while creating the context. */ public static SSLContext createSslContext(NettyTransportSslOptions options) throws Exception { try { @@ -100,39 +89,25 @@ public static SSLContext createSslContext(NettyTransportSslOptions options) thro } /** - * Create a new SSLEngine instance in client mode from the given SSLContext and - * TransportSslOptions instances. + * Create a new SSLEngine instance in client mode from the given SSLContext and TransportSslOptions instances. * - * @param context - * the SSLContext to use when creating the engine. - * @param options - * the TransportSslOptions to use to configure the new SSLEngine. - * - * @return a new SSLEngine instance in client mode. - * - * @throws Exception - * if an error occurs while creating the new SSLEngine. + * @param context the SSLContext to use when creating the engine. + * @param options the TransportSslOptions to use to configure the new SSLEngine. + * @return a new SSLEngine instance in client mode + * @throws Exception if an error occurs while creating the new SSLEngine. */ public static SSLEngine createSslEngine(SSLContext context, NettyTransportSslOptions options) throws Exception { return createSslEngine(null, context, options); } /** - * Create a new SSLEngine instance in client mode from the given SSLContext and - * TransportSslOptions instances. - * - * @param remote - * the URI of the remote peer that will be used to initialize the engine, may be null - * if none should. - * @param context - * the SSLContext to use when creating the engine. - * @param options - * the TransportSslOptions to use to configure the new SSLEngine. - * - * @return a new SSLEngine instance in client mode. + * Create a new SSLEngine instance in client mode from the given SSLContext and TransportSslOptions instances. * - * @throws Exception - * if an error occurs while creating the new SSLEngine. + * @param remote the URI of the remote peer that will be used to initialize the engine, may be null if none should. + * @param context the SSLContext to use when creating the engine. + * @param options the TransportSslOptions to use to configure the new SSLEngine. + * @return a new SSLEngine instance in client mode + * @throws Exception if an error occurs while creating the new SSLEngine. */ public static SSLEngine createSslEngine(URI remote, SSLContext context, NettyTransportSslOptions options) throws Exception { SSLEngine engine = null; 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 39a5c9fe754..fb65b6d9c94 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 @@ -57,10 +57,8 @@ public class NettyWSTransport extends NettyTcpTransport { /** * Create a new transport instance * - * @param remoteLocation - * the URI that defines the remote resource to connect to. - * @param options - * the transport options used to configure the socket connection. + * @param remoteLocation the URI that defines the remote resource to connect to. + * @param options the transport options used to configure the socket connection. */ public NettyWSTransport(URI remoteLocation, NettyTransportOptions options) { this(null, remoteLocation, options); @@ -69,12 +67,9 @@ public NettyWSTransport(URI remoteLocation, NettyTransportOptions options) { /** * Create a new transport instance * - * @param listener - * the TransportListener that will receive events from this Transport. - * @param remoteLocation - * the URI that defines the remote resource to connect to. - * @param options - * the transport options used to configure the socket connection. + * @param listener the TransportListener that will receive events from this Transport. + * @param remoteLocation the URI that defines the remote resource to connect to. + * @param options the transport options used to configure the socket connection. */ public NettyWSTransport(NettyTransportListener listener, URI remoteLocation, NettyTransportOptions options) { super(listener, remoteLocation, options); diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/X509AliasKeyManager.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/X509AliasKeyManager.java index 101b3489da6..dd986d3d0f0 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/X509AliasKeyManager.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/transport/netty/X509AliasKeyManager.java @@ -26,9 +26,8 @@ import java.security.cert.X509Certificate; /** - * An X509ExtendedKeyManager wrapper which always chooses and only - * returns the given alias, and defers retrieval to the delegate - * key manager. + * An X509ExtendedKeyManager wrapper which always chooses and only returns the given alias, and defers retrieval to the + * delegate key manager. */ public class X509AliasKeyManager extends X509ExtendedKeyManager { diff --git a/tests/compatibility-tests/src/main/java/org/apache/activemq/artemis/tests/compatibility/GroovyRun.java b/tests/compatibility-tests/src/main/java/org/apache/activemq/artemis/tests/compatibility/GroovyRun.java index b284490bf48..8a0de809878 100644 --- a/tests/compatibility-tests/src/main/java/org/apache/activemq/artemis/tests/compatibility/GroovyRun.java +++ b/tests/compatibility-tests/src/main/java/org/apache/activemq/artemis/tests/compatibility/GroovyRun.java @@ -85,20 +85,18 @@ private static void initShell() { } /** - * This can be called from the scripts as well. - * The scripts will use this method instead of its own groovy method. - * As a classloader operation needs to be done here. + * This can be called from the scripts as well. The scripts will use this method instead of its own groovy method. As + * a classloader operation needs to be done here. */ public static Object evaluate(String script, String[] arg) throws URISyntaxException, IOException { return evaluate(script, "arg", arg); } - /** - * This can be called from the scripts as well. - * The scripts will use this method instead of its own groovy method. - * As a classloader operation needs to be done here. - */ + /** + * This can be called from the scripts as well. The scripts will use this method instead of its own groovy method. As + * a classloader operation needs to be done here. + */ public static Object evaluate(String script, String argVariableName, String[] arg) throws URISyntaxException, IOException { diff --git a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HQClientTopologyTest.java b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HQClientTopologyTest.java index eed40e35ca5..62dd8871c23 100644 --- a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HQClientTopologyTest.java +++ b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HQClientTopologyTest.java @@ -34,8 +34,8 @@ import java.util.List; /** - * Runs Artemis server with HornetQ client and verifies that the client receives - * correct connector parameters (keys must be dash-delimited instead of camelCase). + * Runs Artemis server with HornetQ client and verifies that the client receives correct connector parameters (keys must + * be dash-delimited instead of camelCase). */ @ExtendWith(ParameterizedTestExtension.class) public class HQClientTopologyTest extends VersionedBase { diff --git a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HQFailoverTest.java b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HQFailoverTest.java index 11065849224..9f7f331b2c2 100644 --- a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HQFailoverTest.java +++ b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/HQFailoverTest.java @@ -44,8 +44,8 @@ import org.junit.jupiter.api.extension.ExtendWith; /** - * This test will run a hornetq server with artemis clients - * and it will make sure that failover happens without any problems. + * This test will run a hornetq server with artemis clients and it will make sure that failover happens without any + * problems. */ @ExtendWith(ParameterizedTestExtension.class) public class HQFailoverTest extends VersionedBase { diff --git a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java index 21e7bf22f4f..789cc72d22a 100644 --- a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java +++ b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/JournalCompatibilityTest.java @@ -131,8 +131,8 @@ public void testSendReceiveAMQPPaging() throws Throwable { } /** - * Test that the server starts properly using an old journal even though persistent size - * metrics were not originaly stored + * Test that the server starts properly using an old journal even though persistent size metrics were not originaly + * stored */ @TestTemplate public void testSendReceiveQueueMetrics() throws Throwable { @@ -149,9 +149,8 @@ public void testSendReceiveQueueMetrics() throws Throwable { } /** - * Test that the metrics are recovered when paging. Even though the paging counts won't - * be persisted the journal the server should still start properly. The persistent sizes - * will be recovered when the messages are depaged + * Test that the metrics are recovered when paging. Even though the paging counts won't be persisted the journal the + * server should still start properly. The persistent sizes will be recovered when the messages are depaged */ @TestTemplate public void testSendReceiveSizeQueueMetricsPaging() throws Throwable { diff --git a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/TestClassLoader.java b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/TestClassLoader.java index 7dcba349a5e..4a348b45788 100644 --- a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/TestClassLoader.java +++ b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/base/TestClassLoader.java @@ -21,9 +21,10 @@ import java.net.URLClassLoader; import java.net.URLStreamHandlerFactory; -/** The sole purpose of this class is to be a tag for eventually looking into MemoryDumps. - * When tests are failing, I need to identify the classloaders created by the testsuite. - * And this class would make it simpler for that purpose. */ +/** + * The sole purpose of this class is to be a tag for eventually looking into MemoryDumps. When tests are failing, I need + * to identify the classloaders created by the testsuite. And this class would make it simpler for that purpose. + */ public class TestClassLoader extends URLClassLoader { public TestClassLoader(URL[] urls, ClassLoader parent) { diff --git a/tests/db-tests/src/test/java/org/apache/activemq/artemis/tests/db/paging/PagingTest.java b/tests/db-tests/src/test/java/org/apache/activemq/artemis/tests/db/paging/PagingTest.java index 916766e8514..45e998a131e 100644 --- a/tests/db-tests/src/test/java/org/apache/activemq/artemis/tests/db/paging/PagingTest.java +++ b/tests/db-tests/src/test/java/org/apache/activemq/artemis/tests/db/paging/PagingTest.java @@ -1558,10 +1558,6 @@ public void testSimplePreparedAck() throws Exception { } } - /** - * @param queue - * @throws InterruptedException - */ private void forcePage(Queue queue) throws InterruptedException { for (long timeout = System.currentTimeMillis() + 5000; timeout > System.currentTimeMillis() && !queue.getPageSubscription().getPagingStore().isPaging(); ) { Thread.sleep(10); @@ -3061,14 +3057,12 @@ public void testDepageDuringTransaction() throws Exception { session.close(); } - /** + /* * - Make a destination in page mode * - Add stuff to a transaction * - Consume the entire destination (not in page mode any more) * - Add stuff to a transaction again * - Check order - *
                      - * Test under discussion at : http://community.jboss.org/thread/154061?tstart=0 */ @TestTemplate public void testDepageDuringTransaction2() throws Exception { @@ -5015,10 +5009,11 @@ public void write(int b) throws IOException { } /** - * When running this test from an IDE add this to the test command line so that the AssertionLoggerHandler works properly: - *

                      - * -Dlog4j2.configurationFile=file:/tests/config/log4j2-tests-config.properties - *

                      + * When running this test from an IDE add this to the test command line so that the {@link AssertionLoggerHandler} works + * properly: + *

                      +    * -Dlog4j2.configurationFile=file:${path-to-source}/tests/config/log4j2-tests-config.properties
                      +    * 
                      * Note: Idea should get these from the pom and you shouldn't need to do this. */ @TestTemplate @@ -5327,7 +5322,7 @@ public void testRouteOnTopWithMultipleQueues() throws Exception { server.stop(); } - // https://issues.jboss.org/browse/HORNETQ-1042 - spread messages because of filters + // spread messages because of filters public void testSpreadMessagesWithFilter(boolean deadConsumer) throws Exception { clearDataRecreateServerDirs(); @@ -5977,9 +5972,8 @@ class NonStoppablePagingStoreImpl extends PagingStoreImpl { } /** - * Normal stopping will cleanup non tx page subscription counter which will not trigger the bug. - * Here we override stop to simulate server crash. - * @throws Exception + * Normal stopping will cleanup non tx page subscription counter which will not trigger the bug. Here we + * override stop to simulate server crash. */ @Override public synchronized void stop() throws Exception { @@ -6277,7 +6271,7 @@ public void testStopPagingWithoutMsgsOnOneQueue() throws Exception { bb.put(getSamplebyte(j)); } - /** + /* * Here we first send messages and consume them to move every subscription to the next bookmarked page. * Then we send messages and consume them again, expecting paging is stopped normally. */ diff --git a/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/ValidateContainer.java b/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/ValidateContainer.java index 4c4eb769218..47d33652507 100644 --- a/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/ValidateContainer.java +++ b/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/brokerConnection/ValidateContainer.java @@ -22,10 +22,12 @@ import org.apache.activemq.artemis.tests.e2e.common.ContainerService; -/** The purpose of this class is to validate if the container and Docker (or an equivalent) is available on the environment. - * Tests can use an assume to be ignored in case the image is not available. - * The test will also cache the result by creating a file target/org.apache.activemq.artemis.tests.smoke.brokerConnection.ValidateContainer.ok - * So, we won't keep redoing the check during development on an IDE. */ +/** + * The purpose of this class is to validate if the container and Docker (or an equivalent) is available on the + * environment. Tests can use an assume to be ignored in case the image is not available. The test will also cache the + * result by creating a file target/org.apache.activemq.artemis.tests.smoke.brokerConnection.ValidateContainer.ok So, we + * won't keep redoing the check during development on an IDE. + */ public class ValidateContainer { private static final boolean hasContainer; @@ -57,7 +59,9 @@ public static boolean hasContainer() { return hasContainer; } - /** assume clause to validate the Artemis Container and the Container provider are available */ + /** + * assume clause to validate the Artemis Container and the Container provider are available + */ public static void assumeArtemisContainer() { assumeTrue(hasContainer(), "Please build the container using 'mvn install -De2e-tests.skipImageBuild=false' before running these tests"); } diff --git a/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/common/ContainerService.java b/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/common/ContainerService.java index ae82d62faa4..28b0e4f0a74 100644 --- a/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/common/ContainerService.java +++ b/tests/e2e-tests/src/test/java/org/apache/activemq/artemis/tests/e2e/common/ContainerService.java @@ -38,8 +38,8 @@ import org.testcontainers.utility.MountableFile; /** - * I am intentionally not depending directly into TestContainer - * I intend in a near future to support kubernetes and podman and I would like to keep an interface between our tests and the Container provider. + * I am intentionally not depending directly into TestContainer. I intend in a near future to support kubernetes and + * podman and I would like to keep an interface between our tests and the Container provider. */ public abstract class ContainerService { @@ -100,7 +100,9 @@ public static ContainerService getService() { public abstract void exposeHosts(Object container, String... hosts); - /** prepare the instance folder to run inside the docker image */ + /** + * prepare the instance folder to run inside the docker image + */ public abstract void prepareInstance(String home) throws Exception; public abstract String getHost(Object container); diff --git a/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/web/WebServerComponentTest.java b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/web/WebServerComponentTest.java index ca744335c43..9b470c8ae6d 100644 --- a/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/web/WebServerComponentTest.java +++ b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/web/WebServerComponentTest.java @@ -63,8 +63,8 @@ import org.junit.jupiter.api.Test; /** - * This test leaks a thread named org.eclipse.jetty.util.RolloverFileOutputStream which is why it is isolated now. - * In the future Jetty might fix this. + * This test leaks a thread named org.eclipse.jetty.util.RolloverFileOutputStream which is why it is isolated now. In + * the future Jetty might fix this. */ public class WebServerComponentTest { @@ -189,7 +189,8 @@ private void testLargeRequestHeader(boolean fail) throws Exception { assertEquals(fail, clientHandler.body.toString().contains("431")); } - /* It's not clear how to create a functional test for the response header size so this test simply ensures the + /* + * It's not clear how to create a functional test for the response header size so this test simply ensures the * configuration is passed through as expected. */ @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerTestAccessor.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerTestAccessor.java index f52dc0b0bd5..b0f213f3167 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerTestAccessor.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/core/paging/impl/PagingManagerTestAccessor.java @@ -19,7 +19,9 @@ import org.apache.activemq.artemis.core.paging.PagingManager; import org.apache.activemq.artemis.utils.SizeAwareMetric; -/** Use this class to access things that are meant on test only */ +/** + * Use this class to access things that are meant on test only + */ public class PagingManagerTestAccessor { public static void resetMaxSize(PagingManager pagingManager, long maxSize, long maxElements) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeTestAccessor.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeTestAccessor.java index 580d3aedb15..3d9110fa343 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeTestAccessor.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeTestAccessor.java @@ -21,8 +21,9 @@ import org.apache.activemq.artemis.core.server.MessageReference; -/** it will provide accessors for Bridge during testing. - * Do not use this outside of the context of UnitTesting. */ +/** + * Provide accessors for Bridge during testing. Do not use this outside of the context of UnitTesting. + */ public class BridgeTestAccessor { public static Map getRefs(BridgeImpl bridge) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/InVMCloseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/InVMCloseTest.java index a277e8271d0..67dbf16f47a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/InVMCloseTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/InVMCloseTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SimpleTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SimpleTest.java index 650dc1717b4..e392fd150e5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SimpleTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SimpleTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -51,35 +52,34 @@ public class SimpleTest extends ActiveMQTestBase { @Override @BeforeEach public void setUp() throws Exception { - /** - * Invoke org.apache.activemq.artemis.tests.util.ActiveMQTestBase's setUp() to bootstrap everything properly. - */ + // Invoke org.apache.activemq.artemis.tests.util.ActiveMQTestBase's setUp() to bootstrap everything properly. super.setUp(); - /** - * Create a configuration for an in-vm server. - * Use that configuration to instantiate a new server that doesn't use persistence, and then start it. - * Note that creating the server instance using this method ensures that the server will be cleaned up properly - * when the test is torn down. + /* + * Create a configuration for an in-vm server. Use that configuration to instantiate a new server that doesn't use + * persistence, and then start it. Note that creating the server instance using this method ensures that the + * server will be cleaned up properly when the test is torn down. */ server = createServer(false, createDefaultInVMConfig()); server.start(); - /** - * Create a ServerLocator for the in-vm server. Using this method instead of using, e.g. ActiveMQClient.createServerLocatorWithHA(..), - * ensures that the locator will be cleaned up properly when the test is torn down. + /* + * Create a ServerLocator for the in-vm server. Using this method instead of using, e.g. + * ActiveMQClient.createServerLocatorWithHA(..), ensures that the locator will be cleaned up properly when the + * test is torn down. */ locator = createInVMNonHALocator(); - /** - * Create a session factory from the server locator. Using this method instead of using, e.g. ServerLocator.createSessionFactory(), - * ensures that the factory will be cleaned up properly when the test is torn down. + /* + * Create a session factory from the server locator. Using this method instead of using, e.g. + * ServerLocator.createSessionFactory(), ensures that the factory will be cleaned up properly when the test is + * torn down. */ sf = createSessionFactory(locator); - /** - * Create a session from the factory. The call to create the session is surrounded with addClientSession to - * ensure the session will be cleaned up properly when the test is torn down. + /* + * Create a session from the factory. The call to create the session is surrounded with addClientSession to ensure + * the session will be cleaned up properly when the test is torn down. */ session = addClientSession(sf.createSession(false, true, true)); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SingleServerSimpleTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SingleServerSimpleTest.java index 38f47bdf098..efe520c02ca 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SingleServerSimpleTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/SingleServerSimpleTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -37,10 +38,9 @@ public class SingleServerSimpleTest extends SingleServerTestBase { /** * Because this class extends org.apache.activemq.artemis.tests.util.SingleServerTestBase and only uses a single - * instance of ActiveMQServer then no explicit setUp is required. The class simply needs tests which will use - * the server. + * instance of ActiveMQServer then no explicit setUp is required. The class simply needs tests which will use the + * server. */ - @Test public void simpleTest() throws Exception { final String data = "Simple Text " + UUID.randomUUID().toString(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/String64KLimitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/String64KLimitTest.java index b0c4f185754..c3d7d5307b2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/String64KLimitTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/String64KLimitTest.java @@ -38,11 +38,10 @@ import org.junit.jupiter.api.Test; /** - * There is a bug in JDK1.3, 1.4 whereby writeUTF fails if more than 64K bytes are written - * we need to work with all size of strings - * + * There is a bug in JDK1.3, 1.4 whereby writeUTF fails if more than 64K bytes are written we need to work with all size + * of strings + *

                      * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4806007 - * http://jira.jboss.com/jira/browse/JBAS-2641 */ public class String64KLimitTest extends ActiveMQTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressConfigTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressConfigTest.java index dce4bb49f46..ca2a8dde6c4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressConfigTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressConfigTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java index 100404f31ef..8cc32b136fd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java @@ -68,8 +68,8 @@ import static org.apache.activemq.transport.amqp.AmqpSupport.TEMP_TOPIC_CAPABILITY; /** - * Test support class for tests that will be using the AMQP Proton wrapper client. This is to - * make it easier to migrate tests from ActiveMQ5 + * Test support class for tests that will be using the AMQP Proton wrapper client. This is to make it easier to migrate + * tests from ActiveMQ5 */ public class AmqpClientTestSupport extends AmqpTestSupport { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDescribedTypePayloadTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDescribedTypePayloadTest.java index 06ab6ae6d00..75b94a2a855 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDescribedTypePayloadTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpDescribedTypePayloadTest.java @@ -44,8 +44,8 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; /** - * Test that the broker can pass through an AMQP message with a described type in the message - * body regardless of transformer in use. + * Test that the broker can pass through an AMQP message with a described type in the message body regardless of + * transformer in use. */ public class AmqpDescribedTypePayloadTest extends JMSClientTestSupport { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java index cf70a2bc616..7a11767ee52 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpExpiredMessageTest.java @@ -201,8 +201,10 @@ public void testRetryExpiry() throws Exception { Wait.assertEquals(0, dlqView::getMessageCount); } - /** This test is validating a broker feature where the message copy through the DLQ will receive an annotation. - * It is also testing filter on that annotation. */ + /** + * This test is validating a broker feature where the message copy through the DLQ will receive an annotation. It is + * also testing filter on that annotation. + */ @Test @Timeout(60) public void testExpiryThroughTTLValidateAnnotation() throws Exception { @@ -274,8 +276,10 @@ public void testExpiryThroughTTLValidateAnnotation() throws Exception { connection.close(); } - /** This test is validating a broker feature where the message copy through the DLQ will receive an annotation. - * It is also testing filter on that annotation. */ + /** + * This test is validating a broker feature where the message copy through the DLQ will receive an annotation. It is + * also testing filter on that annotation. + */ @Test @Timeout(60) public void testExpiryQpidJMS() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java index b5c2eccaff6..ac495c3d215 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFlowControlTest.java @@ -301,9 +301,7 @@ public void testTxIsRolledBackOnRejectedPreSettledMessage() throws Throwable { assertTrue(expectedException.getMessage().contains("Address is full: " + getQueueName())); } - /* - * Fills an address. Careful when using this method. Only use when rejected messages are switched on. - */ + // Fills an address. Careful when using this method. Only use when rejected messages are switched on. private void fillAddress(String address) throws Exception { AmqpClient client = createAmqpClient(); AmqpConnection connection = addConnection(client.connect()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java index d3a269d45c7..aa6b5b01e69 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpFullyQualifiedNameTest.java @@ -370,7 +370,6 @@ public void testQueue() throws Exception { /** * Broker should return exception if no address is passed in FQQN. - * @throws Exception */ @Test public void testQueueSpecial() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpManagementTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpManagementTest.java index d6dd0ab5fe6..5b94a0fed8f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpManagementTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpManagementTest.java @@ -89,7 +89,6 @@ public void testManagementQueryOverAMQP() throws Throwable { /** * Some clients use Unsigned types from org.apache.qpid.proton.amqp - * @throws Exception */ @Test @Timeout(60) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java index 176791bb0fa..302e7d1e404 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpMessageRoutingTest.java @@ -137,10 +137,8 @@ public void testMulticastMessageRoutingExclusivityUsingProperty() throws Excepti /** * If we have an address configured with both ANYCAST and MULTICAST routing types enabled, we must ensure that any - * messages sent specifically to MULTICAST (e.g. JMS TopicProducer) are only delivered to MULTICAST queues (e.g. - * i.e. subscription queues) and **NOT** to ANYCAST queues (e.g. JMS Queue). - * - * @throws Exception + * messages sent specifically to MULTICAST (e.g. JMS TopicProducer) are only delivered to MULTICAST queues (e.g. i.e. + * subscription queues) and **NOT** to ANYCAST queues (e.g. JMS Queue). */ @Test @Timeout(60) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionTest.java index 33c0109bc2b..4ab7fa4413b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpReceiverDispositionTest.java @@ -38,11 +38,10 @@ /** * Test various behaviors of AMQP receivers with the broker. - * - * See also {@link AmqpReceiverDispositionRejectAsUnmodifiedModeTests} for - * some testing of configurable alternative behaviour. + *

                      + * See also {@link AmqpReceiverDispositionRejectAsUnmodifiedModeTests} for some testing of configurable alternative + * behaviour. */ - public class AmqpReceiverDispositionTest extends AmqpClientTestSupport { private final int MIN_LARGE_MESSAGE_SIZE = 2048; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTargetedFQQNSecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTargetedFQQNSecurityTest.java index 15ba3edf865..2c64d288112 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTargetedFQQNSecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTargetedFQQNSecurityTest.java @@ -45,8 +45,8 @@ import static org.junit.jupiter.api.Assertions.fail; /** - * Test that AMQP senders and receivers can send to and receive from FQQN addresses when - * the broker security policy is configured to limit access to those resources. + * Test that AMQP senders and receivers can send to and receive from FQQN addresses when the broker security policy is + * configured to limit access to those resources. */ @Timeout(20) public class AmqpTargetedFQQNSecurityTest extends AmqpClientTestSupport { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTestSupport.java index ce5d29e4e99..9223c18dc17 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpTestSupport.java @@ -31,8 +31,7 @@ import org.junit.jupiter.api.AfterEach; /** - * Base test support class providing client support methods to aid in - * creating and configuration the AMQP test client. + * Base test support class providing client support methods to aid in creating and configuration the AMQP test client. */ public class AmqpTestSupport extends ActiveMQTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/DLQAfterExpiredMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/DLQAfterExpiredMessageTest.java index 2356c4a5c2e..95dc0fefb86 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/DLQAfterExpiredMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/DLQAfterExpiredMessageTest.java @@ -43,9 +43,8 @@ import org.junit.jupiter.api.Test; /** - * This is testing a double transfer (copy). - * First messages will expire, then DLQ. - * This will validate the data added to the queues. + * This is testing a double transfer (copy). First messages will expire, then DLQ. This will validate the data added to + * the queues. */ public class DLQAfterExpiredMessageTest extends AmqpClientTestSupport { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/PropertyParseOptimizationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/PropertyParseOptimizationTest.java index f2fdccdab95..bb5c9a5487f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/PropertyParseOptimizationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/PropertyParseOptimizationTest.java @@ -42,8 +42,8 @@ import org.junit.jupiter.api.Timeout; /** - * This test will validate if application properties are only parsed when there's a filter. - * You have to disable duplciate-detction to have this optimization working. + * This test will validate if application properties are only parsed when there's a filter. You have to disable + * duplciate-detction to have this optimization working. */ public class PropertyParseOptimizationTest extends AmqpClientTestSupport { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java index 09fae4bc779..57deec7d04a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java @@ -138,8 +138,7 @@ import org.slf4j.LoggerFactory; /** - * Tests for AMQP Broker federation handling of the receive from and send to address policy - * configuration handling. + * Tests for AMQP Broker federation handling of the receive from and send to address policy configuration handling. */ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java index 3e0d38e7eb5..cd22ac968d8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java @@ -130,8 +130,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; /** - * Tests for AMQP Broker federation handling of the receive from and send to queue policy - * configuration handling. + * Tests for AMQP Broker federation handling of the receive from and send to queue policy configuration handling. */ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPReplicaTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPReplicaTest.java index f95ddfa81d0..53b822c0f3b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPReplicaTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPReplicaTest.java @@ -412,9 +412,8 @@ private String getText(boolean large, int i) { /** * This test is validating that annotations sent to the original broker are not translated to the receiving side. - * Also annotations could eventually damage the body if the broker did not take that into consideration. - * So, this test is sending delivery annotations on messages. - * @throws Exception + * Also annotations could eventually damage the body if the broker did not take that into consideration. So, this + * test is sending delivery annotations on messages. */ @Test public void testLargeMessagesWithDeliveryAnnotations() throws Exception { @@ -483,9 +482,10 @@ public void testLargeMessagesWithDeliveryAnnotations() throws Exception { } } - - /** This is setting delivery annotations and sending messages with no address. - * The broker should know how to deal with the annotations and no address on the message. */ + /** + * This is setting delivery annotations and sending messages with no address. The broker should know how to deal with + * the annotations and no address on the message. + */ @Test public void testNoAddressWithAnnotations() throws Exception { server.setIdentity("targetServer"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AckManagerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AckManagerTest.java index 4a5ebe7edbb..650104fd77a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AckManagerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AckManagerTest.java @@ -5,16 +5,15 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.activemq.artemis.tests.integration.amqp.connect; import javax.jms.Connection; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/MirrorControllerBasicTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/MirrorControllerBasicTest.java index 6ca68b73915..2da9b50862a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/MirrorControllerBasicTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/MirrorControllerBasicTest.java @@ -89,9 +89,10 @@ public void testSend() throws Exception { connection.close(); } - - /** this test will take the Message generated from mirror controller and send it through PostOffice - * to validate the format of the message and its delivery */ + /** + * this test will take the Message generated from mirror controller and send it through PostOffice to validate the + * format of the message and its delivery + */ @Test public void testDirectSend() throws Exception { server.addAddressInfo(new AddressInfo("test").addRoutingType(RoutingType.ANYCAST)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/PagedMirrorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/PagedMirrorTest.java index 0ac69d9d7d7..80a0df585fb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/PagedMirrorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/PagedMirrorTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.amqp.connect; import javax.jms.Connection; 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 2863b8dc1ad..29d99f01ae8 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 @@ -52,7 +52,10 @@ 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. */ +/** + * 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(MethodHandles.lookup().lookupClass()); @@ -106,9 +109,10 @@ public void testWithMatchingDifferentNamesOnQueueKill() throws Exception { internalMultipleQueues(true, true, true, false, false); } - - /** On this test the max reconnect attemps is reached. after a reconnect I will force a stop on the broker connection and retry it. - * The reconnection should succeed. */ + /** + * On this test the max reconnect attemps is reached. after a reconnect I will force a stop on the broker connection + * and retry it. The reconnection should succeed. + */ @Test @Timeout(60) public void testWithMatchingDifferentNamesOnQueueKillMaxAttempts() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/SNFPagedMirrorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/SNFPagedMirrorTest.java index 533b0a4f273..c5db446bca0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/SNFPagedMirrorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/SNFPagedMirrorTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.amqp.connect; import javax.jms.Connection; 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 b63b70f4141..c95db15bb2d 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 @@ -68,8 +68,8 @@ import org.slf4j.LoggerFactory; /** - * This test will make sure the Broker Connection will react accordingly to a few - * misconfigs and possible errors on either side of the connection. + * This test will make sure the Broker Connection will react accordingly to a few misconfigs and possible errors on + * either side of the connection. */ public class ValidateAMQPErrorsTest extends AmqpClientTestSupport { @@ -83,8 +83,8 @@ protected ActiveMQServer createServer() throws Exception { } /** - * Connecting to itself should issue an error. - * and the max retry should still be counted, not just keep connecting forever. + * Connecting to itself should issue an error. and the max retry should still be counted, not just keep connecting + * forever. */ @Test @Timeout(30) @@ -393,8 +393,6 @@ public void testNoServerOfferedMirrorCapability() throws Exception { /** * Refuse the first mirror link, verify broker handles it and reconnects - * - * @throws Exception */ @Test @Timeout(30) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AmqpReplicatedTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AmqpReplicatedTestSupport.java index 68e2832a0f2..4eec0f1c8c0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AmqpReplicatedTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/largemessages/AmqpReplicatedTestSupport.java @@ -76,7 +76,8 @@ protected void createReplicatedConfigs() throws Exception { } /** - * Override this if is needed a different implementation of {@link NodeManager} to be used into {@link #createReplicatedConfigs()}. + * Override this if is needed a different implementation of {@link NodeManager} to be used into + * {@link #createReplicatedConfigs()}. */ protected NodeManager createReplicatedBackupNodeManager(Configuration backupConfig) { return new InVMNodeManager(true, backupConfig.getJournalLocation()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/sasl/SaslScramTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/sasl/SaslScramTest.java index e6d9b6e0e63..d52d8dd1220 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/sasl/SaslScramTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/sasl/SaslScramTest.java @@ -67,6 +67,7 @@ public void shutdownBroker() throws Exception { /** * Checks if a user with plain text password can login using all mechanisms + * * @throws JMSException should not happen */ @Test @@ -76,6 +77,7 @@ public void testUnencryptedWorksWithAllMechanism() throws JMSException { /** * Checks that a user that has encrypted passwords for all mechanism can login with any of them + * * @throws JMSException should not happen */ @Test @@ -85,6 +87,7 @@ public void testEncryptedWorksWithAllMechanism() throws JMSException { /** * Checks that a user that is only stored with one explicit mechanism can't use another mechanism + * * @throws JMSException is expected */ @Test @@ -95,8 +98,8 @@ public void testEncryptedWorksOnlyWithMechanism() throws JMSException { } /** - * Checks that a user that is only stored with one explicit mechanism can login with this - * mechanism + * Checks that a user that is only stored with one explicit mechanism can login with this mechanism + * * @throws JMSException should not happen */ @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java index dc1516f1c96..e2f0dc19814 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AckBatchSizeTest.java @@ -50,10 +50,7 @@ public class AckBatchSizeTest extends ActiveMQTestBase { /*ackbatchSize tests*/ - /* - * tests that wed don't acknowledge until the correct ackBatchSize is reached - * */ - + // tests that we don't acknowledge until the correct ackBatchSize is reached private int getMessageEncodeSize(final SimpleString address) throws Exception { ServerLocator locator = createInVMNonHALocator(); ClientSessionFactory cf = createSessionFactory(locator); @@ -106,9 +103,7 @@ public void testAckBatchSize() throws Exception { session.close(); } - /* - * tests that when the ackBatchSize is 0 we ack every message directly - * */ + // tests that when the ackBatchSize is 0 we ack every message directly @Test public void testAckBatchSizeZero() throws Exception { ActiveMQServer server = createServer(false); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java index 810eb506009..6bae17df3a7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java @@ -163,9 +163,9 @@ public void testAsyncConsumerAck() throws Exception { } /** - * This is validating a case where a consumer will try to ack a message right after failover, but the consumer at the target server didn't - * receive the message yet. - * on that case the system should rollback any acks done and redeliver any messages + * This is validating a case where a consumer will try to ack a message right after failover, but the consumer at the + * target server didn't receive the message yet. on that case the system should rollback any acks done and redeliver + * any messages */ @Test public void testInvalidACK() throws Exception { 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 7cfff030a2e..605c69e2aa4 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 @@ -39,9 +39,6 @@ import static org.junit.jupiter.api.Assertions.assertFalse; -/** - * From https://jira.jboss.org/jira/browse/HORNETQ-144 - */ public class ActiveMQCrashTest extends ActiveMQTestBase { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java index 478d48f196e..33c160222b4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutogroupIdTest.java @@ -52,8 +52,6 @@ public class AutogroupIdTest extends ActiveMQTestBase { private ServerLocator locator; - /* auto group id tests*/ - @Override @BeforeEach public void setUp() throws Exception { @@ -68,10 +66,9 @@ public void setUp() throws Exception { locator = createInVMNonHALocator(); } - /* - * tests when the autogroupid is set only 1 consumer (out of 2) gets all the messages from a single producer - * */ - + /** + * Tests when the autogroupid is set only 1 consumer (out of 2) gets all the messages from a single producer. + */ @Test public void testGroupIdAutomaticallySet() throws Exception { locator.setAutoGroup(true); @@ -108,9 +105,9 @@ public void testGroupIdAutomaticallySet() throws Exception { } - /* - * tests when the autogroupid is set only 2 consumers (out of 3) gets all the messages from 2 producers - * */ + /** + * Tests when the autogroupid is set only 2 consumers (out of 3) gets all the messages from 2 producers. + */ @Test public void testGroupIdAutomaticallySetMultipleProducers() throws Exception { locator.setAutoGroup(true); @@ -154,9 +151,9 @@ public void testGroupIdAutomaticallySetMultipleProducers() throws Exception { assertEquals(0, myMessageHandler3.messagesReceived); } - /* - * tests that even though we have a grouping round robin distributor we don't pin the consumer as autogroup is false - * */ + /** + * Tests that even though we have a grouping round robin distributor we don't pin the consumer as autogroup is false. + */ @Test public void testGroupIdAutomaticallyNotSet() throws Exception { ClientSessionFactory sf = createSessionFactory(locator); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java index e6142cb7e96..6e7ca5e6f5b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConcurrentCreateDeleteProduceTest.java @@ -36,10 +36,10 @@ import org.junit.jupiter.api.Test; /** - * The delete queue was resetting some fields on the Queue what would eventually turn a NPE. - * this test would eventually fail without the fix but it was a rare event as in most of the time - * the NPE happened during depaging what let the server to recover itself on the next depage. - * To verify a fix on this test against the previous version of QueueImpl look for NPEs on System.err + * The delete queue was resetting some fields on the Queue what would eventually turn a NPE. this test would eventually + * fail without the fix but it was a rare event as in most of the time the NPE happened during depaging what let the + * server to recover itself on the next depage. To verify a fix on this test against the previous version of QueueImpl + * look for NPEs on System.err */ public class ConcurrentCreateDeleteProduceTest extends ActiveMQTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConfirmationWindowTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConfirmationWindowTest.java index 82c8458fd1f..e9c304d37a1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConfirmationWindowTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConfirmationWindowTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.client; import java.lang.invoke.MethodHandles; @@ -69,7 +70,8 @@ public void testMissingResponse() throws Exception { server.createQueue(QueueConfiguration.of(queueName).setAddress(queueName).setRoutingType(RoutingType.ANYCAST)); - /* artificially prevent the broker from responding to the last commit from the client; this will simulate the + /* + * artificially prevent the broker from responding to the last commit from the client; this will simulate the * original error condition */ server.getRemotingService().addIncomingInterceptor(new Interceptor() { @@ -86,7 +88,8 @@ public boolean intercept(Packet packet, RemotingConnection connection) { } }); - /* slow down responses for message receipts at the end to help ensure they arrive at the client *after* it sends + /* + * slow down responses for message receipts at the end to help ensure they arrive at the client *after* it sends * the last commit packet and begins listening for the commit response; without the fix one of these message * receipt responses would be mistaken for the commit response */ diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java index a964198644c..d1b3ca7a590 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerCloseTest.java @@ -75,7 +75,6 @@ public void testCanNotUseAClosedConsumer() throws Exception { })); } - // https://jira.jboss.org/jira/browse/JBMESSAGING-1526 @Test public void testCloseWithManyMessagesInBufferAndSlowConsumer() throws Exception { ClientConsumer consumer = session.createConsumer(queue); 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 3eb6185cf9b..b2f69d16392 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 @@ -76,7 +76,6 @@ public void testLargeToken() throws Exception { token.append("a".repeat(5000)); token.append("'"); - // The server would fail to create this consumer if HORNETQ-545 wasn't solved consumer = session.createConsumer("foo", "animal=" + token.toString()); } @@ -271,10 +270,6 @@ public void testLinkedListOrder() throws Exception { locator.close(); } - /** - * @param consumer - * @throws Exception - */ private void readConsumer(String consumerName, ClientConsumer consumer) throws Exception { ClientMessage message = consumer.receive(5000); assertNotNull(message); @@ -282,11 +277,6 @@ private void readConsumer(String consumerName, ClientConsumer consumer) throws E message.acknowledge(); } - /** - * @param session - * @param producer - * @throws Exception - */ private void sendMessage(ClientSession session, ClientProducer producer, String color, String msg) throws Exception { ClientMessage anyMessage = session.createMessage(true); anyMessage.putStringProperty("color", color); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java index 0b9b89e4c4c..6bfceb33b60 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java @@ -833,7 +833,6 @@ public void testAcksWithSmallSendWindow() throws Exception { locator.close(); } - // https://jira.jboss.org/browse/HORNETQ-410 @TestTemplate public void testConsumeWithNoConsumerFlowControl() throws Exception { @@ -1029,7 +1028,6 @@ public void testReceiveAndResend() throws Exception { assertEquals(0, errors.get(), "Had errors along the execution"); } - // https://jira.jboss.org/jira/browse/HORNETQ-111 // Test that, on rollback credits are released for messages cleared in the buffer @TestTemplate public void testConsumerCreditsOnRollback() throws Exception { @@ -1077,7 +1075,6 @@ public void testConsumerCreditsOnRollback() throws Exception { session.close(); } - // https://jira.jboss.org/jira/browse/HORNETQ-111 // Test that, on rollback credits are released for messages cleared in the buffer @TestTemplate public void testInVMURI() throws Exception { @@ -1096,7 +1093,6 @@ public void testInVMURI() throws Exception { } - // https://jira.jboss.org/jira/browse/HORNETQ-111 // Test that, on rollback credits are released for messages cleared in the buffer @TestTemplate public void testConsumerCreditsOnRollbackLargeMessages() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java index b4b505c52f1..fdbd88ae95e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerWindowSizeTest.java @@ -99,7 +99,6 @@ private int getMessageEncodeSize(final SimpleString address) throws Exception { return encodeSize; } - // https://jira.jboss.org/jira/browse/HORNETQ-385 @Test public void testReceiveImmediateWithZeroWindow() throws Exception { ActiveMQServer server = createServer(false, isNetty()); @@ -152,7 +151,6 @@ public void testReceiveImmediateWithZeroWindow() throws Exception { } - // https://jira.jboss.org/jira/browse/HORNETQ-385 @Test public void testReceiveImmediateWithZeroWindow2() throws Exception { ActiveMQServer server = createServer(true); @@ -198,7 +196,6 @@ public void testReceiveImmediateWithZeroWindow2() throws Exception { } } - // https://jira.jboss.org/jira/browse/HORNETQ-385 @Test public void testReceiveImmediateWithZeroWindow3() throws Exception { ActiveMQServer server = createServer(false, isNetty()); @@ -433,11 +430,11 @@ public void testSingleImmediate() throws Exception { assertEquals(NUMBER_OF_MESSAGES, received.get()); } - /* - * tests send window size. we do this by having 2 receivers on the q. since we roundrobin the consumer for delivery we - * know if consumer 1 has received n messages then consumer 2 must have also have received n messages or at least up - * to its window size - * */ + /** + * tests send window size. we do this by having 2 receivers on the q. since we roundrobin the consumer for delivery + * we know if consumer 1 has received n messages then consumer 2 must have also have received n messages or at least + * up to its window size + */ @Test public void testSendWindowSize() throws Exception { ActiveMQServer messagingService = createServer(false, isNetty()); @@ -884,9 +881,6 @@ public void testSaveBuffersOnLargeMessage() throws Exception { class FakeOutputStream extends OutputStream { - /* (non-Javadoc) - * @see java.io.OutputStream#write(int) - */ @Override public void write(int b) throws IOException { } @@ -1039,9 +1033,6 @@ class LocalHandler implements MessageHandler { int count = 0; - /* (non-Javadoc) - * @see MessageHandler#onMessage(ClientMessage) - */ @Override public synchronized void onMessage(final ClientMessage message) { try { @@ -1179,9 +1170,6 @@ class LocalHandler implements MessageHandler { int count = 0; - /* (non-Javadoc) - * @see MessageHandler#onMessage(ClientMessage) - */ @Override public synchronized void onMessage(final ClientMessage message) { try { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java index 11ee691ca20..510f12c5443 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ExpiryLargeMessageTest.java @@ -351,8 +351,6 @@ public void testExpiryMessagesAMQP(boolean restartBefore, int bodySize) throws E /** * Tests if the system would still couple with old data where the LargeMessage was linked to its previous copy - * - * @throws Exception */ @Test public void testCompatilityWithLinks() throws Exception { 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 f59c470d981..b4fe5c0e7c8 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 @@ -60,9 +60,7 @@ public void setUp() throws Exception { cf2 = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY)); } - // https://jira.jboss.org/jira/browse/JBMESSAGING-1702 - // Test that two failures concurrently executing and calling the same exception listener - // don't deadlock + // Test that two failures concurrently executing and calling the same exception listener don't deadlock @Test public void testDeadlock() throws Exception { for (int i = 0; i < 100; i++) { 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 f92db35012e..5d46be42189 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 @@ -69,9 +69,6 @@ protected boolean usePersistence() { return false; } - /** - * LoadProducer - */ class LoadProducer extends Thread { private final ConnectionFactory cf; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java index 946071de45e..46901169b7e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java @@ -85,9 +85,8 @@ import org.slf4j.LoggerFactory; /** - * This test will simulate a consumer hanging on the delivery packet due to unbehaved clients - * and it will make sure we can still perform certain operations on the queue such as produce - * and verify the counters + * This test will simulate a consumer hanging on the delivery packet due to unbehaved clients and it will make sure we + * can still perform certain operations on the queue such as produce and verify the counters */ public class HangConsumerTest extends ActiveMQTestBase { @@ -182,31 +181,20 @@ public void testHangOnDelivery() throws Exception { } } - /** - * - */ protected void releaseConsumers() { callbackSemaphore.release(); } - /** - * @throws InterruptedException - */ protected void awaitBlocking() throws InterruptedException { assertTrue(this.inCall.await(5000)); } - /** - * @throws InterruptedException - */ protected void blockConsumers() throws InterruptedException { this.callbackSemaphore.acquire(); } /** * This would recreate the scenario where a queue was duplicated - * - * @throws Exception */ @Test public void testHangDuplicateQueues() throws Exception { @@ -214,15 +202,6 @@ public void testHangDuplicateQueues() throws Exception { final CountDownLatch latchDelete = new CountDownLatch(1); class MyQueueWithBlocking extends QueueImpl { - /** - * @param queueConfiguration - * @param pageSubscription - * @param scheduledExecutor - * @param postOffice - * @param storageManager - * @param addressSettingsRepository - * @param executor - */ MyQueueWithBlocking(final QueueConfiguration queueConfiguration, final Filter filter, final PagingStore pagingStore, @@ -334,10 +313,8 @@ public Queue createQueueWith(final QueueConfiguration config, PagingManager pagi } /** - * This would force a journal duplication on bindings even with the scenario that generated fixed, - * the server shouldn't hold of from starting - * - * @throws Exception + * This would force a journal duplication on bindings even with the scenario that generated fixed, the server + * shouldn't hold of from starting */ @Test public void testForceDuplicationOnBindings() throws Exception { @@ -419,9 +396,8 @@ public void testExceptionWhileDelivering() throws Exception { } /** - * This will simulate what would happen with topic creationg where a single record is supposed to be created on the journal - * - * @throws Exception + * This will simulate what would happen with topic creationg where a single record is supposed to be created on the + * journal */ @Test public void testDuplicateDestinationsOnTopic() throws Exception { @@ -481,9 +457,6 @@ public boolean hasCredits(ServerConsumer consumerID) { this.targetCallback = parameter; } - /* (non-Javadoc) - * @see SessionCallback#sendProducerCreditsMessage(int, SimpleString) - */ @Override public void sendProducerCreditsMessage(int credits, SimpleString address) { targetCallback.sendProducerCreditsMessage(credits, address); @@ -496,7 +469,6 @@ public boolean updateDeliveryCountAfterCancel(ServerConsumer consumer, MessageRe @Override public void browserFinished(ServerConsumer consumer) { - } @Override @@ -506,7 +478,6 @@ public boolean isWritable(ReadyListener callback, Object protocolContext) { @Override public void afterDelivery() throws Exception { - } @Override @@ -514,9 +485,6 @@ public void sendProducerCreditsFailMessage(int credits, SimpleString address) { targetCallback.sendProducerCreditsFailMessage(credits, address); } - /* (non-Javadoc) - * @see SessionCallback#sendJmsMessage(org.apache.activemq.artemis.core.server.ServerMessage, long, int) - */ @Override public int sendMessage(MessageReference ref, ServerConsumer consumer, int deliveryCount) { inCall.countDown(); @@ -535,9 +503,6 @@ public int sendMessage(MessageReference ref, ServerConsumer consumer, int delive } } - /* (non-Javadoc) - * @see SessionCallback#sendLargeMessage(org.apache.activemq.artemis.core.server.ServerMessage, long, long, int) - */ @Override public int sendLargeMessage(MessageReference ref, ServerConsumer consumer, @@ -546,9 +511,6 @@ public int sendLargeMessage(MessageReference ref, return targetCallback.sendLargeMessage(ref, consumer, bodySize, deliveryCount); } - /* (non-Javadoc) - * @see SessionCallback#sendLargeMessageContinuation(long, byte[], boolean, boolean) - */ @Override public int sendLargeMessageContinuation(ServerConsumer consumer, byte[] body, @@ -557,9 +519,6 @@ public int sendLargeMessageContinuation(ServerConsumer consumer, return targetCallback.sendLargeMessageContinuation(consumer, body, continues, requiresResponse); } - /* (non-Javadoc) - * @see SessionCallback#closed() - */ @Override public void closed() { targetCallback.closed(); @@ -568,7 +527,6 @@ public void closed() { @Override public void disconnect(ServerConsumer consumerId, String errorMessage) { } - } class MyActiveMQServer extends ActiveMQServerImpl { 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 38aad4cacbc..3a85696678e 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 @@ -199,14 +199,14 @@ private boolean doTestClientVersionCompatibilityWithRealConnection(String verLis try { serverProcess.destroy(); } catch (Throwable t) { - /* ignore */ + // ignore } } if (client != null) { try { client.destroy(); } catch (Throwable t) { - /* ignore */ + // ignore } } } 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 3a67c750499..38ba9a93977 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 @@ -562,13 +562,9 @@ public Queue createQueueWith(QueueConfiguration config, PagingManager pagingMana return new NoPostACKQueue(config, filter, pageSubscription != null ? pageSubscription.getPagingStore() : null, pageSubscription, scheduledExecutor, postOffice, storageManager, addressSettingsRepository, execFactory.getExecutor(), server, this); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.server.QueueFactory#setPostOffice(org.apache.activemq.artemis.core.postoffice.PostOffice) - */ @Override public void setPostOffice(PostOffice postOffice) { } - } ClientSession session = null; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java index 8025ab66e66..093910c53ca 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSPagingFileDeleteTest.java @@ -87,11 +87,6 @@ public void setUp() throws Exception { server.getAddressSettingsRepository().addMatch("#", setting); } - /** - * Test replicating issue JBPAPP-9603 - * - * @throws Exception - */ @Test public void testTopicsWithNonDurableSubscription() throws Exception { connection = null; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java index 9bd9eb177fb..2ed9eac4984 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java @@ -51,29 +51,22 @@ import org.junit.jupiter.api.Test; /** - * -- https://issues.jboss.org/browse/HORNETQ-746 - * Stress test using netty with NIO and many JMS clients concurrently, to try - * and induce a deadlock. - *
                      - * A large number of JMS clients are started concurrently. Some produce to queue - * 1 over one connection, others consume from queue 1 and produce to queue 2 - * over a second connection, and others consume from queue 2 over a third + * Stress test using netty with NIO and many JMS clients concurrently, to try and induce a deadlock. + *

                      + * A large number of JMS clients are started concurrently. Some produce to queue 1 over one connection, others consume + * from queue 1 and produce to queue 2 over a second connection, and others consume from queue 2 over a third * connection. - *
                      - * Each operation is done in a JMS transaction, sending/consuming one message - * per transaction. - *
                      - * The server is set up with netty, with only one NIO worker and 1 activemq - * server worker. This increases the chance for the deadlock to occur. - *
                      - * If the deadlock occurs, all threads will block/die. A simple transaction - * counting strategy is used to verify that the count has reached the expected - * value. + *

                      + * Each operation is done in a JMS transaction, sending/consuming one message per transaction. + *

                      + * The server is set up with netty, with only one NIO worker and 1 activemq server worker. This increases the chance for + * the deadlock to occur. + *

                      + * If the deadlock occurs, all threads will block/die. A simple transaction counting strategy is used to verify that the + * count has reached the expected value. */ public class JmsNettyNioStressTest extends ActiveMQTestBase { - - // Remove this method to re-enable those tests @Test public void testStressSendNetty() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java index 0e20e5638b4..f294a53d894 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java @@ -135,10 +135,6 @@ public void testRestartJournal() throws Throwable { } } - /** - * @throws Exception - * @throws InterruptedException - */ private void runExternalProcess(final String tempDir, final int start, final int end) throws Exception { Process process = SpawnedVMSupport.spawnVM(this.getClass().getCanonicalName(), "-Xms128m", "-Xmx128m", new String[]{}, true, true, tempDir, Integer.toString(start), Integer.toString(end)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java index 1081273ed4c..8fece2427e5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageCompressTest.java @@ -687,9 +687,8 @@ private void assertCompressionSize(byte[] data, int min, int max) { /** * Generate compressible data. *

                      - * Based on "SDGen: Mimicking Datasets for Content Generation in Storage - * Benchmarks" by Raúl Gracia-Tinedo et al. (https://www.usenix.org/node/188461) - * and https://github.com/jibsen/lzdatagen + * Based on "SDGen: Mimicking Datasets for Content Generation in Storage Benchmarks" by Raúl Gracia-Tinedo et al. + * (https://www.usenix.org/node/188461) and https://github.com/jibsen/lzdatagen */ public static class DeflateGenerator { 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 c6a16456758..830e827fc35 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 @@ -1360,10 +1360,6 @@ public void internalTestCachedResendMessage(final long messageSize) throws Excep } } - /** - * @param messageSize - * @param msg - */ private void compareString(final long messageSize, ClientMessage msg) { assertNotNull(msg); for (long i = 0; i < messageSize; i++) { @@ -2067,7 +2063,6 @@ public void testReceiveMultipleMessages() throws Exception { } } - // JBPAPP-6237 @TestTemplate public void testPageOnLargeMessageMultipleQueues() throws Exception { @@ -2204,7 +2199,6 @@ public void testPageOnLargeMessageMultipleQueues() throws Exception { assertFalse(loggerHandler.findText("AMQ214034")); } - // JBPAPP-6237 @TestTemplate public void testPageOnLargeMessageMultipleQueues2() throws Exception { Configuration config = createDefaultConfig(isNetty()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java index 97386104015..9a8ffea7e10 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LibaioDependencyCheckTest.java @@ -23,9 +23,8 @@ import org.junit.jupiter.api.Test; /** - * This tests is placed in duplication here to validate that the libaio module is properly loaded on this - * test module. - * + * This tests is placed in duplication here to validate that the libaio module is properly loaded on this test module. + *

                      * This test should be placed on each one of the tests modules to make sure the library is loaded correctly. */ public class LibaioDependencyCheckTest extends ActiveMQTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageBufferTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageBufferTest.java index f2fa48e7830..e92e675f00b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageBufferTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageBufferTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.client; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java index 127db822646..810bf2818aa 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageConsumerRollbackTest.java @@ -135,11 +135,6 @@ public void testRollbackMultipleConsumers() throws Exception { } - /** - * @param numberOfMessages - * @param session - * @throws Exception - */ private void sendMessages(int numberOfMessages, ClientSession session) throws Exception { ClientProducer producer = session.createProducer(inQueue); 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 5f3f4e3b5dd..dcc038bfcb0 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 @@ -84,10 +84,9 @@ public void testMessagePriority() throws Exception { } /** - * in this tests, the session is started and the consumer created *before* the messages are sent. - * each message which is sent will be received by the consumer in its buffer and the priority won't be taken - * into account. - * We need to implement client-side message priority to handle this case: https://jira.jboss.org/jira/browse/JBMESSAGING-1560 + * In this tests, the session is started and the consumer created *before* the messages are sent. each message which + * is sent will be received by the consumer in its buffer and the priority won't be taken into account. We need to + * implement client-side message priority to handle this case. */ @Test public void testMessagePriorityWithClientSidePrioritization() throws Exception { @@ -193,7 +192,6 @@ public void testMessageOrderWithSamePriority() throws Exception { } - // https://jira.jboss.org/jira/browse/HORNETQ-275 @Test public void testOutOfOrderAcknowledgement() throws Exception { SimpleString queue = RandomUtil.randomUUIDSimpleString(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java index 232024b091c..056c4dad9ed 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleThreadFilterOneTest.java @@ -40,8 +40,8 @@ import static org.junit.jupiter.api.Assertions.assertNull; /** - * Multiple Threads producing Messages, with Multiple Consumers with different queues, each queue with a different filter - * This is similar to MultipleThreadFilterTwoTest but it uses multiple queues + * Multiple Threads producing Messages, with Multiple Consumers with different queues, each queue with a different + * filter This is similar to MultipleThreadFilterTwoTest but it uses multiple queues */ public class MultipleThreadFilterOneTest extends ActiveMQTestBase { @@ -97,9 +97,6 @@ public void run() { } } - /** - * @throws ActiveMQException - */ private void sendMessages(int msgs) throws ActiveMQException { ClientProducer producer = prodSession.createProducer(ADDRESS); @@ -171,9 +168,6 @@ public void run() { } } - /** - * - */ public void close() { try { consumerSession.close(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveImmediateTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveImmediateTest.java index 924387b44fc..79a2566d29b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveImmediateTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ReceiveImmediateTest.java @@ -109,7 +109,6 @@ public void testConsumerReceiveImmediateWithSessionStop() throws Exception { session.close(); } - // https://jira.jboss.org/browse/HORNETQ-450 @Test public void testReceivedImmediateFollowedByReceive() throws Exception { locator.setBlockOnNonDurableSend(true); @@ -142,7 +141,6 @@ public void testReceivedImmediateFollowedByReceive() throws Exception { session.close(); } - // https://jira.jboss.org/browse/HORNETQ-450 @Test public void testReceivedImmediateFollowedByAsyncConsume() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java index 8b26e875a9c..3087fca1fbe 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RedeliveryConsumerTest.java @@ -401,10 +401,6 @@ public void run() { - /** - * @param persistDeliveryCountBeforeDelivery - * @throws Exception - */ private void setUp(final boolean persistDeliveryCountBeforeDelivery) throws Exception { Configuration config = createDefaultInVMConfig().setPersistDeliveryCountBeforeDelivery(persistDeliveryCountBeforeDelivery); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java index bdfc7019416..0e783e2db46 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionCloseOnGCTest.java @@ -43,8 +43,8 @@ public void setUp() throws Exception { } /** - * Make sure Sessions are not leaking after closed.. - * Also... we want to make sure the SessionFactory will close itself when there are not references into it + * Make sure Sessions are not leaking after closed. Also... we want to make sure the SessionFactory will close itself + * when there are not references into it */ @Test public void testValidateFactoryGC1() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionFactoryCloseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionFactoryCloseTest.java index 856c50ba17b..237c89f9be2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionFactoryCloseTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionFactoryCloseTest.java @@ -52,10 +52,9 @@ public void testCloseSessionFactory() throws Exception { sf.addFailoverListener(eventType -> { if (eventType == FailoverEventType.FAILURE_DETECTED) { try { - /** - * We close client session factory during this period and - * expect reconnection stopped without exception which notifies - * FAILOVER_FAILED event. See ARTEMIS-1949. + /* + * We close client session factory during this period and expect reconnection stopped without exception + * which notifies FAILOVER_FAILED event. See ARTEMIS-1949. */ Thread.sleep(1000L); } catch (InterruptedException e) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java index 8f894903b0c..8ec925f8c65 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java @@ -155,7 +155,7 @@ public void testCloseSessionOnDestroyedConnection() throws Exception { } else { clientSession.createQueue(QueueConfiguration.of(queueName).setDurable(false)); } - /** keep unused variables in order to maintain references to both objects */ + // keep unused variables in order to maintain references to both objects @SuppressWarnings("unused") ClientProducer producer = clientSession.createProducer(); @SuppressWarnings("unused") 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 f6ecc3109db..6990cb1129a 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 @@ -687,13 +687,10 @@ public void testKilledOnNoMessagesSoCanBeRebalanced() throws Exception { } /** - * This test creates 3 consumers on one queue. A producer sends - * messages at a rate of 2 messages per second. Each consumer - * consumes messages at rate of 1 message per second. The slow - * consumer threshold is 1 message per second. - * Based on the above settings, slow consumer removal will not - * be performed (2 < 3*1), so no consumer will be removed during the - * test, and all messages will be received. + * This test creates 3 consumers on one queue. A producer sends messages at a rate of 2 messages per second. Each + * consumer consumes messages at rate of 1 message per second. The slow consumer threshold is 1 message per second. + * Based on the above settings, slow consumer removal will not be performed (2 < 3*1), so no consumer will be removed + * during the test, and all messages will be received. */ @Test public void testMultipleConsumersOneQueue() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionDurabilityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionDurabilityTest.java index 43629acda70..8216ee8553c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionDurabilityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TransactionDurabilityTest.java @@ -45,8 +45,6 @@ public class TransactionDurabilityTest extends ActiveMQTestBase { * R1 then rolls back, and the server is restarted - unfortunately since the delete record was written R1 is not ready to be consumed again. * * It's therefore crucial the messages aren't deleted from storage until AFTER any ack records are committed to storage. - * - * */ @Test public void testRolledBackAcknowledgeWithSameMessageAckedByOtherSession() throws Exception { 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 faba156c612..822f53a6603 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 @@ -44,8 +44,8 @@ import org.slf4j.LoggerFactory; /** - * A test that makes sure that an ActiveMQ Artemis server cleans up the associated - * resources when one of its client crashes. + * A test that makes sure that an ActiveMQ Artemis server cleans up the associated resources when one of its client + * crashes. */ public class ClientCrashTest extends ClientTestBase { 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 b4142423ba6..6b5a457e977 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 @@ -36,11 +36,10 @@ import org.slf4j.LoggerFactory; /** - * A test that makes sure that an ActiveMQ Artemis client gracefully exists after the last session is - * closed. Test for http://jira.jboss.org/jira/browse/JBMESSAGING-417. - * - * This is not technically a crash test, but it uses the same type of topology as the crash tests - * (local server, remote VM client). + * A test that makes sure that an ActiveMQ Artemis client gracefully exists after the last session is closed. + *

                      + * This is not technically a crash test, but it uses the same type of topology as the crash tests (local server, remote + * VM client). */ public class ClientExitTest extends ClientTestBase { @@ -74,7 +73,7 @@ public void testGracefulClientExit() throws Exception { assertEquals(0, p.exitValue()); - // FIXME https://jira.jboss.org/jira/browse/JBMESSAGING-1421 + // FIXME // Thread.sleep(1000); // // // the local session @@ -83,7 +82,7 @@ public void testGracefulClientExit() throws Exception { session.close(); - // FIXME https://jira.jboss.org/jira/browse/JBMESSAGING-1421 + // FIXME // Thread.sleep(1000); // assertActiveConnections(0); // // assertActiveSession(0); 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 e241cf5b9bd..b8e9ccc230c 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 @@ -144,9 +144,6 @@ protected boolean isNetty() { return false; } - /** - * @return - */ private String getConnector() { if (isNetty()) { return NETTY_CONNECTOR_FACTORY; @@ -156,8 +153,6 @@ private String getConnector() { /** * Backups must successfully deploy its bridges on fail-over. - * - * @see https://bugzilla.redhat.com/show_bug.cgi?id=900764 */ @TestTemplate public void testFailoverDeploysBridge() throws Exception { @@ -660,9 +655,6 @@ private void testShutdownServerCleanlyAndReconnectSameNode(final boolean sleep) assertNoMoreConnections(); } - /** - * @throws Exception - */ private void closeServers() throws Exception { if (session0 != null) session0.close(); 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 2b78a1132ee..181e6809db7 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 @@ -596,9 +596,6 @@ public void testBridgeClientID() throws Exception { assertEquals(1, array.size(), "number of connections returned from query"); } - /** - * @param server1Params - */ private void addTargetParameters(final Map server1Params) { if (isNetty()) { server1Params.put("port", org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants.DEFAULT_PORT + 1); @@ -607,9 +604,6 @@ private void addTargetParameters(final Map server1Params) { } } - /** - * @param message - */ private void readLargeMessages(final ClientMessage message, int kiloBlocks) { byte[] byteRead = new byte[1024]; @@ -775,7 +769,6 @@ public void internalTestWithFilter(final boolean largeMessage, final boolean use } - // Created to verify JBPAPP-6057 @TestTemplate public void testStartLater() throws Exception { Map server0Params = new HashMap<>(); @@ -2375,9 +2368,7 @@ private void testPendingAcksEventuallyArrive(boolean stop, boolean large) throws /** * It will inspect the journal directly and determine if there are queues on this journal, * - * @param serverToInvestigate * @return a Map containing the reference counts per queue - * @throws Exception */ protected Map loadQueues(ActiveMQServer serverToInvestigate) throws Exception { SequentialFileFactory messagesFF = new NIOSequentialFileFactory(serverToInvestigate.getConfiguration().getJournalLocation(), 1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java index 204bdb862a5..62e1a9fb967 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java @@ -223,9 +223,6 @@ public void testStartStop() throws Exception { } - /** - * @return - */ private String getConnector() { if (isNetty()) { return NettyConnectorFactory.class.getName(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/ClusteredBridgeReconnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/ClusteredBridgeReconnectTest.java index 9b6798ec4f5..529ea1b6c9a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/ClusteredBridgeReconnectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/ClusteredBridgeReconnectTest.java @@ -57,11 +57,9 @@ import org.junit.jupiter.api.Test; /** - * This will simulate a failure of a failure. - * The bridge could eventually during a race or multiple failures not be able to reconnect because it failed again. - * this should make the bridge to always reconnect itself. + * This will simulate a failure of a failure. The bridge could eventually during a race or multiple failures not be able + * to reconnect because it failed again. this should make the bridge to always reconnect itself. */ - public class ClusteredBridgeReconnectTest extends ClusterTestBase { @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/NettyBridgeReconnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/NettyBridgeReconnectTest.java index 970b5ebfd7a..3a619059a4c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/NettyBridgeReconnectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/NettyBridgeReconnectTest.java @@ -115,9 +115,6 @@ protected boolean isNetty() { return true; } - /** - * @return - */ private String getConnector() { return NETTY_CONNECTOR_FACTORY; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/LargeHeadersClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/LargeHeadersClusterTest.java index d1c8669974b..2877a944aaf 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/LargeHeadersClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/LargeHeadersClusterTest.java @@ -275,11 +275,6 @@ protected void stopServers() throws Exception { clearServer(0, 1); } - /** - * @param serverID - * @return - * @throws Exception - */ @Override protected ConfigurationImpl createBasicConfig(final int serverID) { ConfigurationImpl configuration = super.createBasicConfig(serverID); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/ProtocolsMessageLoadBalancingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/ProtocolsMessageLoadBalancingTest.java index ee838e0b732..0fa85343a07 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/ProtocolsMessageLoadBalancingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/crossprotocol/ProtocolsMessageLoadBalancingTest.java @@ -515,11 +515,6 @@ protected void stopServers() throws Exception { clearServer(0, 1); } - /** - * @param serverID - * @return - * @throws Exception - */ @Override protected ConfigurationImpl createBasicConfig(final int serverID) { ConfigurationImpl configuration = super.createBasicConfig(serverID); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AnycastRoutingWithClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AnycastRoutingWithClusterTest.java index abc1a07fe3f..4bc8a2cbe88 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AnycastRoutingWithClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AnycastRoutingWithClusterTest.java @@ -30,9 +30,8 @@ public class AnycastRoutingWithClusterTest extends ClusterTestBase { /** - * Test anycast address with single distributed queue in a 3 node cluster environment. Messages should be - * "round robin"'d across the each queue - * @throws Exception + * Test anycast address with single distributed queue in a 3 node cluster environment. Messages should be "round + * robin"'d across the each queue */ @Test public void testAnycastAddressOneQueueRoutingMultiNode() throws Exception { @@ -85,7 +84,6 @@ public void testAnycastAddressOneQueueRoutingMultiNode() throws Exception { /** * Test anycast address with N queues in a 3 node cluster environment. Messages should be "round robin"'d across the * each queue. - * @throws Exception */ @Test public void testAnycastAddressMultiQueuesRoutingMultiNode() throws Exception { @@ -138,7 +136,6 @@ public void testAnycastAddressMultiQueuesRoutingMultiNode() throws Exception { /** * Test anycast address with N queues in a 3 node cluster environment. Messages should be "round robin"'d across the * each queue. - * @throws Exception */ @Test public void testAnycastAddressMultiQueuesWithFilterRoutingMultiNode() throws Exception { @@ -198,7 +195,6 @@ public void testAnycastAddressMultiQueuesWithFilterRoutingMultiNode() throws Exc /** * Test multicast address that with N queues in a 3 node cluster environment. Each queue should receive all messages * sent from the client. - * @throws Exception */ @Test public void testMulitcastAddressMultiQueuesRoutingMultiNode() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteClusteredDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteClusteredDestinationTest.java index d9512345806..c0976a760f4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteClusteredDestinationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/AutoDeleteClusteredDestinationTest.java @@ -1,18 +1,20 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *

                      - * http://www.apache.org/licenses/LICENSE-2.0 - *

                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.apache.activemq.artemis.tests.integration.cluster.distribution; 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 1aaf845d776..24e1ff5a850 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 @@ -52,11 +52,6 @@ public void setUp() throws Exception { start(); } - /** - * @param serverID - * @return - * @throws Exception - */ @Override protected ConfigurationImpl createBasicConfig(final int serverID) { ConfigurationImpl configuration = super.createBasicConfig(serverID); @@ -112,9 +107,7 @@ public void testAutoDelete() throws Exception { onMessageReceived.countDown(); }); - /* - * sending a message to broker1 - */ + // sending a message to broker1 { final CountDownLatch onMessageSent = new CountDownLatch(1); 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 7b75d579f38..0e1f5522ecc 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 @@ -193,9 +193,6 @@ protected HAType haType() { return HAType.SharedNothingReplication; } - /** - * Whether the servers share the storage or not. - */ protected final boolean isSharedStore() { return HAType.SharedStore.equals(haType()); } @@ -1250,9 +1247,6 @@ protected void verifyReceiveRoundRobinInSomeOrder(final boolean ack, } } - /** - * @param message - */ protected void checkMessageBody(ClientMessage message) { if (isLargeMessage()) { for (int posMsg = 0; posMsg < getLargeMessageSize(); posMsg++) { @@ -1520,19 +1514,12 @@ private HAPolicyConfiguration haPolicyPrimaryConfiguration(HAType haType) { } /** - * Server lacks a {@link ClusterConnectionConfiguration} necessary for the remote (replicating) - * backup case. - *
                      + * Server lacks a {@link ClusterConnectionConfiguration} necessary for the remote (replicating) backup case. + *

                      * Use - * {@link #setupClusterConnectionWithBackups(String, String, org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType, int, boolean, int, int[])} - * to add it. - * - * @param node - * @param primaryNode - * @param fileStorage - * @param haType - * @param netty - * @throws Exception + * {@link #setupClusterConnectionWithBackups(String, String, + * org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType, int, boolean, int, int[])} to add + * it. */ protected void setupBackupServer(final int node, final int primaryNode, 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 6505da4af34..d54b3bb8c2b 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 @@ -263,7 +263,8 @@ public void testGroupingSimple() throws Exception { } /** - * This is the same test as testGroupingSimple() just with the "address" removed from the cluster-connection and grouping-handler + * This is the same test as testGroupingSimple() just with the "address" removed from the cluster-connection and + * grouping-handler */ @Test public void testGroupingSimpleWithNoAddress() throws Exception { 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 358a0296df7..b4b8e8bfefa 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 @@ -95,7 +95,6 @@ protected void setSessionFactoryCreateLocator(int node, boolean ha, TransportCon } - //https://issues.jboss.org/browse/HORNETQ-1061 @Test public void testRedistributionWithMessageGroups() throws Exception { setupCluster(MessageLoadBalancingType.ON_DEMAND); @@ -261,7 +260,6 @@ public void testRedistributionWithMultipleQueuesOnTheSameAddress() throws Except Wait.assertEquals(0L, () -> servers[1].locateQueue(QUEUE0).getMessageCount(), 2000, 100); } - //https://issues.jboss.org/browse/HORNETQ-1057 @Test public void testRedistributionStopsWhenConsumerAdded() throws Exception { setupCluster(MessageLoadBalancingType.ON_DEMAND); @@ -1219,7 +1217,6 @@ public void testBackAndForth() throws Exception { } - // https://issues.jboss.org/browse/HORNETQ-1072 @Test public void testBackAndForth2WithDuplicDetection() throws Exception { internalTestBackAndForth2(true); @@ -1455,9 +1452,8 @@ public void testRedistributionNumberOfMessagesGreaterThanBatchSize() throws Exce } /* - * Start one node with no consumers and send some messages - * Start another node add a consumer and verify all messages are redistribute - * https://jira.jboss.org/jira/browse/HORNETQ-359 + * Start one node with no consumers and send some messages. Start another node add a consumer and verify all messages + * are redistributed. */ @Test public void testRedistributionWhenNewNodeIsAddedWithConsumer() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionWithDiscoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionWithDiscoveryTest.java index 73f2c17c555..aec60236cd8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionWithDiscoveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionWithDiscoveryTest.java @@ -60,10 +60,6 @@ protected void setupCluster(final MessageLoadBalancingType messageLoadBalancingT } } - /** - * @param messageLoadBalancingType - * @throws Exception - */ protected void setServer(final MessageLoadBalancingType messageLoadBalancingType, int server) throws Exception { setupPrimaryServerWithDiscovery(server, groupAddress, groupPort, isFileStorage(), isNetty(), false); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettySymmetricClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettySymmetricClusterTest.java index a45d8dace62..b1746198c3c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettySymmetricClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/NettySymmetricClusterTest.java @@ -73,10 +73,11 @@ public void testConnectionLoadBalancingUsingInitialConnectors() throws Exception clientSessionFactories[i] = addSessionFactory(locator.createSessionFactory()); } - /** - * Since we are only using the initial connectors to load-balance then all the connections should be on the first 2 nodes. - * Note: This still uses the load-balancing-policy so this would changed if we used the random one instead of the default - * round-robin one. + /* + * Since we are only using the initial connectors to load-balance then all the connections should be on the first + * 2 nodes. + * Note: This still uses the load-balancing-policy so this would changed if we used the random one instead of the + * default round-robin one. */ assertEquals(CONNECTION_COUNT / 2, (servers[0].getActiveMQServerControl().getConnectionCount() - baseline[0])); assertEquals(CONNECTION_COUNT / 2, (servers[1].getActiveMQServerControl().getConnectionCount() - baseline[1])); 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 8663ae25386..8ed2718fee4 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 @@ -57,9 +57,7 @@ protected boolean isNetty() { return false; } - /* - * make sure source can shutdown if target is never started - */ + // make sure source can shutdown if target is never started @Test public void testNeverStartTargetStartSourceThenStopSource() throws Exception { startServers(0); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/RemoteBindingWithoutLoadBalancingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/RemoteBindingWithoutLoadBalancingTest.java index 63686d4809d..357b474f191 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/RemoteBindingWithoutLoadBalancingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/RemoteBindingWithoutLoadBalancingTest.java @@ -46,9 +46,8 @@ protected boolean isNetty() { } /** - * It's possible that when a cluster has disabled message load balancing then a message - * sent to a node that only has a corresponding remote queue binding will trigger a - * stack overflow. + * It's possible that when a cluster has disabled message load balancing then a message sent to a node that only has + * a corresponding remote queue binding will trigger a stack overflow. */ @Test public void testStackOverflow() throws Exception { 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 86c77e51036..5181233883a 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 @@ -35,7 +35,7 @@ /** * A SymmetricClusterTest - * + *

                      * Most of the cases are covered in OneWayTwoNodeClusterTest - we don't duplicate them all here */ public class SymmetricClusterTest extends ClusterTestBase { @@ -1787,12 +1787,13 @@ public void testStopSuccessiveServers() throws Exception { waitForBindings(4, "queues.testaddress", 0, 0, false); } - @Test /** * This test verifies that addresses matching a simple string filter such as 'jms' result in bindings being created * on appropriate nodes in the cluster. It also verifies that addresses not matching the simple string filter do not * result in bindings being created. - */ public void testClusterAddressCreatesBindingsForSimpleStringAddressFilters() throws Exception { + */ + @Test + public void testClusterAddressCreatesBindingsForSimpleStringAddressFilters() throws Exception { setupCluster("test", "test", "test", "test", "test"); startServers(); @@ -1827,11 +1828,12 @@ public void testStopSuccessiveServers() throws Exception { waitForBindings(4, "foo.queues.test.1", 0, 0, false); } - @Test /** * This test verifies that a string exclude filter '!jms.eu.uk' results in bindings not being created for this * address for nodes in a cluster. But ensures that other addresses are matched and bindings created. - */ public void testClusterAddressDoesNotCreatesBindingsForStringExcludesAddressFilters() throws Exception { + */ + @Test + public void testClusterAddressDoesNotCreatesBindingsForStringExcludesAddressFilters() throws Exception { setupCluster("jms.eu.de,!jms.eu.uk", "jms.eu.de,!jms.eu.uk", "jms.eu.de,!jms.eu.uk", "jms.eu.de,!jms.eu.uk", "jms.eu.de,!jms.eu.uk"); startServers(); @@ -1869,8 +1871,6 @@ public void testStopSuccessiveServers() throws Exception { /** * This test verifies that remote bindings are only created for queues that match jms.eu or jms.us excluding * jms.eu.uk and jms.us.bos. Represented by the address filter 'jms.eu,!jms.eu.uk,jms.us,!jms.us.bos' - * - * @throws Exception */ @Test public void testClusterAddressFiltersExcludesAndIncludesAddressesInList() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryJMSQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryJMSQueueClusterTest.java index df1543bf049..1822d3d8a5a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryJMSQueueClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryJMSQueueClusterTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.cluster.distribution; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryQueueClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryQueueClusterTest.java index 502c57fd418..515b7b315b9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryQueueClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/TemporaryQueueClusterTest.java @@ -41,10 +41,7 @@ protected boolean isNetty() { } /** - * https://jira.jboss.org/jira/browse/HORNETQ-286 - * - * the test checks that the temp queue is properly propagated to the cluster - * (assuming we wait for the bindings) + * the test checks that the temp queue is properly propagated to the cluster (assuming we wait for the bindings) */ @Test public void testSendToTempQueueFromAnotherClusterNode() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/URISimpleClusterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/URISimpleClusterTest.java index 9c9398bd9d8..a1e95c7e040 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/URISimpleClusterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/URISimpleClusterTest.java @@ -22,7 +22,7 @@ /** * A SymmetricClusterTest - * + *

                      * Most of the cases are covered in OneWayTwoNodeClusterTest - we don't duplicate them all here */ public class URISimpleClusterTest extends ClusterTestBase { 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 2ecd104d7de..fff88df66e8 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 @@ -44,7 +44,7 @@ /** * A MultiThreadFailoverTest - *
                      + *

                      * Test Failover where failure is prompted by another thread */ public class AsynchronousFailoverTest extends FailoverTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncJournalTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncJournalTest.java index 0ae372fb78e..61fe649b92f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncJournalTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncJournalTest.java @@ -218,11 +218,6 @@ protected void finishSyncAndFailover() throws Exception { assertNodeIdWasSaved(); } - /** - * @throws java.io.FileNotFoundException - * @throws java.io.IOException - * @throws InterruptedException - */ private void assertNodeIdWasSaved() throws Exception { assertTrue(backupServer.getServer().waitForActivation(5, TimeUnit.SECONDS), "backup initialized"); @@ -261,8 +256,6 @@ public void testMessageSyncSimple() throws Exception { /** * Basic fail-back test. - * - * @throws Exception */ @Test public void testFailBack() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java index 15051155fbb..ad3640a18f3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncLargeMessageTest.java @@ -82,9 +82,6 @@ public void testDeleteLargeMessages() throws Exception { assertEquals(target, getAllMessageFileIds(dir).size(), "we really ought to delete these after delivery"); } - /** - * @throws Exception - */ @Test public void testDeleteLargeMessagesDuringSync() throws Exception { setNumberOfMessages(200); @@ -111,11 +108,9 @@ public void testDeleteLargeMessagesDuringSync() throws Exception { } /** - * LargeMessages are passed from the client to the server in chunks. Here we test the backup - * starting the data synchronization with the primary in the middle of a multiple chunks large - * message upload from the client to the primary server. - * - * @throws Exception + * LargeMessages are passed from the client to the server in chunks. Here we test the backup starting the data + * synchronization with the primary in the middle of a multiple chunks large message upload from the client to the + * primary server. */ @Test public void testBackupStartsWhenPrimaryIsReceivingLargeMessage() throws Exception { 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 a961d3dd360..893aab6d194 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 @@ -71,9 +71,8 @@ protected void failNode(final int node) throws Exception { } /** - * @param node The node which we should fail + * @param node The node which we should fail * @param originalPrimaryNode The number of the original node, to locate session to fail - * @throws Exception */ protected void failNode(final int node, final int originalPrimaryNode) throws Exception { logger.debug("*** failing node {}", node); 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 47f7925da33..fb5cdb6f003 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 @@ -120,10 +120,6 @@ public void testAutoFailback() throws Exception { wrapUpSessionFactory(); } - /** - * @throws Exception - * @throws Exception - */ private void verifyMessageOnServer(final int server, final int numberOfMessages) throws Exception { ServerLocator backupLocator = createInVMLocator(server); ClientSessionFactory factorybkp = addSessionFactory(createSessionFactory(backupLocator)); @@ -199,8 +195,6 @@ public void testAutoFailbackThenFailover() throws Exception { /** * Basic fail-back test. - * - * @throws Exception */ @Test public void testFailBack() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java index aaf1be0c66e..425810b31eb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java @@ -123,11 +123,6 @@ protected TransportConfiguration getConnectorTransportConfiguration(final boolea return TransportConfigurationUtils.getInVMConnector(live); } - /** - * @param i - * @param message - * @throws Exception - */ @Override protected void setBody(final int i, final ClientMessage message) { message.getBodyBuffer().writeString("message" + i); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java index 56e6861c27a..db9b977ec69 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java @@ -61,10 +61,8 @@ public void setUp() throws Exception { } /** - * Test if two servers are running and one of them is failing, that we trigger the expected - * events for {@link FailoverEventListener} - * - * @throws Exception + * Test if two servers are running and one of them is failing, that we trigger the expected events for + * {@link FailoverEventListener} */ @Test public void testFailoverListenerCall() throws Exception { @@ -122,9 +120,6 @@ public void testFailoverListenerCall() throws Exception { assertEquals(4, listener.getFailoverEventType().size(), "Expected 4 FailoverEvents to be triggered"); } - /** - * @throws Exception - */ private void verifyMessageOnServer(final int server, final int numberOfMessages) throws Exception { ServerLocator backupLocator = createInVMLocator(server); ClientSessionFactory factorybkp = addSessionFactory(createSessionFactory(backupLocator)); @@ -143,10 +138,8 @@ private void verifyMessageOnServer(final int server, final int numberOfMessages) } /** - * Test that if the only server is running and failing we trigger - * the event FailoverEventType.FAILOVER_FAILED in the end - * - * @throws Exception + * Test that if the only server is running and failing we trigger the event FailoverEventType.FAILOVER_FAILED in the + * end */ @Test public void testFailoverFailed() throws Exception { 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 bb2a33e95eb..df6e2d10782 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 @@ -110,8 +110,6 @@ protected TransportConfiguration getFieldFromSF(ClientSessionFactoryInternal sf, /** * Basic fail-back test. - * - * @throws Exception */ @Test @Timeout(120) @@ -181,10 +179,6 @@ public void testWithoutUsingTheBackup() throws Exception { session2.commit(); } - /** - * @param doFailBack - * @throws Exception - */ private void simpleFailover(boolean isReplicated, boolean doFailBack) throws Exception { createSessionFactory(); ClientSession session = createSessionAndQueue(); @@ -247,10 +241,6 @@ private void simpleFailover(boolean isReplicated, boolean doFailBack) throws Exc session2.commit(); } - /** - * @param consumer - * @throws ActiveMQException - */ protected void assertNoMoreMessages(ClientConsumer consumer) throws ActiveMQException { ClientMessage msg = consumer.receiveImmediate(); assertNull(msg, "there should be no more messages to receive! " + msg); @@ -262,10 +252,6 @@ protected void createSessionFactory() throws Exception { sf = createSessionFactoryAndWaitForTopology(locator, 2); } - /** - * @return - * @throws Exception - */ protected ClientSession createSessionAndQueue() throws Exception { ClientSession session = createSession(sf, false, false); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java index 840fb7a3702..ba58a9e9717 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTestBase.java @@ -77,9 +77,7 @@ public abstract class FailoverTestBase extends ActiveMQTestBase { protected static final int NUM_MESSAGES = 100; - /* - * Used only by tests of large messages. - */ + // Used only by tests of large messages. protected static final int MIN_LARGE_MESSAGE = 1024; private static final int LARGE_MESSAGE_SIZE = MIN_LARGE_MESSAGE * 3; @@ -269,9 +267,6 @@ protected TestableServer createColocatedTestableServer(Configuration config, /** * Large message version of {@link #setBody(int, ClientMessage)}. - * - * @param i - * @param message */ protected static void setLargeMessageBody(final int i, final ClientMessage message) { try { @@ -283,9 +278,6 @@ protected static void setLargeMessageBody(final int i, final ClientMessage messa /** * Large message version of {@link #assertMessageBody(int, ClientMessage)}. - * - * @param i - * @param message */ protected static void assertLargeMessageBody(final int i, final ClientMessage message) { ActiveMQBuffer buffer = message.getBodyBuffer(); @@ -297,7 +289,8 @@ protected static void assertLargeMessageBody(final int i, final ClientMessage me } /** - * Override this if is needed a different implementation of {@link NodeManager} to be used into {@link #createConfigs()}. + * Override this if is needed a different implementation of {@link NodeManager} to be used into + * {@link #createConfigs()}. */ protected NodeManager createNodeManager() throws Exception { return new InVMNodeManager(false); @@ -322,7 +315,8 @@ protected void createConfigs() throws Exception { } /** - * Override this if is needed a different implementation of {@link NodeManager} to be used into {@link #createReplicatedConfigs()}. + * Override this if is needed a different implementation of {@link NodeManager} to be used into + * {@link #createReplicatedConfigs()}. */ protected NodeManager createReplicatedBackupNodeManager(Configuration backupConfig) { return new InVMNodeManager(true, backupConfig.getJournalLocation()); @@ -458,10 +452,6 @@ protected ClientSessionFactoryInternal createSessionFactoryAndWaitForTopology(Se /** * Waits for backup to be in the "started" state and to finish synchronization with its live. - * - * @param sessionFactory - * @param seconds - * @throws Exception */ protected void waitForBackup(ClientSessionFactoryInternal sessionFactory, int seconds) throws Exception { final ActiveMQServerImpl actualServer = (ActiveMQServerImpl) backupServer.getServer(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FakeServiceComponent.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FakeServiceComponent.java index 04439fc925b..8b31055cb60 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FakeServiceComponent.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FakeServiceComponent.java @@ -19,7 +19,9 @@ import org.apache.activemq.artemis.core.server.ServiceComponent; -/** used by tests that are simulating a WebServer that should or should not go down */ +/** + * used by tests that are simulating a WebServer that should or should not go down + */ public class FakeServiceComponent implements ServiceComponent { final String description; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LargeMessageFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LargeMessageFailoverTest.java index 9a9e2184e3e..382aa334a8e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LargeMessageFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LargeMessageFailoverTest.java @@ -21,10 +21,6 @@ public class LargeMessageFailoverTest extends FailoverTest { - /** - * @param i - * @param message - */ @Override protected void assertMessageBody(final int i, final ClientMessage message) { assertLargeMessageBody(i, message); @@ -35,10 +31,6 @@ protected ServerLocatorInternal getServerLocator() throws Exception { return (ServerLocatorInternal) super.getServerLocator().setMinLargeMessageSize(MIN_LARGE_MESSAGE); } - /** - * @param i - * @param message - */ @Override protected void setBody(final int i, final ClientMessage message) { setLargeMessageBody(i, message); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultiplePrimariesMultipleBackupsFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultiplePrimariesMultipleBackupsFailoverTest.java index e777611c385..b5a1311f236 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultiplePrimariesMultipleBackupsFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultiplePrimariesMultipleBackupsFailoverTest.java @@ -38,8 +38,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - */ public class MultiplePrimariesMultipleBackupsFailoverTest extends MultipleBackupsFailoverTestBase { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java index 05c833c6802..cdcbc65bd13 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyReplicatedFailoverTest.java @@ -209,7 +209,6 @@ public void testPagedInSync() throws Exception { } - // https://issues.jboss.org/browse/HORNETQ-685 @Test @Timeout(120) public void testTimeoutOnFailover() throws Exception { @@ -273,7 +272,6 @@ public void testTimeoutOnFailover() throws Exception { } } - // https://issues.jboss.org/browse/HORNETQ-685 @Test @Timeout(120) public void testTimeoutOnFailoverConsume() throws Exception { @@ -431,7 +429,6 @@ private ClientMessage getMessage() { session.close(); } - // https://issues.jboss.org/browse/HORNETQ-685 @Test @Timeout(120) public void testTimeoutOnFailoverTransactionCommit() throws Exception { @@ -499,8 +496,7 @@ public void connectionFailed(ActiveMQException exception, boolean failedOver, St } /** - * This test would fail one in three or five times, - * where the commit would leave the session dirty after a timeout. + * This test would fail one in three or five times, where the commit would leave the session dirty after a timeout. */ @Test @Timeout(120) @@ -580,7 +576,6 @@ public void connectionFailed(ActiveMQException exception, boolean failedOver, St } - // https://issues.jboss.org/browse/HORNETQ-685 @Test @Timeout(120) public void testTimeoutOnFailoverTransactionRollback() throws Exception { @@ -632,11 +627,6 @@ public void testTimeoutOnFailoverTransactionRollback() throws Exception { } - /** - * see http://jira.jboss.org/browse/HORNETQ-522 - * - * @throws Exception - */ @Test @Timeout(120) public void testNonTransactedWithZeroConsumerWindowSize() throws Exception { @@ -910,8 +900,6 @@ public void testConsumeTransacted() throws Exception { session.close(); } - - // https://jira.jboss.org/jira/browse/HORNETQ-285 @Test @Timeout(120) public void testFailoverOnInitialConnection() throws Exception { @@ -977,8 +965,7 @@ public void testTransactedMessagesSentSoRollback() throws Exception { } /** - * Test that once the transacted session has throw a TRANSACTION_ROLLED_BACK exception, - * it can be reused again + * Test that once the transacted session has throw a TRANSACTION_ROLLED_BACK exception, it can be reused again */ @Test @Timeout(120) @@ -1297,7 +1284,6 @@ public void testXAMessagesSentSoRollbackOnPrepare() throws Exception { fail("Should throw exception"); } catch (XAException e) { assertEquals(XAException.XAER_RMFAIL, e.errorCode); - // XXXX session.rollback(); } ClientConsumer consumer = session.createConsumer(FailoverTestBase.ADDRESS); @@ -1631,7 +1617,7 @@ public void testFailoverMultipleSessionsWithConsumers() throws Exception { } } - /* + /** * Browser will get reset to beginning after failover */ @Test @@ -2082,7 +2068,6 @@ public void run() { @Test @Timeout(120) public void testBackupServerNotRemoved() throws Exception { - // HORNETQ-720 Disabling test for replicating backups. if (!(backupServer.getServer().getHAPolicy() instanceof SharedStoreBackupPolicy)) { return; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkFailureFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkFailureFailoverTest.java index f2a1ace0d6a..75abd8d6f56 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkFailureFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NetworkFailureFailoverTest.java @@ -57,10 +57,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue; /** - * This test will simulate a failure where the network card is gone. - * On that case the server should fail (as in stop) and not hung. - * If you don't have sudoer access to ifutil, this test will skip. - * You should add sudoer on your environment to run the test. + * This test will simulate a failure where the network card is gone. On that case the server should fail (as in stop) + * and not hung. If you don't have sudoer access to ifutil, this test will skip. You should add sudoer on your + * environment to run the test. */ public class NetworkFailureFailoverTest extends FailoverTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java index 24c20423750..591a545e23e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java @@ -42,7 +42,6 @@ /** * A PagingFailoverTest - *
                      */ public class PagingFailoverTest extends FailoverTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PrimaryToPrimaryFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PrimaryToPrimaryFailoverTest.java index 8471b80bdc7..faf85242c2d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PrimaryToPrimaryFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PrimaryToPrimaryFailoverTest.java @@ -195,8 +195,6 @@ private TransportConfiguration getAcceptorTransportConfiguration(boolean primary * TODO: https://issues.apache.org/jira/browse/ARTEMIS-2709 * this test has been intermittently failing since its day one. * Ignoring the test for now until we can fix it. - * - * @throws Exception */ @Test public void scaleDownDelay() throws Exception { @@ -233,7 +231,6 @@ public void scaleDownDelay() throws Exception { assertEquals(0, sf.numConnections()); } - // https://jira.jboss.org/jira/browse/HORNETQ-285 @Test public void testFailoverOnInitialConnection() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setRetryInterval(100); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumFailOverPrimaryVotesTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumFailOverPrimaryVotesTest.java index 08ea53dc96f..57c24ed1be2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumFailOverPrimaryVotesTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/QuorumFailOverPrimaryVotesTest.java @@ -57,8 +57,10 @@ protected void setupServers() throws Exception { } - /** Ignored per https://issues.apache.org/jira/browse/ARTEMIS-2484. - * Please remove this javadoc and the @Ignore when fixed */ + /** + * Ignored per https://issues.apache.org/jira/browse/ARTEMIS-2484. Please remove this javadoc and the @Ignore when + * fixed + */ @Disabled @Test public void testQuorumVotingPrimaryNotDead() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java index 8981b85f1de..c27ffdad57c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/ReplicatedDistributionTest.java @@ -160,10 +160,6 @@ private void commonTestCode() throws Exception { } - /** - * @param session - * @throws InterruptedException - */ private void fail(final ClientSession session) throws InterruptedException { final CountDownLatch latch = new CountDownLatch(1); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java index a87789a3c71..867e2dc48f8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SecurityFailoverTest.java @@ -71,9 +71,6 @@ protected ClientSession createSession(ClientSessionFactory sf, return createSession(sf, xa, autoCommitSends, autoCommitAcks, sf.getServerLocator().getAckBatchSize()); } - /** - * @throws Exception - */ @Override protected void createConfigs() throws Exception { nodeManager = new InVMNodeManager(false); @@ -97,9 +94,6 @@ protected void beforeRestart(TestableServer primaryServer1) { installSecurity(primaryServer1); } - /** - * @return - */ protected ActiveMQJAASSecurityManager installSecurity(TestableServer server) { ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getServer().getSecurityManager(); securityManager.getConfiguration().addUser("a", "b"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SharedStoreBackupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SharedStoreBackupTest.java index 75a1a31c105..ae8a18b0183 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SharedStoreBackupTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SharedStoreBackupTest.java @@ -37,11 +37,10 @@ public void testStartSharedBackupWithScalingDownPolicyDisabled() throws Exceptio } /** - * Returns true if backup started in given timeout. False otherwise. + * {@return returns true if backup started in given timeout; false otherwise} * * @param backupServer backup server * @param waitTimeout timeout in milliseconds - * @return returns true if backup started in given timeout. False otherwise */ private boolean waitForBackupToBecomeActive(TestableServer backupServer, long waitTimeout) throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SinglePrimaryMultipleBackupsFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SinglePrimaryMultipleBackupsFailoverTest.java index 2d7803b0bab..a1c4de4fc52 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SinglePrimaryMultipleBackupsFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SinglePrimaryMultipleBackupsFailoverTest.java @@ -37,8 +37,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - */ public class SinglePrimaryMultipleBackupsFailoverTest extends MultipleBackupsFailoverTestBase { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerNettyNoGroupNameReplicatedFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerNettyNoGroupNameReplicatedFailoverTest.java index acbe946be56..92830e25127 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerNettyNoGroupNameReplicatedFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerNettyNoGroupNameReplicatedFailoverTest.java @@ -59,8 +59,8 @@ private void waitForSync(ActiveMQServer server) throws Exception { } /** - * Default maxSavedReplicatedJournalsSize is 2, this means the backup will fall back to replicated only twice, after this - * it is stopped permanently. + * Default maxSavedReplicatedJournalsSize is 2, this means the backup will fall back to replicated only twice, after + * this it is stopped permanently. */ @Test @Timeout(120) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerReplicatedLargeMessageWithDelayFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerReplicatedLargeMessageWithDelayFailoverTest.java index 96ba36869ee..4be60b0f8fd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerReplicatedLargeMessageWithDelayFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/lockmanager/LockManagerReplicatedLargeMessageWithDelayFailoverTest.java @@ -38,7 +38,8 @@ public void setUp() throws Exception { super.setUp(); syncDelay = new BackupSyncDelay(backupServer, primaryServer); - /* Using getName() here is a bit of a hack, but if the backup is started for this test then the test will fail + /* + * Using getName() here is a bit of a hack, but if the backup is started for this test then the test will fail * intermittently due to an InterruptedException. */ if (!getName().equals("testBackupServerNotRemoved")) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachIntegrationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachIntegrationTest.java index b3fbe2d192d..3d738697a20 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachIntegrationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachIntegrationTest.java @@ -1339,9 +1339,6 @@ public void checkAssertions() { private final List errors = new ArrayList<>(); - /* (non-Javadoc) - * @see MessageHandler#onMessage(ClientMessage) - */ @Override public void onMessage(ClientMessage message) { try { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java index 74a8510a58b..531f7eb07e0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java @@ -67,7 +67,7 @@ public class ReattachTest extends ActiveMQTestBase { private ActiveMQServer server; private ServerLocator locator; - /* + /** * Test failure on connection, but server is still up so should immediately reconnect */ @Test @@ -195,7 +195,7 @@ public void testReattachTransferConnectionOnSession2() throws Exception { sf.close(); } - /* + /** * Test failure on connection, but server is still up so should immediately reconnect */ @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java index 63006a89eac..bf3cb3f85c1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java @@ -36,10 +36,7 @@ import org.junit.jupiter.api.Test; /** - * I have added this test to help validate if the connectors from Recovery will be - * properly updated - * - * Created to verify HORNETQ-913 / AS7-4548 + * I have added this test to help validate if the connectors from Recovery will be properly updated */ public class NonHATopologyTest extends ActiveMQTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java index 41f56ce4fa1..769f7ae24ae 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java @@ -69,11 +69,6 @@ private static final class LatchListener implements ClusterTopologyListener { // because stale UDP messages can mess up tests once nodes start going down private final List seenUp = new ArrayList<>(); - /** - * @param upLatch - * @param nodes - * @param downLatch - */ private LatchListener(CountDownLatch upLatch, List nodes, CountDownLatch downLatch) { this.upLatch = upLatch; this.nodes = nodes; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/BackupSyncDelay.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/BackupSyncDelay.java index 43b20926167..f63424728ab 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/BackupSyncDelay.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/BackupSyncDelay.java @@ -40,11 +40,12 @@ /** * An interceptor to keep a replicated backup server from reaching "up-to-date" status. *

                      - * There are 3 test scenarios for 'adding data to a remote backup':
                      - * 1. sync data that already existed
                      - * 2. adding `new` Journal updates (that arrived after the backup appeared) WHILE sync'ing happens
                      - * 3. adding `new` Journal updates AFTER sync'ing is done
                      - *

                      + * There are 3 test scenarios for 'adding data to a remote backup': + *

                        + *
                      1. sync data that already existed + *
                      2. adding `new` Journal updates (that arrived after the backup appeared) WHILE sync'ing happens + *
                      3. adding `new` Journal updates AFTER sync'ing is done + *
                      * These 'withDelay' tests were created to test/verify data transfers of type 2. because there is so * little data, if we don't delay the sync message, we cannot be sure we are testing scenario .2. * because the sync will be done too fast. @@ -73,8 +74,6 @@ public void deliverUpToDateMsg() { } /** - * @param backup - * @param live * @param packetCode which packet is going to be intercepted. */ public BackupSyncDelay(ActiveMQServer backup, ActiveMQServer live, byte packetCode) { @@ -84,10 +83,6 @@ public BackupSyncDelay(ActiveMQServer backup, ActiveMQServer live, byte packetCo handler = new ReplicationChannelHandler(packetCode); } - /** - * @param backupServer - * @param liveServer - */ public BackupSyncDelay(TestableServer backupServer, TestableServer liveServer) { this(backupServer.getServer(), liveServer.getServer(), PacketImpl.REPLICATION_START_FINISH_SYNC); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/RemoteServerConfiguration.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/RemoteServerConfiguration.java index 8aee92b2352..0f531dcdb60 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/RemoteServerConfiguration.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/util/RemoteServerConfiguration.java @@ -20,10 +20,9 @@ /** * A RemoteServerConfiguration. - *
                      - * These classes are initialized through their class name through {@link Class#newInstance()}. - * Therefore they must have a no argument constructor, and if they are inner classes they must be - * static. + *

                      + * These classes are initialized through their class name through {@link Class#newInstance()}. Therefore they must have + * a no argument constructor, and if they are inner classes they must be static. */ public abstract class RemoteServerConfiguration { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/consumer/DetectOrphanedConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/consumer/DetectOrphanedConsumerTest.java index bb3efc2e8f9..a5aa2ea1d61 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/consumer/DetectOrphanedConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/consumer/DetectOrphanedConsumerTest.java @@ -48,8 +48,8 @@ import org.slf4j.LoggerFactory; /** - * This test is simulating an orphaned consumer situation that was fixed in ARTEMIS-4476. - * the method QueueControl::listConsumersAsJSON should add a field orphaned=true in case the consumer is orphaned. + * This test is simulating an orphaned consumer situation that was fixed in ARTEMIS-4476. the method + * QueueControl::listConsumersAsJSON should add a field orphaned=true in case the consumer is orphaned. */ public class DetectOrphanedConsumerTest extends ActiveMQTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/consumer/OrphanedConsumerDefenseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/consumer/OrphanedConsumerDefenseTest.java index 80be91bf87b..4af0c8a73aa 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/consumer/OrphanedConsumerDefenseTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/consumer/OrphanedConsumerDefenseTest.java @@ -65,13 +65,13 @@ import org.slf4j.LoggerFactory; /** - * as worked through ARTEMIS-4476 we fixed the possibility of a ghost consumer (a term coined by a user), - * where the connection is gone but the consumer still in memory. + * as worked through ARTEMIS-4476 we fixed the possibility of a ghost consumer (a term coined by a user), where the + * connection is gone but the consumer still in memory. *

                      * The fix involved on calling the disconnect from the proper threads. *

                      - * And as a line of defense the ServerConsumer and AMQP handler are also validating the connection states. - * If a connection is in destroyed state tries to create a consumer, the system should throw an error. + * And as a line of defense the ServerConsumer and AMQP handler are also validating the connection states. If a + * connection is in destroyed state tries to create a consumer, the system should throw an error. */ public class OrphanedConsumerDefenseTest extends ActiveMQTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java index 9d85bca9259..883706fb25e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/crossprotocol/OpenWireToAMQPTest.java @@ -161,9 +161,7 @@ public void testByteArrayProperties() throws Exception { ObjectMessage receive = (ObjectMessage) consumer.receive(5000); assertNotNull(receive); - /* - * As noted in section 3.5.4 of the JMS 2 specification all properties can be converted to String - */ + // As noted in section 3.5.4 of the JMS 2 specification all properties can be converted to String Enumeration propertyNames = receive.getPropertyNames(); while (propertyNames.hasMoreElements()) { receive.getStringProperty(propertyNames.nextElement()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java index 4507eb46b53..54634f06409 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryBaseTest.java @@ -52,20 +52,12 @@ public class DiscoveryBaseTest extends ActiveMQTestBase { protected final String address3 = getUDPDiscoveryAddress(2); - /** - * @param discoveryGroup - * @throws Exception - */ protected static void verifyBroadcast(BroadcastGroup broadcastGroup, DiscoveryGroup discoveryGroup) throws Exception { broadcastGroup.broadcastConnectors(); assertTrue(discoveryGroup.waitForBroadcast(2000), "broadcast not received"); } - /** - * @param discoveryGroup - * @throws Exception - */ protected static void verifyNonBroadcast(BroadcastGroup broadcastGroup, DiscoveryGroup discoveryGroup) throws Exception { broadcastGroup.broadcastConnectors(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryTest.java index 10ebfc0321b..5041b6467e8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/discovery/DiscoveryTest.java @@ -56,22 +56,19 @@ /** * This will test Discovery test on JGroups and UDP. - *
                      - * In some configurations IPV6 may be a challenge. To make sure this test works, you may add this - * property to your JVM settings: {@literal -Djgroups.bind_addr=::1} - *
                      + *

                      + * In some configurations IPV6 may be a challenge. To make sure this test works, you may add this property to your JVM + * settings: {@literal -Djgroups.bind_addr=::1} + *

                      * Or ultimately you may also turn off IPV6: {@literal -Djava.net.preferIPv4Stack=true} - *
                      - * Note when you are not sure about your IP settings of your test machine, you should make sure - * that the jgroups.bind_addr and java.net.preferXXStack by defining them explicitly, for example - * if you would like to use IPV6, set BOTH properties to your JVM like the following: - * -Djgroups.bind_addr=::1 -Djava.net.preferIPv6Addresses=true - *
                      - * or if you prefer IPV4: - * -Djgroups.bind_addr=localhost -Djava.net.preferIPv4Stack=true - *
                      - * Also: Make sure you add integration-tests/src/tests/resources to your project path on the - * tests/integration-tests + *

                      + * Note when you are not sure about your IP settings of your test machine, you should make sure that the + * jgroups.bind_addr and java.net.preferXXStack by defining them explicitly, for example if you would like to use IPV6, + * set BOTH properties to your JVM like the following: -Djgroups.bind_addr=::1 -Djava.net.preferIPv6Addresses=true + *

                      + * or if you prefer IPV4: -Djgroups.bind_addr=localhost -Djava.net.preferIPv4Stack=true + *

                      + * Also: Make sure you add integration-tests/src/tests/resources to your project path on the tests/integration-tests */ public class DiscoveryTest extends DiscoveryBaseTest { @@ -91,7 +88,7 @@ public void prepareLoopback() { @AfterEach public void tearDown() throws Exception { JChannelManager.getInstance().clear().setLoopbackMessages(false); - /** This file path is defined at {@link #TEST_JGROUPS_CONF_FILE} */ + // This file path is defined by TEST_JGROUPS_CONF_FILE deleteDirectory(new File("./target/tmp/amqtest.ping.dir")); for (ActiveMQComponent component : new ActiveMQComponent[]{bg, bg1, bg2, bg3, dg, dg1, dg2, dg3}) { stopComponent(component); @@ -156,10 +153,8 @@ public void testJGroupsOpenClientInitializesChannel() throws Exception { } /** - * Create one broadcaster and 100 receivers. Make sure broadcasting works. - * Then stop 99 of the receivers, the last one could still be working. - * - * @throws Exception + * Create one broadcaster and 100 receivers. Make sure broadcasting works. Then stop 99 of the receivers, the last + * one could still be working. */ @Test public void testJGropusChannelReferenceCounting() throws Exception { @@ -215,11 +210,8 @@ public void testJGropusChannelReferenceCounting() throws Exception { } /** - * Create one broadcaster and 50 receivers. Make sure broadcasting works. - * Then stop all of the receivers, and create 50 new ones. Make sure the - * 50 new ones are receiving data from the broadcasting. - * - * @throws Exception + * Create one broadcaster and 50 receivers. Make sure broadcasting works. Then stop all of the receivers, and create + * 50 new ones. Make sure the 50 new ones are receiving data from the broadcasting. */ @Test public void testJGropusChannelReferenceCounting1() throws Exception { @@ -281,10 +273,8 @@ public void testJGropusChannelReferenceCounting1() throws Exception { } /** - * Create one broadcaster and 50 receivers. Then stop half of the receivers. - * Then add the half back, plus some more. Make sure all receivers receive data. - * - * @throws Exception + * Create one broadcaster and 50 receivers. Then stop half of the receivers. Then add the half back, plus some more. + * Make sure all receivers receive data. */ @Test public void testJGropusChannelReferenceCounting2() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java index 702204813a7..11e40c986cb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/divert/PersistentDivertTest.java @@ -186,9 +186,6 @@ public void doTestPersistentDivert(final boolean largeMessage) throws Exception assertNull(consumer4.receiveImmediate()); } - /** - * @param message - */ private void checkLargeMessage(final ClientMessage message) { for (int j = 0; j < minLargeMessageSize; j++) { assertEquals(ActiveMQTestBase.getSamplebyte(j), message.getBodyBuffer().readByte()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedAddressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedAddressTest.java index 829e8ea4ee7..c5e68a13a2b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedAddressTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedAddressTest.java @@ -44,9 +44,6 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -/** - * Federated Address Test - */ public class FederatedAddressTest extends FederatedTestBase { @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedQueueTest.java index 84009e369a6..e4a0af1d56b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedQueueTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedQueueTest.java @@ -48,9 +48,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -/** - * Federated Queue Test - */ public class FederatedQueueTest extends FederatedTestBase { @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedTestBase.java index ee2b9655621..73308aa6289 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/federation/FederatedTestBase.java @@ -30,9 +30,6 @@ import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.jupiter.api.BeforeEach; -/** - * Federation Test Base - */ public class FederatedTestBase extends ActiveMQTestBase { protected List mBeanServers = new ArrayList<>(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java index abe4c3e6132..f0e23cc07b7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/http/CoreClientOverHttpTest.java @@ -110,7 +110,6 @@ public void testCoreHttpClientIdle() throws Exception { session.close(); } - // https://issues.jboss.org/browse/JBPAPP-5542 @Test public void testCoreHttpClient8kPlus() throws Exception { ClientSessionFactory sf = createSessionFactory(locator); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java index 67984bf7f1e..706401f8e71 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java @@ -284,9 +284,6 @@ public boolean intercept(final Packet packet, final RemotingConnection connectio } - /** - * @param packet - */ private boolean isForceDeliveryResponse(final Packet packet) { if (packet.getType() == PacketImpl.SESS_RECEIVE_MSG) { SessionReceiveMessage msg = (SessionReceiveMessage) packet; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java index 2c89dfaaab0..b8ff1eb882c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ActiveMQConnectionFactoryTest.java @@ -60,9 +60,6 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.fail; -/** - * ActiveMQConnectionFactoryTest - */ public class ActiveMQConnectionFactoryTest extends ActiveMQTestBase { private final String groupAddress = getUDPDiscoveryAddress(); 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 d90be257359..fbf86b8aa45 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 @@ -36,9 +36,6 @@ import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; -/** - * A FloodServerTest - */ public class FloodServerTest extends ActiveMQTestBase { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ProgrammaticRedeployTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ProgrammaticRedeployTest.java index 6060165b3a5..69ee7d33835 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ProgrammaticRedeployTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/ProgrammaticRedeployTest.java @@ -41,11 +41,11 @@ public class ProgrammaticRedeployTest extends ActiveMQTestBase { - @Test /** * This is basically a copy of org.apache.activemq.artemis.tests.integration.jms.RedeployTest#testRedeployAddressQueue(). * However, this test disables automatic configuration reload and uses the management API to do it instead. */ + @Test public void testRedeployAddressQueue() throws Exception { Path brokerXML = getTestDirfile().toPath().resolve("broker.xml"); URL url1 = ProgrammaticRedeployTest.class.getClassLoader().getResource("reload-address-queues-programmatic.xml"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java index 3e6d7921128..b3e934224f8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/RedeployTest.java @@ -75,11 +75,11 @@ public class RedeployTest extends ActiveMQTestBase { - @Test /* * This tests that the broker doesnt fall over when it tries to delete any autocreated addresses/queues in a clustered environment * If the undeploy fails then bridges etc can stop working, we need to make sure if undeploy fails on anything the broker is still live - * */ + */ + @Test public void testRedeployAutoCreateAddress() throws Exception { Path brokerXML = getTestDirfile().toPath().resolve("broker.xml"); URL url1 = RedeployTest.class.getClassLoader().getResource("reload-test-autocreateaddress.xml"); @@ -722,7 +722,8 @@ public void testRedeployRemoveQueueFilter() throws Exception { /** * This one is here just to make sure it's possible to change queue parameters one by one without setting the others - * to null. + * to {@code null}. + * * @throws Exception An exception. */ @Test @@ -1341,8 +1342,8 @@ public void testRedeployChangeAddressQueueRoutingType() throws Exception { } /** - * Simulates Stop and Start that occurs when network health checker stops the server when network is detected unhealthy - * and re-starts the broker once detected that it is healthy again. + * Simulates Stop and Start that occurs when network health checker stops the server when network is detected + * unhealthy and re-starts the broker once detected that it is healthy again. * * @throws Exception for anything un-expected, test will fail. */ diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java index d41782ff92a..9303ce5b060 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/SimpleJNDIClientTest.java @@ -71,9 +71,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -/** - * ActiveMQConnectionFactoryTest - */ public class SimpleJNDIClientTest extends ActiveMQTestBase { private final String groupAddress = getUDPDiscoveryAddress(); 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 c3ff165406c..69a7d6d8be3 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 @@ -240,7 +240,6 @@ public void testConnectionFactorySerialization() throws Exception { testCreateConnection(newCF); //now serialize a cf after a connection has been created - //https://issues.jboss.org/browse/WFLY-327 Connection aConn = null; try { aConn = cf.createConnection(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ExclusiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ExclusiveTest.java index bbe515e6e58..3767e7a45fd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ExclusiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ExclusiveTest.java @@ -42,9 +42,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -/** - * Exclusive Test - */ public class ExclusiveTest extends JMSTestBase { private SimpleString queueName = SimpleString.of("jms.exclusive.queue"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java index eb9b0a4f1a2..66b3642980d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/GroupingTest.java @@ -53,9 +53,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -/** - * GroupingTest - */ public class GroupingTest extends JMSTestBase { private Queue queue; @@ -527,11 +524,11 @@ public void testGroupRebalance() throws Exception { } /** - * This tests ensures that when we have group rebalance and pause dispatch, - * the broker pauses dispatch of new messages to consumers whilst rebalance and awaits existing inflight messages to be handled before restarting dispatch with new reblanced group allocations, - * this allows us to provide a guarantee of message ordering even with rebalance, at the expense that during rebalance dispatch will pause till all consumers with inflight messages are handled. - * - * @throws Exception + * This tests ensures that when we have group rebalance and pause dispatch, the broker pauses dispatch of new + * messages to consumers whilst rebalance and awaits existing inflight messages to be handled before restarting + * dispatch with new reblanced group allocations, this allows us to provide a guarantee of message ordering even with + * rebalance, at the expense that during rebalance dispatch will pause till all consumers with inflight messages are + * handled. */ @Test public void testGroupRebalancePauseDispatch() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/LVQTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/LVQTest.java index 7c8566e7fb6..1291a68b89b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/LVQTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/LVQTest.java @@ -37,9 +37,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -/** - * LVQ Test - */ public class LVQTest extends JMSTestBase { @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageProducerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageProducerTest.java index 6b8ed998e6c..06ca09db3dd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageProducerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageProducerTest.java @@ -28,9 +28,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -/** - * - */ public class MessageProducerTest extends JMSTestBase { @Override diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageTest.java index 9d33a9d18a7..054f052e0ed 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/MessageTest.java @@ -54,11 +54,6 @@ public class MessageTest extends JMSTestBase { private static final String propName3 = "myprop3"; - - - /** - * @see https://jira.jboss.org/jira/browse/HORNETQ-242 - */ @Test public void testStreamMessageReadsNull() throws Exception { Connection conn = cf.createConnection(); @@ -296,7 +291,6 @@ public void testWildcardRoutingHierarchyWithMultipleConsumers() throws Exception } } - // https://issues.jboss.org/browse/HORNETQ-988 @Test public void testShouldNotThrowException() throws Exception { Connection conn = null; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java index f9f9531ead2..fbcf9f8d787 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java @@ -36,10 +36,9 @@ public class NoLocalSubscriberTest extends JMSTestBase { - /** - * Test that a message created from the same connection than a nolocal consumer - * can be sent by *another* connection and will be received by the nolocal consumer + * Test that a message created from the same connection than a nolocal consumer can be sent by *another* connection + * and will be received by the nolocal consumer */ @Test public void testNoLocal() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReceiveNoWaitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReceiveNoWaitTest.java index 0805bd33c87..37bc35f98e4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReceiveNoWaitTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ReceiveNoWaitTest.java @@ -31,9 +31,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -/** - * A ReceiveNoWaitTest - */ public class ReceiveNoWaitTest extends JMSTestBase { private Queue queue; @@ -46,10 +43,9 @@ public void setUp() throws Exception { queue = createQueue("TestQueue"); } - /* - * Test that after sending persistent messages to a queue (these will be sent blocking) - * that all messages are available for consumption by receiveNoWait() - * https://jira.jboss.org/jira/browse/HORNETQ-284 + /** + * Test that after sending persistent messages to a queue (these will be sent blocking) that all messages are + * available for consumption by receiveNoWait() */ @Test public void testReceiveNoWait() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RemoteConnectionStressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RemoteConnectionStressTest.java index 6c00a770176..fe14f16b2e9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RemoteConnectionStressTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RemoteConnectionStressTest.java @@ -32,9 +32,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -/** - * test Written to replicate https://issues.jboss.org/browse/HORNETQ-1312 - */ public class RemoteConnectionStressTest extends ActiveMQTestBase { ActiveMQServer server; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RollbackTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RollbackTest.java index 36d1a545c75..342556c9753 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RollbackTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/RollbackTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.jms.client; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java index 75b2ef1bcd9..34bb137b71a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionClosedOnRemotingConnectionFailureTest.java @@ -39,13 +39,8 @@ import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.junit.jupiter.api.Test; -/** - * A SessionClosedOnRemotingConnectionFailureTest - */ public class SessionClosedOnRemotingConnectionFailureTest extends JMSTestBase { - - @Test public void testSessionClosedOnRemotingConnectionFailure() throws Exception { List connectorConfigs = new ArrayList<>(); @@ -106,6 +101,4 @@ public void testSessionClosedOnRemotingConnectionFailure() throws Exception { } } } - - } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionMetadataAddExceptionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionMetadataAddExceptionTest.java index 82e57d8b9e7..919e76cce91 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionMetadataAddExceptionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionMetadataAddExceptionTest.java @@ -37,8 +37,7 @@ import org.junit.jupiter.api.Timeout; /** - * Test that the client receives an exception if there is an error when metadata - * is added + * Test that the client receives an exception if there is an error when metadata is added */ public class SessionMetadataAddExceptionTest extends JMSTestBase { private AtomicInteger duplicateCount = new AtomicInteger(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/StoreConfigTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/StoreConfigTest.java index 16ed45d14ae..a5d2aceacab 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/StoreConfigTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/StoreConfigTest.java @@ -295,9 +295,6 @@ public void testCreateQueue() throws Exception { jmsServer.stop(); } - /** - * - */ private void assertNullJNDI(String name) { Object obj = null; try { @@ -308,10 +305,6 @@ private void assertNullJNDI(String name) { assertNull(obj); } - /** - * @throws NamingException - * @throws JMSException - */ private void openCon(String name) throws NamingException, JMSException { ConnectionFactory cf = (ConnectionFactory) namingContext.lookup(name); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java index b72195768c1..92c123798b5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java @@ -48,9 +48,9 @@ import org.junit.jupiter.api.Test; /** - * This test will simulate a situation where the Topics used to have an extra queue on startup. - * The server was then written to perform a cleanup, and that cleanup should always work. - * This test will create the dirty situation where the test should recover from + * This test will simulate a situation where the Topics used to have an extra queue on startup. The server was then + * written to perform a cleanup, and that cleanup should always work. This test will create the dirty situation where + * the test should recover from */ public class TopicCleanupTest extends JMSTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java index b11fa7fb75a..d9e8758fda0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/JMSFailoverListenerTest.java @@ -67,7 +67,7 @@ /** * A JMSFailoverTest - *
                      + *

                      * A simple test to test setFailoverListener when using the JMS API. */ public class JMSFailoverListenerTest extends ActiveMQTestBase { @@ -257,9 +257,6 @@ public void setUp() throws Exception { startServers(); } - /** - * @throws Exception - */ protected void startServers() throws Exception { NodeManager nodeManager = new InVMNodeManager(false); backuptc = new TransportConfiguration(INVM_CONNECTOR_FACTORY, backupParams); 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 eadd7f7ef84..756d05b098a 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 @@ -84,9 +84,8 @@ /** * A JMSFailoverTest - *
                      - * A simple test to test failover when using the JMS API. - * Most of the failover tests are done on the Core API. + *

                      + * A simple test to test failover when using the JMS API. Most of the failover tests are done on the Core API. */ public class JMSFailoverTest extends ActiveMQTestBase { @@ -518,9 +517,6 @@ public void setUp() throws Exception { startServers(); } - /** - * @throws Exception - */ protected void startServers() throws Exception { final boolean sharedStore = true; NodeManager nodeManager = new InVMNodeManager(!sharedStore); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/LargeMessageOverBridgeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/LargeMessageOverBridgeTest.java index 4d345176dfa..ad057019417 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/LargeMessageOverBridgeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/cluster/LargeMessageOverBridgeTest.java @@ -76,8 +76,6 @@ public LargeMessageOverBridgeTest(boolean persistent) { /** * This was causing a text message to ber eventually converted into large message when sent over the bridge - * - * @throws Exception */ @TestTemplate public void testSendHalfLargeTextMessage() throws Exception { @@ -112,8 +110,6 @@ public void testSendHalfLargeTextMessage() throws Exception { /** * This was causing a text message to ber eventually converted into large message when sent over the bridge - * - * @throws Exception */ @TestTemplate public void testSendMapMessageOverCluster() throws Exception { @@ -154,8 +150,6 @@ public void testSendMapMessageOverCluster() throws Exception { /** * the hack to create the failing condition in certain tests - * - * @param config */ private void installHack(Configuration config) { if (this.getName().equals("testSendBytesAsLargeOnBridgeOnly")) { @@ -176,8 +170,6 @@ protected Configuration createConfigServer(final int source, final int destinati /** * This was causing a text message to ber eventually converted into large message when sent over the bridge - * - * @throws Exception */ @TestTemplate public void testSendBytesAsLargeOnBridgeOnly() throws Exception { @@ -223,8 +215,6 @@ public void testSendBytesAsLargeOnBridgeOnly() throws Exception { /** * The message won't be large to the client while it will be considered large through the bridge - * - * @throws Exception */ @TestTemplate public void testSendLargeForBridge() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseDestroyedConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseDestroyedConnectionTest.java index b247d38e860..4e11e3c9b62 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseDestroyedConnectionTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/CloseDestroyedConnectionTest.java @@ -79,7 +79,7 @@ public void testClosingTemporaryTopicDeletesQueue() throws Exception { } } - /* + /** * Closing a connection that is destroyed should cleanly close everything without throwing exceptions */ @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConcurrentSessionCloseTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConcurrentSessionCloseTest.java index a0a71938ea1..ebde3e413e8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConcurrentSessionCloseTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConcurrentSessionCloseTest.java @@ -45,7 +45,6 @@ public void setUp() throws Exception { cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(INVM_CONNECTOR_FACTORY)); } - // https://jira.jboss.org/browse/HORNETQ-525 @Test public void testConcurrentClose() throws Exception { final Connection con = cf.createConnection(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java index 9fdd8d7c563..d0dbb5175f2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java @@ -289,7 +289,7 @@ protected static InetAddress getLocalHost() throws UnknownHostException { InetAddress addr; try { addr = InetAddress.getLocalHost(); - } catch (ArrayIndexOutOfBoundsException e) { //this is workaround for mac osx bug see AS7-3223 and JGRP-1404 + } catch (ArrayIndexOutOfBoundsException e) { addr = InetAddress.getByName(null); } return addr; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactoryWithJGroupsSerializationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactoryWithJGroupsSerializationTest.java index bb8a57ce0d4..160444cd990 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactoryWithJGroupsSerializationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactoryWithJGroupsSerializationTest.java @@ -83,13 +83,9 @@ public void setUp() throws Exception { } } - - //HORNETQ-1389 - //Here we deploy two Connection Factories with JGroups discovery groups. - //The first one uses a runtime JChannel object, which is the case before the fix. - //The second one uses the raw jgroups config string, which is the case after fix. - //So the first one will get serialization exception in the test - //while the second will not. + //Here we deploy two Connection Factories with JGroups discovery groups. The first one uses a runtime JChannel + // object, which is the case before the fix. The second one uses the raw jgroups config string, which is the case + // after fix. So the first one will get serialization exception in the test while the second will not. @Test public void testSerialization() throws Exception { jmsCf1 = (ActiveMQConnectionFactory) namingContext.lookup("/ConnectionFactory1"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java index 66cbdf87040..b565e50a502 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ExceptionListenerTest.java @@ -39,9 +39,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -/** - * ExceptionListenerTest - */ public class ExceptionListenerTest extends ActiveMQTestBase { private ActiveMQServer server; @@ -134,15 +131,14 @@ public void testListenerCalledForOneConnectionAndSessions() throws Exception { conn.close(); } - /** - * The JMS Spec isn't specific about if ClientId can be set after Exception Listener or not, - * simply it states that clientId must be set before any operation (read as remote) - * - * QpidJMS and ActiveMQ5 both interpret that therefor you can set the exception lister first. - * As such we align with those, allowing the exception listener to be set prior to the clientId, - * This to avoid causing implementation nuance's, when switching code from one client to another. - * + * The JMS Spec isn't specific about if ClientId can be set after Exception Listener or not, simply it states that + * clientId must be set before any operation (read as remote) + *

                      + * QpidJMS and ActiveMQ5 both interpret that therefor you can set the exception lister first. As such we align with + * those, allowing the exception listener to be set prior to the clientId, This to avoid causing implementation + * nuance's, when switching code from one client to another. + *

                      * This test is to test this and to ensure it doesn't get accidentally regressed. */ @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/JmsConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/JmsConsumerTest.java index 37ea084f107..bf20424f19a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/JmsConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/consumer/JmsConsumerTest.java @@ -820,7 +820,6 @@ public void defaultAutoCreatedQueueConfigTest() throws Exception { /** * Test for ARTEMIS-1610 - * @throws Exception */ @Test public void testConsumerAfterWildcardAddressRemoval() throws Exception { @@ -853,7 +852,6 @@ public void testConsumerAfterWildcardAddressRemoval() throws Exception { /** * Test for ARTEMIS-1610 - * @throws Exception */ @Test public void testConsumerAfterWildcardConsumer() throws Exception { @@ -888,10 +886,8 @@ public void testConsumerAfterWildcardConsumer() throws Exception { } /** - * ARTEMIS-1627 - Verify that a address can be removed when there are no direct - * bindings on the address but does have bindings on a linked address - * - * @throws Exception + * ARTEMIS-1627 - Verify that a address can be removed when there are no direct bindings on the address but does have + * bindings on a linked address */ @Test public void testAddressRemovalWithWildcardConsumer() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/divert/DivertAndACKClientTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/divert/DivertAndACKClientTest.java index e67dbcf7810..77fa984cb26 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/divert/DivertAndACKClientTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/divert/DivertAndACKClientTest.java @@ -34,11 +34,6 @@ import org.apache.activemq.artemis.tests.util.JMSTestBase; import org.junit.jupiter.api.Test; -/** - * A DivertAndACKClientTest - * - * https://jira.jboss.org/jira/browse/HORNETQ-165 - */ public class DivertAndACKClientTest extends JMSTestBase { @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsContextTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsContextTest.java index cded4be037e..65e3203522d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsContextTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsContextTest.java @@ -328,23 +328,22 @@ public void testCloseSecondContextConnectionRemainsOpen() throws JMSException { Message msg = consumer.receive(100); assertNotNull(msg, "must have a msg"); assertEquals(intProperty, msg.getIntProperty("random")); - /* In the second pass we close the connection before ack'ing */ + // In the second pass we close the connection before ack'ing if (idx == pass) { localContext.close(); } - /** - * From {@code JMSContext.close()}'s javadoc:
                      - * Invoking the {@code acknowledge} method of a received message from a closed connection's - * session must throw an {@code IllegalStateRuntimeException}. Closing a closed connection - * must NOT throw an exception. + /* + * From JMSContext.close() javadoc: + * + * Invoking the acknowledge method of a received message from a closed connection's session must throw an + * IllegalStateRuntimeException. Closing a closed connection must NOT throw an exception. */ try { msg.acknowledge(); assertEquals(0, idx, "connection should be open on pass 0. It is " + pass); } catch (javax.jms.IllegalStateException expected) { - // HORNETQ-1209 "JMS 2.0" XXX JMSContext javadoc says we must expect a - // IllegalStateRuntimeException here. But Message.ack...() says it must throws the - // non-runtime variant. + // JMSContext javadoc says we must expect an IllegalStateRuntimeException here. But Message.ack...() says it + // must throws the non-runtime variant. assertEquals(pass, idx, "we only close the connection on pass " + pass); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsProducerCompletionListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsProducerCompletionListenerTest.java index 8664fa1734b..83d5761a7f3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsProducerCompletionListenerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/jms2client/JmsProducerCompletionListenerTest.java @@ -142,10 +142,6 @@ public static final class InvalidCompletionListener implements CompletionListene private Exception error; private final int call; - /** - * @param context - * @param call - */ public InvalidCompletionListener(JMSContext context, int call) { this.call = call; this.context = context; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSFQQNConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSFQQNConsumerTest.java index a68f3aeca1a..473af0cfa25 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSFQQNConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/multiprotocol/JMSFQQNConsumerTest.java @@ -232,7 +232,8 @@ public void testFQQNTopicConsumerDontExistAMQP() throws Exception { testFQQNTopicConsumerDontExist("AMQP"); } - /* this commented out code is just to make a point that this test would not be valid in openwire. + /* + * this commented out code is just to make a point that this test would not be valid in openwire. As openwire is calling the method createSubscription from its 1.1 implementation. Hence there's no need to test this over JMS1.1 with openWire @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java index e9313bfeb5e..d6f9ddd96a7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/server/JMSServerStartStopTest.java @@ -135,7 +135,6 @@ public void testStopStart1() throws Exception { jbcf.close(); } - // https://jira.jboss.org/jira/browse/HORNETQ-315 @Test public void testCloseConnectionAfterServerIsShutdown() throws Exception { server.start(); @@ -152,9 +151,6 @@ public void testCloseConnectionAfterServerIsShutdown() throws Exception { conn.close(); } - /** - * @return - */ private ActiveMQConnectionFactory createConnectionFactory() { ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(NETTY_CONNECTOR_FACTORY)); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalImplTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalImplTest.java index 7335041936a..c699909f964 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalImplTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOJournalImplTest.java @@ -29,12 +29,13 @@ import org.junit.jupiter.api.BeforeEach; /** - * A RealJournalImplTest - * you need to define -Djava.library.path=${project-root}/native/src/.libs when calling the JVM - * If you are running this test in eclipse you should do: - * I - Run->Open Run Dialog - * II - Find the class on the list (you will find it if you already tried running this testcase before) - * III - Add -Djava.library.path=/native/src/.libs + * A RealJournalImplTest you need to define {@code -Djava.library.path=${project-root}/native/src/.libs} when calling + * the JVM If you are running this test in eclipse you should do: + *

                        + *
                      1. Run->Open Run Dialog + *
                      2. Find the class on the list (you will find it if you already tried running this testcase before) + *
                      3. Add {@code -Djava.library.path=/native/src/.libs} + *
                      */ public class AIOJournalImplTest extends JournalImplTestUnit { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOUnbuferedJournalImplTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOUnbuferedJournalImplTest.java index 374686c6df7..1ac5ce0ccff 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOUnbuferedJournalImplTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/AIOUnbuferedJournalImplTest.java @@ -30,12 +30,13 @@ import org.junit.jupiter.api.BeforeEach; /** - * A RealJournalImplTest - * you need to define -Djava.library.path=${project-root}/native/src/.libs when calling the JVM - * If you are running this test in eclipse you should do: - * I - Run->Open Run Dialog - * II - Find the class on the list (you will find it if you already tried running this testcase before) - * III - Add -Djava.library.path=/native/src/.libs + * A RealJournalImplTest you need to define {@code -Djava.library.path=${project-root}/native/src/.libs} when calling + * the JVM If you are running this test in eclipse you should do: + *
                        + *
                      1. Run->Open Run Dialog + *
                      2. Find the class on the list (you will find it if you already tried running this testcase before) + *
                      3. Add {@code -Djava.library.path=/native/src/.libs} + *
                      */ public class AIOUnbuferedJournalImplTest extends JournalImplTestUnit { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/DuplicateRecordIdTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/DuplicateRecordIdTest.java index bc7cf9b124e..a7d5cd06d01 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/DuplicateRecordIdTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/DuplicateRecordIdTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.journal; import org.apache.activemq.artemis.api.core.SimpleString; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalCompactSplitTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalCompactSplitTest.java index f97cee5a212..9d28ef58896 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalCompactSplitTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalCompactSplitTest.java @@ -39,10 +39,6 @@ import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.junit.jupiter.api.Test; -/** - * Authored by Fabio Nascimento Brandao through https://issues.apache.org/jira/browse/ARTEMIS-3868 - * Clebert added some refactoring to make it a Unit Test - * */ public class JournalCompactSplitTest extends ActiveMQTestBase { private static final long RECORDS_TO_CREATE = 100; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalDataPrintTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalDataPrintTest.java index 438cb603e4f..fa95132ce8c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalDataPrintTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/JournalDataPrintTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.journal; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOImportExportTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOImportExportTest.java index 81b740010bd..dcf5afa0812 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOImportExportTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/NIOImportExportTest.java @@ -25,16 +25,11 @@ public class NIOImportExportTest extends JournalImplTestBase { - /* (non-Javadoc) - * @see JournalImplTestBase#getFileFactory() - */ @Override protected SequentialFileFactory getFileFactory() throws Exception { return new NIOSequentialFileFactory(getTestDirfile(), true, 1); } - - @Test public void testExportImport() throws Exception { setup(10, 10 * 4096, true); 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 c2c5201ae2a..a5026dfb5b7 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 @@ -885,7 +885,7 @@ public void onCompactDone() { } } - /** Some independent adds and updates */ + // Some independent adds and updates for (int i = 0; i < 1000; i++) { long id = idGenerator.generateID(); add(id); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementActivationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementActivationTest.java index b1e671e41c9..79eda79f488 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementActivationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementActivationTest.java @@ -39,9 +39,9 @@ import org.junit.jupiter.api.Test; /** - * Validates if a JMS management operations will wait until the server is activated. If the server is not active - * then JMS management operations (e.g. create connection factory, create queue, etc.) should be stored in a cache - * and then executed once the server becomes active. The normal use-case for this involves a live/backup pair. + * Validates if a JMS management operations will wait until the server is activated. If the server is not active then + * JMS management operations (e.g. create connection factory, create queue, etc.) should be stored in a cache and then + * executed once the server becomes active. The normal use-case for this involves a live/backup pair. */ public class ManagementActivationTest extends FailoverTestBase { @@ -178,10 +178,8 @@ public void testCreateTopic() throws Exception { } /** - * Since the back-up server is *not* active the "destroyConnectionFactory" operation should be cached and not run. - * If it was run we would receive an exception. This is for HORNETQ-911. - * - * @throws Exception + * Since the back-up server is *not* active the "destroyConnectionFactory" operation should be cached and not run. If + * it was run we would receive an exception. */ @Test public void testDestroyConnectionFactory() throws Exception { @@ -203,10 +201,8 @@ public void testDestroyConnectionFactory() throws Exception { } /** - * Since the back-up server is *not* active the "removeQueueFromJNDI" operation should be cached and not run. - * If it was run we would receive an exception. This is for HORNETQ-911. - * - * @throws Exception + * Since the back-up server is *not* active the "removeQueueFromJNDI" operation should be cached and not run. If it + * was run we would receive an exception. */ @Test public void testRemoveQueue() throws Exception { @@ -221,10 +217,8 @@ public void testRemoveQueue() throws Exception { } /** - * Since the back-up server is *not* active the "removeTopicFromJNDI" operation should be cached and not run. - * If it was run we would receive an exception. This is for HORNETQ-911. - * - * @throws Exception + * Since the back-up server is *not* active the "removeTopicFromJNDI" operation should be cached and not run. If it + * was run we would receive an exception. */ @Test public void testRemoveTopic() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java index ee392048fe9..cb564b9e473 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementWithPagingServerTest.java @@ -54,9 +54,7 @@ import org.junit.jupiter.api.Test; /** - * This class contains tests for core management - * functionalities that are affected by a server - * in paging mode. + * This class contains tests for core management functionalities that are affected by a server in paging mode. */ public class ManagementWithPagingServerTest extends ManagementTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java index 1e9a671cf4f..b3122b93692 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlTest.java @@ -132,9 +132,6 @@ public static Collection getParams() { } - /** - * @param durable - */ public QueueControlTest(boolean durable) { super(); this.durable = durable; @@ -1446,7 +1443,6 @@ public void testGetScheduledCount() throws Exception { session.deleteQueue(queue); } - //https://issues.jboss.org/browse/HORNETQ-1231 @TestTemplate public void testListDeliveringMessagesWithRASession() throws Exception { ServerLocator locator1 = createInVMNonHALocator().setBlockOnNonDurableSend(true).setConsumerWindowSize(10240).setAckBatchSize(0); @@ -1479,17 +1475,12 @@ public void testListDeliveringMessagesWithRASession() throws Exception { consumer = transSession.createConsumer(queue); transSession.start(); - /** + /* * the following latches are used to make sure that * - * 1. the first call on queueControl happens after the - * first message arrived at the message handler. - * - * 2. the message handler wait on the first message until - * the queueControl returns the right/wrong result. - * + * 1. the first call on queueControl happens after the first message arrived at the message handler. + * 2. the message handler wait on the first message until the queueControl returns the right/wrong result. * 3. the test exits after all messages are received. - * */ final CountDownLatch latch1 = new CountDownLatch(1); final CountDownLatch latch2 = new CountDownLatch(1); @@ -2883,19 +2874,20 @@ public void testCopyMessage(String protocol, boolean isLarge) throws Exception { } /** - * Moving message from another address to a single "child" queue of a multicast address - * + * Moving message from another address to a single "child" queue of a multicast address + *
                      {@code
                           *    
                      - * - * - * - *
                      - *
                      - * - * - * - * - *
                      + * + * + * + * + *
                      + * + * + * + * + *
                      + * }
                      */ @TestTemplate public void testMoveMessageToFQQN() throws Exception { @@ -3020,7 +3012,6 @@ public void testCopiedMessageProperties() throws Exception { *
                    • check there is only one message to consume from queue
                    • * */ - @TestTemplate public void testRemoveMessages() throws Exception { SimpleString key = SimpleString.of("key"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java index 5e7191e45a8..e3947fad2c2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java @@ -413,41 +413,26 @@ public String listMessageCounterHistory() throws Exception { return (String) proxy.invokeOperation("listMessageCounterHistory"); } - /** - * Returns the first message on the queue as JSON - */ @Override public String getFirstMessageAsJSON() throws Exception { return (String) proxy.invokeOperation("getFirstMessageAsJSON"); } - /** - * Returns the first message on the queue as JSON - */ @Override public String peekFirstMessageAsJSON() throws Exception { return (String) proxy.invokeOperation("peekFirstMessageAsJSON"); } - /** - * Returns the first scheduled message on the queue as JSON - */ @Override public String peekFirstScheduledMessageAsJSON() throws Exception { return (String) proxy.invokeOperation("peekFirstScheduledMessageAsJSON"); } - /** - * Returns the timestamp of the first message in milliseconds. - */ @Override public Long getFirstMessageTimestamp() throws Exception { return (Long) proxy.invokeOperation("getFirstMessageTimestamp"); } - /** - * Returns the age of the first message in milliseconds. - */ @Override public Long getFirstMessageAge() throws Exception { return (Long) proxy.invokeOperation(Long.class, "getFirstMessageAge"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java index a4bcd3c7651..f378c4a6d9b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/SecurityManagementWithConfiguredAdminUserTest.java @@ -39,8 +39,7 @@ public class SecurityManagementWithConfiguredAdminUserTest extends SecurityManag private final String invalidAdminPassword = "invalidAdminPassword"; /** - * default CLUSTER_ADMIN_USER must work even when there are other - * configured admin users + * default CLUSTER_ADMIN_USER must work even when there are other configured admin users */ @TestTemplate public void testSendManagementMessageWithClusterAdminUser() throws Exception { @@ -62,8 +61,6 @@ public void testSendManagementMessageWithoutUserCredentials() throws Exception { doSendBrokerManagementMessage(null, null, false); } - - @Override protected ActiveMQServer setupAndStartActiveMQServer() throws Exception { Configuration config = createDefaultInVMConfig().setSecurityEnabled(true); @@ -87,7 +84,4 @@ protected ActiveMQServer setupAndStartActiveMQServer() throws Exception { return server; } - - - } 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 e2d83260075..fd57a70a631 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 @@ -299,10 +299,9 @@ public void testUnsubscribeMQTT() throws Exception { @Test @Timeout(60) public void testSendAtMostOnceReceiveExactlyOnce() throws Exception { - /** - * Although subscribing with EXACTLY ONCE, the message gets published - * with AT_MOST_ONCE - in MQTT the QoS is always determined by the - * message as published - not the wish of the subscriber + /* + * Although subscribing with EXACTLY ONCE, the message gets published with AT_MOST_ONCE - in MQTT the QoS is + * always determined by the message as published - not the wish of the subscriber */ final MQTTClientProvider provider = getMQTTClientProvider(); initializeConnection(provider); 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 1138cd5d28f..089ac1da80c 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 @@ -259,9 +259,9 @@ protected String getTopicName() { } /** - * Initialize an MQTTClientProvider instance. By default this method uses the port that's - * assigned to be the TCP based port using the base version of addMQTTConnector. A subclass - * can either change the value of port or override this method to assign the correct port. + * Initialize an MQTTClientProvider instance. By default this method uses the port that's assigned to be the TCP + * based port using the base version of addMQTTConnector. A subclass can either change the value of port or override + * this method to assign the correct port. * * @param provider the MQTTClientProvider instance to initialize. * @throws Exception if an error occurs during initialization. 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 b5feaafaa9a..fcea19439d3 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 @@ -197,9 +197,7 @@ private MqttClient createPahoClient(String clientId) throws MqttException { return new MqttClient(protocol + "://localhost:" + getPort(), clientId, new MemoryPersistence()); } - /* - * This test was adapted from a test from Eclipse Kapua submitted by a community member. - */ + // This test was adapted from a test from Eclipse Kapua submitted by a community member. @TestTemplate @Timeout(60) public void testDollarAndHashSubscriptions() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/util/ResourceLoadingSslContext.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/util/ResourceLoadingSslContext.java index 497c42182e8..b06cfbfcf23 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/util/ResourceLoadingSslContext.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/util/ResourceLoadingSslContext.java @@ -58,10 +58,8 @@ public class ResourceLoadingSslContext extends SslContext { private String trustStorePassword; /** - * JSR-250 callback wrapper; converts checked exceptions to runtime exceptions - *

                      - * delegates to afterPropertiesSet, done to prevent backwards incompatible - * signature change. + * JSR-250 callback wrapper; converts checked exceptions to runtime exceptions delegates to afterPropertiesSet, done + * to prevent backwards incompatible signature change. */ @PostConstruct private void postConstruct() { @@ -73,7 +71,6 @@ private void postConstruct() { } /** - * @throws Exception * @org.apache.xbean.InitMethod */ public void afterPropertiesSet() throws Exception { 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 c815e8e09ca..3f80efe054f 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 @@ -63,7 +63,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/* +/** * General tests for things not covered directly in the specification. */ public class MQTT5Test extends MQTT5TestSupport { @@ -115,7 +115,7 @@ public void messageArrived(String t, MqttMessage message) { Wait.assertEquals(topic, receivedTopic::get, 500, 50); } - /* + /** * Ensure that the broker adds a timestamp on the message when sending via MQTT */ @Test @@ -201,7 +201,7 @@ public void messageArrived(String topic, MqttMessage message) { Wait.assertEquals(0L, () -> server.locateQueue(MQTTUtil.MQTT_SESSION_STORE).getMessageCount(), 5000, 100); } - /* + /** * Trying to reproduce error from https://issues.apache.org/jira/browse/ARTEMIS-1184 */ @Test @@ -234,7 +234,7 @@ public void testAddressAutoCreationNegative() throws Exception { assertNull(server.getAddressInfo(SimpleString.of(DESTINATION))); } - /* + /** * There is no normative statement in the spec about supporting user properties on will messages, but it is implied * in various places. */ @@ -283,7 +283,7 @@ public void messageArrived(String topic, MqttMessage message) { assertTrue(latch.await(2, TimeUnit.SECONDS)); } - /* + /** * It's possible for a client to change their session expiry interval via the DISCONNECT packet. Ensure we respect * a new session expiry interval when disconnecting. */ @@ -304,7 +304,7 @@ public void testExpiryDelayOnDisconnect() throws Exception { Wait.assertEquals(0, () -> getSessionStates().size(), 5000, 10); } - /* + /** * If the Will flag is false then don't send a will message even if the session expiry is > 0 */ @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/package-info.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/package-info.java index 2e5ce75a3dd..b7ec57d881b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/package-info.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/package-info.java @@ -26,6 +26,5 @@ * Summary of the new features in MQTT 5 vs. 3.1.1: * * https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901293 - * */ package org.apache.activemq.artemis.tests.integration.mqtt5; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/ControlPacketFormatTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/ControlPacketFormatTests.java index f96a9e19244..a3b9697d7c8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/ControlPacketFormatTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/ControlPacketFormatTests.java @@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not explicitly tested here): * * [MQTT-2.1.3-1] Where a flag bit is marked as “Reserved” it is reserved for future use and MUST be set to the value listed. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/DataFormatTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/DataFormatTests.java index ffaf5cfc447..74a6bce1595 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/DataFormatTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/DataFormatTests.java @@ -19,7 +19,7 @@ import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; import org.junit.jupiter.api.Disabled; -/** +/* * Fulfilled by client or Netty codec (i.e. not explicitly tested here): * * [MQTT-1.5.4-1] The character data in a UTF-8 Encoded String MUST be well-formed UTF-8 as defined by the Unicode specification [Unicode] and restated in RFC 3629 [RFC3629]. In particular, the character data MUST NOT include encodings of code points between U+D800 and U+DFFF. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/EnhancedAuthenticationTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/EnhancedAuthenticationTests.java index 989db7053df..078854dae4a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/EnhancedAuthenticationTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/EnhancedAuthenticationTests.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-4.12.0-3] The Client responds to an AUTH packet from the Server by sending a further AUTH packet. This packet MUST contain a Reason Code of 0x18 (Continue authentication). diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/FlowControlTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/FlowControlTests.java index 43889a7fcc4..875bd4a2938 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/FlowControlTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/FlowControlTests.java @@ -19,7 +19,7 @@ import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; import org.junit.jupiter.api.Disabled; -/** +/* * The MQTT 5 specification discusses a "send quota," but this is really an implementation detail and therefore not explicitly tested here: * * [MQTT-4.9.0-1] The Client or Server MUST set its initial send quota to a non-zero value not exceeding the Receive Maximum. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/HandlingErrorTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/HandlingErrorTests.java index 48442bb7661..8efe7c3878d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/HandlingErrorTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/HandlingErrorTests.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-4.13.1-1] When a Server detects a Malformed Packet or Protocol Error, and a Reason Code is given in the specification, it MUST close the Network Connection. @@ -37,10 +37,10 @@ public class HandlingErrorTests extends MQTT5TestSupport { - /* + /** * [MQTT-4.13.2-1] The CONNACK and DISCONNECT packets allow a Reason Code of 0x80 or greater to indicate that the * Network Connection will be closed. If a Reason Code of 0x80 or greater is specified, then the Network Connection - * MUST be closed whether or not the CONNACK or DISCONNECT is sent. + * MUST be closed whether the CONNACK or DISCONNECT is sent. * * This is one possible error condition where a Reason Code > 0x80 is specified and the network connection is closed. */ diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageOrderingTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageOrderingTests.java index 3f8d120d3e9..61ad2e7d8bd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageOrderingTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageOrderingTests.java @@ -19,7 +19,7 @@ import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; import org.junit.jupiter.api.Disabled; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-4.6.0-1] When the Client re-sends any PUBLISH packets, it MUST re-send them in the order in which the original PUBLISH packets were sent (this applies to QoS 1 and QoS 2 messages). diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageReceiptTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageReceiptTests.java index a11e313023f..a793fb737b4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageReceiptTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/MessageReceiptTests.java @@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-4.5.0-2] The Client MUST acknowledge any Publish packet it receives according to the applicable QoS rules regardless of whether it elects to process the Application Message that it contains. @@ -38,7 +38,7 @@ public class MessageReceiptTests extends MQTT5TestSupport { - /* + /** * [MQTT-4.5.0-1] When a Server takes ownership of an incoming Application Message it MUST add it to the Session * State for those Clients that have matching Subscriptions. * diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/NetworkConnectionTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/NetworkConnectionTests.java index 659375ba3fc..e996be1643c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/NetworkConnectionTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/NetworkConnectionTests.java @@ -19,7 +19,7 @@ import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; import org.junit.jupiter.api.Disabled; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested explicitly here, but tested implicitly through all the tests using TCP): * * [MQTT-4.2.0-1] A Client or Server MUST support the use of one or more underlying transport protocols that provide an ordered, lossless, stream of bytes from the Client to Server and Server to Client. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/QoSTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/QoSTests.java index 008d0525d46..5e4ef175cd0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/QoSTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/QoSTests.java @@ -47,7 +47,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-4.3.1-1] In the QoS 0 delivery protocol, the sender MUST send a PUBLISH packet with QoS 0 and DUP flag set to 0. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SessionStateTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SessionStateTests.java index e5b2bc9b131..d28e806ab73 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SessionStateTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SessionStateTests.java @@ -19,7 +19,7 @@ import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; import org.junit.jupiter.api.Disabled; -/** +/* * Unsure how to test this as it's a negative. Many other tests exercise this implicitly: * * [MQTT-4.1.0-1] The Client and Server MUST NOT discard the Session State while the Network Connection is open. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SubscriptionTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SubscriptionTests.java index afc600b5ab7..8929680f33f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SubscriptionTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/SubscriptionTests.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-4.8.2-1] A Shared Subscription's Topic Filter MUST start with $share/ and MUST contain a ShareName that is at least one character long. @@ -50,7 +50,7 @@ public class SubscriptionTests extends MQTT5TestSupport { - /* + /** * [MQTT-4.8.2-3] The Server MUST respect the granted QoS for the Client's subscription. */ @Test @@ -114,7 +114,7 @@ public void messageArrived(String incomingTopic, MqttMessage message) throws Exc consumer2.close(); } - /* + /** * [MQTT-4.8.2-6] If a Client responds with a PUBACK or PUBREC containing a Reason Code of 0x80 or greater to a * PUBLISH packet from the Server, the Server MUST discard the Application Message and not attempt to send it to any * other Subscriber. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/TopicNameAndFilterTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/TopicNameAndFilterTests.java index 69977f3a13a..bcf460595fb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/TopicNameAndFilterTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/TopicNameAndFilterTests.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-4.7.0-1] The wildcard characters can be used in Topic Filters, but MUST NOT be used within a Topic Name. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/WebSocketTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/WebSocketTests.java index e725ca35500..c84e0844cb3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/WebSocketTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/WebSocketTests.java @@ -19,7 +19,7 @@ import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; import org.junit.jupiter.api.Disabled; -/** +/* * Fulfilled by client (i.e. not tested here): * * [MQTT-6.0.0-1] MQTT Control Packets MUST be sent in WebSocket binary data frames. If any other type of data frame is received the recipient MUST close the Network Connection. @@ -34,7 +34,6 @@ * This is tested implicitly as almost all tests are run using both TCP and WebSocket connections. The subprotocol is defined in org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolManager#websocketRegistryNames: * * [MQTT-6.0.0-4] The WebSocket Subprotocol name selected and returned by the Server MUST be “mqtt”. - * */ @Disabled diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/AuthTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/AuthTests.java index c1da8ff2c0d..14b63af17ce 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/AuthTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/AuthTests.java @@ -19,7 +19,7 @@ import org.apache.activemq.artemis.tests.integration.mqtt5.MQTT5TestSupport; import org.junit.jupiter.api.Disabled; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-3.15.1-1] Bits 3,2,1 and 0 of the Fixed Header of the AUTH packet are reserved and MUST all be set to 0. The Client or Server MUST treat any other value as malformed and close the Network Connection. @@ -34,7 +34,6 @@ * Not implemented. * * [MQTT-3.15.2-1] The sender of the AUTH Packet MUST use one of the Authenticate Reason Codes. - * */ @Disabled diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnAckTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnAckTests.java index 82ec0f7f013..1fc8cf06f7a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnAckTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnAckTests.java @@ -52,7 +52,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-3.2.2-1] Byte 1 is the "Connect Acknowledge Flags". Bits 7-1 are reserved and MUST be set to 0. @@ -84,7 +84,6 @@ * * [MQTT-3.2.2-19] The Server MUST NOT send this (i.e. Reason String) property if it would increase the size of the CONNACK packet beyond the Maximum Packet Size specified by the Client. * [MQTT-3.2.2-20] The Server MUST NOT send this (i.e. User Property) property if it would increase the size of the CONNACK packet beyond the Maximum Packet Size specified by the Client. - * */ public class ConnAckTests extends MQTT5TestSupport { @@ -412,7 +411,7 @@ public void testMaxPacketSizeZero() throws Exception { * [MQTT-3.2.2-18] If Topic Alias Maximum is absent or 0, the Client MUST NOT send any Topic Aliases on to the * Server. * - * This doesn't test whether or not the client actually sends topic aliases as that's up to the client + * This doesn't test whether the client actually sends topic aliases as that's up to the client * implementation. This just tests that the expected property value is returned to the client based on the broker's * setting. * @@ -433,7 +432,7 @@ public void testTopicAliasMaxNegativeOne() throws Exception { /* * [MQTT-3.2.2-18] Topic Alias Maximum is absent, the Client MUST NOT send any Topic Aliases on to the Server. * - * This doesn't test whether or not the client actually sends topic aliases as that's up to the client + * This doesn't test whether the client actually sends topic aliases as that's up to the client * implementation. This just tests that the expected property value is returned to the client based on the broker's * setting. * 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 41c164a98c4..4d5788fdd9a 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 @@ -55,7 +55,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-3.1.0-1] After a Network Connection is established by a Client to a Server, the first packet sent from the Client to the Server MUST be a CONNECT packet. * diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/DisconnectTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/DisconnectTests.java index 34a760009db..814f7e46978 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/DisconnectTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/DisconnectTests.java @@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-3.14.1-1] The Client or Server MUST validate that reserved bits are set to 0. If they are not zero it sends a DISCONNECT packet with a Reason code of 0x81 (Malformed Packet). diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubAckTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubAckTests.java index d1042c36633..19b61370f6e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubAckTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubAckTests.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * The broker doesn't send any "Reason String" or "User Property" in the PUBACK packet for any reason. Therefore, these are not tested here: * * [MQTT-3.4.2-2] The sender MUST NOT send this property if it would increase the size of the PUBACK packet beyond the Maximum Packet Size specified by the receiver. @@ -41,7 +41,7 @@ public class PubAckTests extends MQTT5TestSupport { - /* + /** * [MQTT-3.4.2-1] The Client or Server sending the PUBACK packet MUST use one of the PUBACK Reason Codes. */ @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubCompTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubCompTests.java index 16bc39a8cac..fab6756475f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubCompTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubCompTests.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * The broker doesn't send any "Reason String" or "User Property" in the PUBCOMP packet for any reason. Therefore, these are not tested here: * * [MQTT-3.7.2-2] The sender MUST NOT use this Property if it would increase the size of the PUBCOMP packet beyond the Maximum Packet Size specified by the receiver. @@ -41,7 +41,7 @@ public class PubCompTests extends MQTT5TestSupport { - /* + /** * [MQTT-3.7.2-1] The Client or Server sending the PUBCOMP packets MUST use one of the PUBCOMP Reason Codes. */ @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRecTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRecTests.java index 69a4d18dd32..effdcc2b9c6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRecTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRecTests.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * The broker doesn't send any "Reason String" or "User Property" in the PUBREL packet for any reason. Therefore, these are not tested here: * * [MQTT-3.5.2-2] The sender MUST NOT send this property if it would increase the size of the PUBREC packet beyond the Maximum Packet Size specified by the receiver. @@ -41,7 +41,7 @@ public class PubRecTests extends MQTT5TestSupport { - /* + /** * [MQTT-3.5.2-1] The Client or Server sending the PUBREC packet MUST use one of the PUBREC Reason Codes. */ @Test diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRelTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRelTests.java index e7b3bf51bbc..8267c0238be 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRelTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/PubRelTests.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-3.6.1-1] Bits 3,2,1 and 0 of the Fixed Header in the PUBREL packet are reserved and MUST be set to 0,0,1 and 0 respectively. The Server MUST treat any other value as malformed and close the Network Connection. 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 e6bcc65781e..fcb6f02d7da 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 @@ -57,7 +57,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-3.3.2-1] The Topic Name MUST be present as the first field in the PUBLISH packet Variable Header. It MUST be a UTF-8 Encoded String. @@ -86,7 +86,7 @@ public class PublishTests extends MQTT5TestSupport { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - /* + /** * [MQTT-3.3.1-1] The DUP flag MUST be set to 1 by the Client or Server when it attempts to re-deliver a PUBLISH * packet. */ @@ -149,7 +149,7 @@ public void testDupFlag() throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.1-2] The DUP flag MUST be set to 0 for all QoS 0 messages. */ @Test @@ -181,7 +181,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.1-3] The DUP flag in the outgoing PUBLISH packet is set independently to the incoming PUBLISH packet, * its value MUST be determined solely by whether the outgoing PUBLISH packet is a retransmission. * @@ -221,7 +221,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.1-5] If the RETAIN flag is set to 1 in a PUBLISH packet sent by a Client to a Server, the Server MUST * replace any existing retained message for this topic and store the Application Message. */ @@ -258,7 +258,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.1-6] If the Payload contains zero bytes it is processed normally by the Server but any retained message * with the same topic name MUST be removed and any future subscribers for the topic will not receive a retained * message. @@ -305,7 +305,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.1-8] If the RETAIN flag is 0 in a PUBLISH packet sent by a Client to a Server, the Server MUST NOT store * the message as a retained message and MUST NOT remove or replace any existing retained message. */ @@ -351,7 +351,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * When a new Non‑shared Subscription is made, the last retained message, if any, on each matching topic name is sent * to the Client as directed by the Retain Handling Subscription Option. These messages are sent with the RETAIN flag * set to 1. Which retained messages are sent is controlled by the Retain Handling Subscription Option. At the time @@ -368,7 +368,7 @@ public void testRetainHandlingZeroWithOneSubscription() throws Exception { internalTestRetainHandlingZero(false, 1); } - /* + /** * When a new Non‑shared Subscription is made, the last retained message, if any, on each matching topic name is sent * to the Client as directed by the Retain Handling Subscription Option. These messages are sent with the RETAIN flag * set to 1. Which retained messages are sent is controlled by the Retain Handling Subscription Option. At the time @@ -385,7 +385,7 @@ public void testRetainHandlingZeroWithMultipleSubscriptions() throws Exception { internalTestRetainHandlingZero(false, 25); } - /* + /** * When a new Non‑shared Subscription is made, the last retained message, if any, on each matching topic name is sent * to the Client as directed by the Retain Handling Subscription Option. These messages are sent with the RETAIN flag * set to 1. Which retained messages are sent is controlled by the Retain Handling Subscription Option. At the time @@ -467,7 +467,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * When a new Non‑shared Subscription is made, the last retained message, if any, on each matching topic name is sent * to the Client as directed by the Retain Handling Subscription Option. These messages are sent with the RETAIN flag * set to 1. Which retained messages are sent is controlled by the Retain Handling Subscription Option. At the time @@ -536,7 +536,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * When a new Non‑shared Subscription is made, the last retained message, if any, on each matching topic name is sent * to the Client as directed by the Retain Handling Subscription Option. These messages are sent with the RETAIN flag * set to 1. Which retained messages are sent is controlled by the Retain Handling Subscription Option. At the time @@ -579,7 +579,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * The setting of the RETAIN flag in an Application Message forwarded by the Server from an *established* connection * is controlled by the Retain As Published subscription option. * @@ -624,7 +624,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * The setting of the RETAIN flag in an Application Message forwarded by the Server from an *established* connection * is controlled by the Retain As Published subscription option. * @@ -685,7 +685,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.2-3] The Topic Name in a PUBLISH packet sent by a Server to a subscribing Client MUST match the * Subscription’s Topic Filter. */ @@ -725,7 +725,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.2-3] The Topic Name in a PUBLISH packet sent by a Server to a subscribing Client MUST match the * Subscription’s Topic Filter. */ @@ -764,7 +764,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.2-4] A Server MUST send the Payload Format Indicator unaltered to all subscribers receiving the message. */ @Test @@ -773,7 +773,7 @@ public void testPayloadFormatIndicatorTrue() throws Exception { internalTestPayloadFormatIndicator(true); } - /* + /** * [MQTT-3.3.2-4] A Server MUST send the Payload Format Indicator unaltered to all subscribers receiving the message. */ @Test @@ -823,7 +823,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.2-5] If the Message Expiry Interval has passed and the Server has not managed to start onward delivery * to a matching subscriber, then it MUST delete the copy of the message for that subscriber. */ @@ -871,7 +871,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.disconnect(); } - /* + /** * [MQTT-3.3.2-6] The PUBLISH packet sent to a Client by the Server MUST contain a Message Expiry Interval set to the * received value minus the time that the message has been waiting in the Server. */ @@ -925,7 +925,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.disconnect(); } - /* + /** * [MQTT-3.3.2-11] A Server MUST NOT send a PUBLISH packet with a Topic Alias greater than the Topic Alias Maximum * value sent by the Client in the CONNECT packet. */ @@ -967,7 +967,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.disconnect(); } - /* + /** * [MQTT-3.3.2-7] A receiver MUST NOT carry forward any Topic Alias mappings from one Network Connection to another. * * Unfortunately the Paho MQTT 5 client performs automatic validation and therefore refuses to send a message with an @@ -1018,7 +1018,7 @@ public void testTopicAliasesNotCarriedForward() throws Exception { producer.close(); } - /* + /** * [MQTT-3.3.2-12] A Server MUST accept all Topic Alias values greater than 0 and less than or equal to the Topic * Alias Maximum value that it returned in the CONNACK packet. */ @@ -1061,7 +1061,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.disconnect(); } - /* + /** * From section 3.3.2.3.4 of the MQTT 5 specification: * * A sender can modify the Topic Alias mapping by sending another PUBLISH in the same Network Connection with the @@ -1127,7 +1127,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer2.close(); } - /* + /** * [MQTT-3.3.2-15] The Server MUST send the Response Topic unaltered to all subscribers receiving the Application * Message. */ @@ -1166,7 +1166,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.2-16] The Server MUST send the Correlation Data unaltered to all subscribers receiving the Application * Message. */ @@ -1205,7 +1205,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.2-17] The Server MUST send all User Properties unaltered in a PUBLISH packet when forwarding the * Application Message to a Client. * @@ -1254,7 +1254,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.2-20] A Server MUST send the Content Type unaltered to all subscribers receiving the Application * Message. */ @@ -1293,7 +1293,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.4-1] The receiver of a PUBLISH Packet MUST respond with the packet as determined by the QoS in the * PUBLISH Packet. * @@ -1307,7 +1307,7 @@ public void testQoS2() throws Exception { internalTestQoS(2); } - /* + /** * [MQTT-3.3.4-1] The receiver of a PUBLISH Packet MUST respond with the packet as determined by the QoS in the * PUBLISH Packet. * @@ -1319,7 +1319,7 @@ public void testQoS1() throws Exception { internalTestQoS(1); } - /* + /** * [MQTT-3.3.4-1] The receiver of a PUBLISH Packet MUST respond with the packet as determined by the QoS in the * PUBLISH Packet. * @@ -1359,7 +1359,7 @@ public void deliveryComplete(IMqttToken token) { producer.close(); } - /* + /** * [MQTT-3.3.4-2] When Clients make subscriptions with Topic Filters that include wildcards, it is possible for a * Client’s subscriptions to overlap so that a published message might match multiple filters. In this case the * Server MUST deliver the message to the Client respecting the maximum QoS of all the matching subscriptions. @@ -1444,7 +1444,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { } } - /* + /** * [MQTT-3.3.4-3] If the Client specified a Subscription Identifier for any of the overlapping subscriptions the * Server MUST send those Subscription Identifiers in the message which is published as the result of the * subscriptions. @@ -1520,7 +1520,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.4-3] If the Client specified a Subscription Identifier for any of the overlapping subscriptions the * Server MUST send those Subscription Identifiers in the message which is published as the result of the * subscriptions. @@ -1592,12 +1592,12 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.4-9] The Server MUST NOT send more than Receive Maximum QoS 1 and QoS 2 PUBLISH packets for which it has * not received PUBACK, PUBCOMP, or PUBREC with a Reason Code of 128 or greater from the Client. * * This is impossible to test with the Paho client directly because it doesn't invoke the callback concurrently. - * Therefore, we must use interceptors as a kind of hack to determine whether or not we're implementing flow control + * Therefore, we must use interceptors as a kind of hack to determine whether we're implementing flow control * properly. */ @Test @@ -1658,7 +1658,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.4-9] The Server MUST NOT send more than Receive Maximum QoS 1 and QoS 2 PUBLISH packets for which it has * not received PUBACK, PUBCOMP, or PUBREC with a Reason Code of 128 or greater from the Client. * @@ -1722,7 +1722,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { consumer.close(); } - /* + /** * [MQTT-3.3.4-10] The Server MUST NOT delay the sending of any packets other than PUBLISH packets due to having sent * Receive Maximum PUBLISH packets without receiving acknowledgements for them. * diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubAckTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubAckTests.java index c07350164ce..89c31c419b3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubAckTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubAckTests.java @@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * The broker doesn't send any "Reason String" or "User Property" in the SUBACK packet for any reason. Therefore, these are not tested here: * * [MQTT-3.9.2-1] The Server MUST NOT send this Property if it would increase the size of the SUBACK packet beyond the Maximum Packet Size specified by the Client. @@ -38,7 +38,7 @@ public class SubAckTests extends MQTT5TestSupport { - /* + /** * [MQTT-3.9.3-1] The order of Reason Codes in the SUBACK packet MUST match the order of Topic Filters in the * SUBSCRIBE packet. * diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTests.java index d2e6b281015..06bb6538922 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/SubscribeTests.java @@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-3.8.1-1] Bits 3,2,1 and 0 of the Fixed Header of the SUBSCRIBE packet are reserved and MUST be set to 0,0,1 and 0 respectively. The Server MUST treat any other value as malformed and close the Network Connection @@ -55,7 +55,7 @@ public class SubscribeTests extends MQTT5TestSupport { - /* + /** * [MQTT-3.8.3-3] Bit 2 of the Subscription Options represents the No Local option. If the value is 1, Application * Messages MUST NOT be forwarded to a connection with a ClientID equal to the ClientID of the publishing connection. */ @@ -82,7 +82,7 @@ public void testSubscribeNoLocal() throws Exception { client.close(); } - /* + /** * [MQTT-3.8.3-3] * * This test was adapted from Test.test_request_response in client_test5.py at https://github.com/eclipse/paho.mqtt.testing/tree/master/interoperability @@ -152,8 +152,9 @@ public void messageArrived(String topic, MqttMessage message) throws Exception { bclient.close(); } - /* - * [MQTT-3.8.4-1] When the Server receives a SUBSCRIBE packet from a Client, the Server MUST respond with a SUBACK packet. + /** + * [MQTT-3.8.4-1] When the Server receives a SUBSCRIBE packet from a Client, the Server MUST respond with a SUBACK + * packet. */ @Test @Timeout(DEFAULT_TIMEOUT_SEC) @@ -190,8 +191,9 @@ public void testSubAck() throws Exception { consumer.close(); } - /* - * [MQTT-3.8.4-2] The SUBACK packet MUST have the same Packet Identifier as the SUBSCRIBE packet that it is acknowledging. + /** + * [MQTT-3.8.4-2] The SUBACK packet MUST have the same Packet Identifier as the SUBSCRIBE packet that it is + * acknowledging. */ @Test @Timeout(DEFAULT_TIMEOUT_SEC) @@ -231,7 +233,7 @@ public void testSubAckPacketId() throws Exception { consumer.close(); } - /* + /** * [MQTT-3.8.4-3] If a Server receives a SUBSCRIBE packet containing a Topic Filter that is identical to a Non‑shared * Subscription’s Topic Filter for the current Session then it MUST replace that existing Subscription with a new * Subscription. @@ -270,7 +272,7 @@ public void testReplaceSubscription() throws Exception { client.close(); } - /* + /** * [MQTT-3.8.4-4] If the Retain Handling option is 0, any existing retained messages matching the Topic Filter MUST * be re-sent, but Application Messages MUST NOT be lost due to replacing the Subscription. */ @@ -304,7 +306,7 @@ public void testReplaceSubscriptionRetainHandling() throws Exception { client.close(); } - /* + /** * [MQTT-3.8.4-5] If a Server receives a SUBSCRIBE packet that contains multiple Topic Filters it MUST handle that * packet as if it had received a sequence of multiple SUBSCRIBE packets, except that it combines their responses * into a single SUBACK response. @@ -359,7 +361,7 @@ public void testSubscribeAck() throws Exception { consumer.close(); } - /* + /** * [MQTT-3.8.4-8] The QoS of Payload Messages sent in response to a Subscription MUST be the minimum of the QoS of * the originally published message and the Maximum QoS granted by the Server. * diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubAckTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubAckTests.java index dc2a817c4c4..ec27be26dab 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubAckTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubAckTests.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * The broker doesn't send any "Reason String" or "User Property" in the UNSUBACK packet for any reason. Therefore, these are not tested here: * * [MQTT-3.11.2-1] The Server MUST NOT send this Property if it would increase the size of the UNSUBACK packet beyond the Maximum Packet Size specified by the Client. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubscribeTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubscribeTests.java index 80603a2ae4f..8e2b74e4ceb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubscribeTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/UnsubscribeTests.java @@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -/** +/* * Fulfilled by client or Netty codec (i.e. not tested here): * * [MQTT-3.10.1-1] Bits 3,2,1 and 0 of the Fixed Header of the UNSUBSCRIBE packet are reserved and MUST be set to 0,0,1 and 0 respectively. The Server MUST treat any other value as malformed and close the Network Connection diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/package-info.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/package-info.java index 1dae9857291..385a285bbf4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/package-info.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/package-info.java @@ -18,6 +18,5 @@ * This package contains all the tests for the MQTT 5 "control packets" defined at: * * https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901032 - * */ package org.apache.activemq.artemis.tests.integration.mqtt5.spec.controlpackets; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/CertificateAuthenticationSslTests.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/CertificateAuthenticationSslTests.java index f2aca668856..81f99b1e739 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/CertificateAuthenticationSslTests.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/ssl/CertificateAuthenticationSslTests.java @@ -92,9 +92,7 @@ protected void configureBrokerSecurity(ActiveMQServer server) { server.getConfiguration().putSecurityRoles("#", roles); } - /* - * Basic mutual SSL test with certificate-based authentication - */ + // Basic mutual SSL test with certificate-based authentication @TestTemplate @Timeout(DEFAULT_TIMEOUT_SEC) public void testSimpleSendReceive() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/BasicOpenWireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/BasicOpenWireTest.java index ed376b84c96..f47a4fc2404 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/BasicOpenWireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/BasicOpenWireTest.java @@ -186,11 +186,6 @@ protected void sendMessages(Connection connection, Destination destination, int session.close(); } - /** - * @param messsage - * @param firstSet - * @param secondSet - */ protected void assertTextMessagesEqual(String messsage, Message[] firstSet, Message[] secondSet) throws JMSException { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java index 127a125083d..f12b93a0178 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java @@ -1065,8 +1065,6 @@ public void testFailoverTransportReconnect() throws Exception { /** * This is the example shipped with the distribution - * - * @throws Exception */ @Test public void testOpenWireExample() throws Exception { @@ -1106,8 +1104,6 @@ public void testOpenWireExample() throws Exception { /** * This is the example shipped with the distribution - * - * @throws Exception */ @Test public void testMultipleConsumers() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/TempQueueWithDotTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/TempQueueWithDotTest.java index 35b671aa051..0e0e7bb674e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/TempQueueWithDotTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/TempQueueWithDotTest.java @@ -31,8 +31,10 @@ import org.apache.activemq.artemis.utils.Wait; import org.junit.jupiter.api.Test; -/** This test would fail only if your hostname contains dot on its name. - * my box name was in the format of xxx-xxx.xxx when it failed. */ +/** + * This test would fail only if your hostname contains dot on its name. my box name was in the format of xxx-xxx.xxx + * when it failed. + */ public class TempQueueWithDotTest extends BasicOpenWireTest { @Override @@ -42,9 +44,10 @@ protected Configuration createDefaultConfig(final int serverID, final boolean ne return configuration; } - /** This fails sometimes on some computers depending on your computer name. - * It failed for me when I used xxx-xxxx.xxx. - * As Openwire will use your uname as the temp queue ID. */ + /** + * This fails sometimes on some computers depending on your computer name. It failed for me when I used xxx-xxxx.xxx. + * As Openwire will use your uname as the temp queue ID. + */ @Test public void testSimple() throws Exception { testSimple("OPENWIRE"); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/VerySimpleOenwireTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/VerySimpleOenwireTest.java index dccee6d7dc3..3027015f66b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/VerySimpleOenwireTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/VerySimpleOenwireTest.java @@ -31,13 +31,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -/** This is useful to debug connection ordering. There's only one connection being made from these tests */ +/** + * This is useful to debug connection ordering. There's only one connection being made from these tests + */ public class VerySimpleOenwireTest extends OpenWireTestBase { /** * This is the example shipped with the distribution - * - * @throws Exception */ @Test public void testOpenWireExample() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSDurableTopicRedeliverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSDurableTopicRedeliverTest.java index 0580f797d61..408373cfdfa 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSDurableTopicRedeliverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSDurableTopicRedeliverTest.java @@ -42,8 +42,6 @@ public void setUp() throws Exception { /** * Sends and consumes the messages. - * - * @throws Exception */ @Test public void testRedeliverNewSession() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSIndividualAckTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSIndividualAckTest.java index d9062eeba66..a800123b587 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSIndividualAckTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSIndividualAckTest.java @@ -40,8 +40,6 @@ public class JMSIndividualAckTest extends BasicOpenWireTest { /** * Tests if acknowledged messages are being consumed. - * - * @throws JMSException */ @Test public void testAckedMessageAreConsumed() throws JMSException { @@ -71,8 +69,6 @@ public void testAckedMessageAreConsumed() throws JMSException { /** * Tests if acknowledged messages are being consumed. - * - * @throws JMSException */ @Test public void testLastMessageAcked() throws JMSException { @@ -117,8 +113,6 @@ public void testLastMessageAcked() throws JMSException { /** * Tests if unacknowledged messages are being re-delivered when the consumer * connects again. - * - * @throws JMSException */ @Test public void testUnAckedMessageAreNotConsumedOnSessionClose() throws JMSException { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsAutoAckTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsAutoAckTest.java index 6459c9bc34d..bd73363ef9c 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsAutoAckTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsAutoAckTest.java @@ -36,8 +36,6 @@ public class JmsAutoAckTest extends BasicOpenWireTest { /** * Tests if acknowledged messages are being consumed. - * - * @throws javax.jms.JMSException */ @Test public void testAckedMessageAreConsumed() throws JMSException { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsClientAckTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsClientAckTest.java index 8551ce9f8b4..5b9179fba60 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsClientAckTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsClientAckTest.java @@ -42,8 +42,6 @@ public class JmsClientAckTest extends BasicOpenWireTest { /** * Tests if acknowledged messages are being consumed. - * - * @throws JMSException */ @Test public void testAckedMessageAreConsumed() throws JMSException { @@ -73,8 +71,6 @@ public void testAckedMessageAreConsumed() throws JMSException { /** * Tests if acknowledged messages are being consumed. - * - * @throws JMSException */ @Test public void testLastMessageAcked() throws JMSException { @@ -110,8 +106,6 @@ public void testLastMessageAcked() throws JMSException { /** * Tests if unacknowledged messages are being re-delivered when the consumer connects again. - * - * @throws JMSException */ @Test public void testUnAckedMessageAreNotConsumedOnSessionClose() throws JMSException { @@ -143,8 +137,6 @@ public void testUnAckedMessageAreNotConsumedOnSessionClose() throws JMSException /** * Tests if acknowledged messages are being consumed. - * - * @throws JMSException */ @Test public void testAckedMessageDeliveringWithPrefetch() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsConnectionStartStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsConnectionStartStopTest.java index 2f7a250fb50..e36142b97a0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsConnectionStartStopTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsConnectionStartStopTest.java @@ -66,10 +66,7 @@ public void tearDown() throws Exception { } /** - * Tests if the consumer receives the messages that were sent before the - * connection was started. - * - * @throws JMSException + * Tests if the consumer receives the messages that were sent before the connection was started. */ @Test public void testStoppedConsumerHoldsMessagesTillStarted() throws JMSException { @@ -102,10 +99,7 @@ public void testStoppedConsumerHoldsMessagesTillStarted() throws JMSException { } /** - * Tests if the consumer is able to receive messages eveb when the - * connecction restarts multiple times. - * - * @throws Exception + * Tests if the consumer is able to receive messages eveb when the connecction restarts multiple times. */ @Test public void testMultipleConnectionStops() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsConsumerResetActiveListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsConsumerResetActiveListenerTest.java index ede3ef02137..46a5113e3ac 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsConsumerResetActiveListenerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsConsumerResetActiveListenerTest.java @@ -43,10 +43,7 @@ public class JmsConsumerResetActiveListenerTest extends BasicOpenWireTest { /** - * verify the (undefined by spec) behaviour of setting a listener while - * receiving a message. - * - * @throws Exception + * verify the (undefined by spec) behaviour of setting a listener while receiving a message. */ @Test public void testSetListenerFromListener() throws Exception { @@ -95,8 +92,6 @@ public void onMessage(Message message) { /** * and a listener on a new consumer, just in case. - * - * @throws Exception */ @Test public void testNewConsumerSetListenerFromListener() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsCreateConsumerInOnMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsCreateConsumerInOnMessageTest.java index 8ea08f5271e..b2fe743f173 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsCreateConsumerInOnMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsCreateConsumerInOnMessageTest.java @@ -48,8 +48,6 @@ public class JmsCreateConsumerInOnMessageTest extends BasicOpenWireTest implemen /** * Tests if a consumer can be created asynchronusly - * - * @throws Exception */ @Test public void testCreateConsumer() throws Exception { @@ -76,8 +74,6 @@ public void testCreateConsumer() throws Exception { /** * Use the asynchronous subscription mechanism - * - * @param message */ @Override public void onMessage(Message message) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsDurableTopicSendReceiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsDurableTopicSendReceiveTest.java index 14019efce3d..468903d20dd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsDurableTopicSendReceiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsDurableTopicSendReceiveTest.java @@ -57,8 +57,6 @@ public void setUp() throws Exception { /** * Test if all the messages sent are being received. - * - * @throws Exception */ @Test public void testSendWhileClosed() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsQueueBrowserTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsQueueBrowserTest.java index e63dcd5c303..8256a1dace5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsQueueBrowserTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsQueueBrowserTest.java @@ -40,11 +40,8 @@ public class JmsQueueBrowserTest extends BasicOpenWireTest { /** - * Tests the queue browser. Browses the messages then the consumer tries to - * receive them. The messages should still be in the queue even when it was - * browsed. - * - * @throws Exception + * Tests the queue browser. Browses the messages then the consumer tries to receive them. The messages should still + * be in the queue even when it was browsed. */ @Test public void testReceiveBrowseReceive() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java index 76e9359df3c..78edb058930 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java @@ -64,8 +64,7 @@ public Session createSession(Connection conn) throws JMSException { } /** - * @see org.apache.activemq.test.JmsResourceProvider#createConsumer(javax.jms.Session, - * javax.jms.Destination) + * @see org.apache.activemq.test.JmsResourceProvider#createConsumer(javax.jms.Session, javax.jms.Destination) */ public MessageConsumer createConsumer(Session session, Destination destination) throws JMSException { if (isDurableSubscriber()) { @@ -89,8 +88,7 @@ public ConnectionConsumer createConnectionConsumer(Connection connection, /** * Creates a producer. * - * @see org.apache.activemq.test.JmsResourceProvider#createProducer(javax.jms.Session, - * javax.jms.Destination) + * @see org.apache.activemq.test.JmsResourceProvider#createProducer(javax.jms.Session, javax.jms.Destination) */ public MessageProducer createProducer(Session session, Destination destination) throws JMSException { MessageProducer producer = session.createProducer(destination); @@ -101,8 +99,7 @@ public MessageProducer createProducer(Session session, Destination destination) /** * Creates a destination, which can either a topic or a queue. * - * @see Assertions#createDestination(javax.jms.Session, - * java.lang.String) + * @see Assertions#createDestination(javax.jms.Session, java.lang.String) */ public Destination createDestination(Session session, JmsTransactionTestSupport support) throws JMSException { if (isTopic) { @@ -112,64 +109,30 @@ public Destination createDestination(Session session, JmsTransactionTestSupport } } - /** - * Returns true if the subscriber is durable. - * - * @return isDurableSubscriber - */ public boolean isDurableSubscriber() { return isTopic && durableName != null; } - /** - * Returns the acknowledgement mode. - * - * @return Returns the ackMode. - */ public int getAckMode() { return ackMode; } - /** - * Sets the acnknowledgement mode. - * - * @param ackMode The ackMode to set. - */ public void setAckMode(int ackMode) { this.ackMode = ackMode; } - /** - * Returns true if the destination is a topic, false if the destination is a - * queue. - * - * @return Returns the isTopic. - */ public boolean isTopic() { return isTopic; } - /** - * @param isTopic The isTopic to set. - */ public void setTopic(boolean isTopic) { this.isTopic = isTopic; } - /** - * Return true if the session is transacted. - * - * @return Returns the transacted. - */ public boolean isTransacted() { return transacted; } - /** - * Sets the session to be transacted. - * - * @param transacted - */ public void setTransacted(boolean transacted) { this.transacted = transacted; if (transacted) { @@ -177,56 +140,26 @@ public void setTransacted(boolean transacted) { } } - /** - * Returns the delivery mode. - * - * @return deliveryMode - */ public int getDeliveryMode() { return deliveryMode; } - /** - * Sets the delivery mode. - * - * @param deliveryMode - */ public void setDeliveryMode(int deliveryMode) { this.deliveryMode = deliveryMode; } - /** - * Returns the client id. - * - * @return clientID - */ public String getClientID() { return clientID; } - /** - * Sets the client id. - * - * @param clientID - */ public void setClientID(String clientID) { this.clientID = clientID; } - /** - * Returns the durable name of the provider. - * - * @return durableName - */ public String getDurableName() { return durableName; } - /** - * Sets the durable name of the provider. - * - * @param durableName - */ public void setDurableName(String durableName) { this.durableName = durableName; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsSendReceiveTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsSendReceiveTestSupport.java index cf98419697d..db0056d6dd5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsSendReceiveTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsSendReceiveTestSupport.java @@ -80,8 +80,6 @@ public void setUp() throws Exception { /** * Sends and consumes the messages. - * - * @throws Exception */ @Test public void testSendReceive() throws Exception { @@ -103,7 +101,6 @@ public void testSendReceive() throws Exception { * Tests if the messages received are valid. * * @param receivedMessages - list of received messages. - * @throws JMSException */ protected void assertMessagesReceivedAreValid(List receivedMessages) throws JMSException { List copyOfMessages = Arrays.asList(receivedMessages.toArray()); @@ -151,8 +148,6 @@ protected void waitForMessagesToBeDelivered() { /** * Asserts messages are received. - * - * @throws JMSException */ protected void assertMessagesAreReceived() throws JMSException { waitForMessagesToBeDelivered(); @@ -161,18 +156,11 @@ protected void assertMessagesAreReceived() throws JMSException { /** * Just a hook so can insert failure tests - * - * @throws Exception */ protected void messageSent() throws Exception { } - /* - * (non-Javadoc) - * - * @see javax.jms.MessageListener#onMessage(javax.jms.Message) - */ @Override public synchronized void onMessage(Message message) { consumeMessage(message, messages); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java index 481217e2f72..3d9ddf005ea 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java @@ -82,8 +82,6 @@ public void setUp() throws Exception { /** * Sends and consumes the messages. - * - * @throws Exception */ @Test public void testRecover() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRequestReplyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRequestReplyTest.java index 0512174b26b..eb4bfbaf0af 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRequestReplyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRequestReplyTest.java @@ -76,9 +76,6 @@ public void testSendAndReceive() throws Exception { // assertEquals("clientID from the temporary destination must be the // same", clientSideClientID, value); - /* build queues */ - - /* build requestmessage */ TextMessage requestMessage = session.createTextMessage("Olivier"); requestMessage.setJMSReplyTo(replyDestination); @@ -169,7 +166,7 @@ public void setUp() throws Exception { requestDestination = createDestination(serverSession); - /* build queues */ + // build queues final MessageConsumer requestConsumer = serverSession.createConsumer(requestDestination); if (useAsyncConsume) { requestConsumer.setMessageListener(this); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java index 26cb313d354..351017cf96d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java @@ -91,8 +91,6 @@ protected void reconnect() throws Exception { /** * Recreates the connection. - * - * @throws JMSException */ protected void reconnectSession() throws JMSException { if (session != null) { @@ -123,8 +121,6 @@ protected void rollbackTx() throws Exception { /** * Sends a batch of messages and validates that the messages are received. - * - * @throws Exception */ @Test public void testSendReceiveTransactedBatches() throws Exception { @@ -153,10 +149,7 @@ protected void messageSent() throws Exception { } /** - * Sends a batch of messages and validates that the rollbacked message was - * not consumed. - * - * @throws Exception + * Sends a batch of messages and validates that the rollbacked message was not consumed. */ @Test public void testSendRollback() throws Exception { @@ -196,8 +189,6 @@ public void testSendRollback() throws Exception { /** * spec section 3.6 acking a message with automation acks has no effect. - * - * @throws Exception */ @Test public void testAckMessageInTx() throws Exception { @@ -224,12 +215,9 @@ public void testAckMessageInTx() throws Exception { } /** - * Sends a batch of messages and validates that the message sent before - * session close is not consumed. - * + * Sends a batch of messages and validates that the message sent before session close is not consumed. + *

                      * This test only works with local transactions, not xa. - * - * @throws Exception */ @Test public void testSendSessionClose() throws Exception { @@ -269,10 +257,7 @@ public void testSendSessionClose() throws Exception { } /** - * Sends a batch of messages and validates that the message sent before - * session close is not consumed. - * - * @throws Exception + * Sends a batch of messages and validates that the message sent before session close is not consumed. */ @Test public void testSendSessionAndConnectionClose() throws Exception { @@ -314,10 +299,7 @@ public void testSendSessionAndConnectionClose() throws Exception { } /** - * Sends a batch of messages and validates that the rollbacked message was - * redelivered. - * - * @throws Exception + * Sends a batch of messages and validates that the rollbacked message was redelivered. */ @Test public void testReceiveRollback() throws Exception { @@ -364,10 +346,7 @@ public void testReceiveRollback() throws Exception { } /** - * Sends a batch of messages and validates that the rollbacked message was - * redelivered. - * - * @throws Exception + * Sends a batch of messages and validates that the rollbacked message was redelivered. */ @Test public void testReceiveTwoThenRollback() throws Exception { @@ -415,10 +394,7 @@ public void testReceiveTwoThenRollback() throws Exception { } /** - * Sends a batch of messages and validates that the rollbacked message was - * not consumed. - * - * @throws Exception + * Sends a batch of messages and validates that the rollbacked message was not consumed. */ @Test public void testSendReceiveWithPrefetchOne() throws Exception { @@ -444,10 +420,7 @@ public void testSendReceiveWithPrefetchOne() throws Exception { } /** - * Perform the test that validates if the rollbacked message was redelivered - * multiple times. - * - * @throws Exception + * Perform the test that validates if the rollbacked message was redelivered multiple times. */ @Test public void testReceiveTwoThenRollbackManyTimes() throws Exception { @@ -455,10 +428,8 @@ public void testReceiveTwoThenRollbackManyTimes() throws Exception { } /** - * Sends a batch of messages and validates that the rollbacked message was - * not consumed. This test differs by setting the message prefetch to one. - * - * @throws Exception + * Sends a batch of messages and validates that the rollbacked message was not consumed. This test differs by setting + * the message prefetch to one. */ @Test public void testSendRollbackWithPrefetchOfOne() throws Exception { @@ -467,10 +438,8 @@ public void testSendRollbackWithPrefetchOfOne() throws Exception { } /** - * Sends a batch of messages and and validates that the rollbacked message - * was redelivered. This test differs by setting the message prefetch to one. - * - * @throws Exception + * Sends a batch of messages and and validates that the rollbacked message was redelivered. This test differs by + * setting the message prefetch to one. */ @Test public void testReceiveRollbackWithPrefetchOfOne() throws Exception { @@ -479,8 +448,7 @@ public void testReceiveRollbackWithPrefetchOfOne() throws Exception { } /** - * Tests if the messages can still be received if the consumer is closed - * (session is not closed). + * Tests if the messages can still be received if the consumer is closed (session is not closed). * * @throws Exception see http://jira.codehaus.org/browse/AMQ-143 */ diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/RedeliveryPolicyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/RedeliveryPolicyTest.java index d0c52f74099..951f66960c9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/RedeliveryPolicyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/RedeliveryPolicyTest.java @@ -84,9 +84,6 @@ public void testGetNext() throws Exception { assertEquals(500, delay); } - /** - * @throws Exception - */ @Test public void testExponentialRedeliveryPolicyDelaysDeliveryOnRollback() throws Exception { @@ -141,9 +138,6 @@ public void testExponentialRedeliveryPolicyDelaysDeliveryOnRollback() throws Exc } - /** - * @throws Exception - */ @Test public void testNornalRedeliveryPolicyDelaysDeliveryOnRollback() throws Exception { @@ -194,9 +188,6 @@ public void testNornalRedeliveryPolicyDelaysDeliveryOnRollback() throws Exceptio } - /** - * @throws Exception - */ @Test public void testDLQHandling() throws Exception { this.makeSureCoreQueueExist("ActiveMQ.DLQ"); @@ -251,9 +242,6 @@ public void testDLQHandling() throws Exception { session.commit(); } - /** - * @throws Exception - */ @Test public void testInfiniteMaximumNumberOfRedeliveries() throws Exception { @@ -317,9 +305,6 @@ public void testInfiniteMaximumNumberOfRedeliveries() throws Exception { session.commit(); } - /** - * @throws Exception - */ @Test public void testMaximumRedeliveryDelay() throws Exception { @@ -370,9 +355,6 @@ public void testMaximumRedeliveryDelay() throws Exception { assertEquals(1000, policy.getNextRedeliveryDelay(Long.MAX_VALUE)); } - /** - * @throws Exception - */ @Test public void testZeroMaximumNumberOfRedeliveries() throws Exception { @@ -411,9 +393,6 @@ public void testZeroMaximumNumberOfRedeliveries() throws Exception { } - /** - * @throws Exception - */ @Test public void testRedeliveredMessageNotOverflowingPrefetch() throws Exception { final int prefetchSize = 10; @@ -456,9 +435,6 @@ public void testRedeliveredMessageNotOverflowingPrefetch() throws Exception { } - /** - * @throws Exception - */ @Test public void testCanRollbackPastPrefetch() throws Exception { final int prefetchSize = 10; @@ -502,9 +478,6 @@ public void testCanRollbackPastPrefetch() throws Exception { } } - /** - * @throws Exception - */ @Test public void testCountersAreCorrectAfterSendToDLQ() throws Exception { RedeliveryPolicy policy = connection.getRedeliveryPolicy(); @@ -537,9 +510,6 @@ public void testCountersAreCorrectAfterSendToDLQ() throws Exception { } - /** - * @throws Exception - */ @Test public void testRedeliveryRefCleanup() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java index 4f1acd444d9..7a48bb5fea3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java @@ -62,9 +62,8 @@ import org.junit.jupiter.api.Test; /** - * This test covers interactions between core clients and - * openwire clients, i.e. core producers sending messages - * to be received by openwire receivers, and vice versa. + * This test covers interactions between core clients and openwire clients, i.e. core producers sending messages to be + * received by openwire receivers, and vice versa. */ public class GeneralInteropTest extends BasicOpenWireTest { @@ -209,7 +208,7 @@ public void testMutipleReceivingFromCore() throws Exception { @Test public void testFailoverReceivingFromCore() throws Exception { - /** + /* * to get logging to stdout from failover client * org.slf4j.impl.SimpleLoggerFactory simpleLoggerFactory = new SimpleLoggerFactory(); * ((SimpleLogger)simpleLoggerFactory.getLogger(FailoverTransport.class.getName())).setLevel(SimpleLogger.TRACE); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/JournalPagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/JournalPagingTest.java index 21a2f05f6e0..62225aebd18 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/JournalPagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/JournalPagingTest.java @@ -508,10 +508,6 @@ public void testPreparedACKRemoveAndRestart() throws Exception { session.commit(); } - /** - * @param queue - * @throws InterruptedException - */ private void forcePage(Queue queue) throws InterruptedException { for (long timeout = System.currentTimeMillis() + 5000; timeout > System.currentTimeMillis() && !queue.getPageSubscription().getPagingStore().isPaging(); ) { Thread.sleep(10); @@ -578,7 +574,8 @@ public void testInabilityToCreateDirectoryDuringPaging() throws Exception { } /** - * This test will remove all the page directories during a restart, simulating a crash scenario. The server should still start after this + * This test will remove all the page directories during a restart, simulating a crash scenario. The server should + * still start after this */ @Test public void testDeletePhysicalPages() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PageCountSyncServer.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PageCountSyncServer.java index 2bc72c95342..3d5f990f7b0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PageCountSyncServer.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PageCountSyncServer.java @@ -20,9 +20,9 @@ import org.apache.activemq.artemis.utils.SpawnedVMSupport; /** - * This is a sub process of the test {@link PageCountSyncOnNonTXTest} - * The System.out calls here are meant to be here as they will appear on the process output and test output. - * It helps to identify what happened on the test in case of failures. + * This is a sub process of the test {@link PageCountSyncOnNonTXTest}. The System.out calls here are meant to be here as + * they will appear on the process output and test output. It helps to identify what happened on the test in case of + * failures. */ public class PageCountSyncServer extends SpawnedServerSupport { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PageTransactionCleanupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PageTransactionCleanupTest.java index d4b0a2c642c..5445d4f54ef 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PageTransactionCleanupTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PageTransactionCleanupTest.java @@ -49,7 +49,7 @@ /** * A PagingOrderTest. - *
                      + *

                      * PagingTest has a lot of tests already. I decided to create a newer one more specialized on Ordering and counters */ public class PageTransactionCleanupTest extends ActiveMQTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingCounterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingCounterTest.java index b39cdfd1d25..0b467996795 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingCounterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingCounterTest.java @@ -441,11 +441,6 @@ public void testRestartCounter() throws Exception { } - /** - * @param queue - * @return - * @throws Exception - */ private PageSubscriptionCounter locateCounter(Queue queue) throws Exception { PageSubscription subscription = server.getPagingManager().getPageStore(SimpleString.of("A1")).getCursorProvider().getSubscription(queue.getID()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingOrderTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingOrderTest.java index b0b9b5fd4c2..1102c411064 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingOrderTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingOrderTest.java @@ -65,8 +65,8 @@ import org.junit.jupiter.api.Test; /** - * A PagingOrderTest. PagingTest has a lot of tests already. I decided to create a newer one more - * specialized on Ordering and counters + * A PagingOrderTest. PagingTest has a lot of tests already. I decided to create a newer one more specialized on + * Ordering and counters */ public class PagingOrderTest extends ActiveMQTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSendTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSendTest.java index 5e9e13809c2..fa12c380c3f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSendTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSendTest.java @@ -224,9 +224,12 @@ public void testPagingDoesNotDuplicateBatchMessages() throws Exception { session.createQueue(QueueConfiguration.of(queueAddr)); // Set up paging on the queue address - AddressSettings addressSettings = new AddressSettings().setPageSizeBytes(10 * 1024) - /** This actually causes the address to start paging messages after 10 x messages with 1024 payload is sent. - Presumably due to additional meta-data, message headers etc... **/.setMaxSizeBytes(16 * 1024); + AddressSettings addressSettings = new AddressSettings().setPageSizeBytes(10 * 1024); + /* + * This actually causes the address to start paging messages after 10 x messages with 1024 payload is sent. + * Presumably due to additional meta-data, message headers etc... + */ + addressSettings.setMaxSizeBytes(16 * 1024); server.getAddressSettingsRepository().addMatch("#", addressSettings); sendMessageBatch(batchSize, session, queueAddr); @@ -270,9 +273,12 @@ public void testPagingDoesNotDuplicateBatchMessagesAfterPagingStarted() throws E session.createQueue(QueueConfiguration.of(queueAddr)); // Set up paging on the queue address - AddressSettings addressSettings = new AddressSettings().setPageSizeBytes(10 * 1024) - /** This actually causes the address to start paging messages after 10 x messages with 1024 payload is sent. - Presumably due to additional meta-data, message headers etc... **/.setMaxSizeBytes(16 * 1024); + AddressSettings addressSettings = new AddressSettings().setPageSizeBytes(10 * 1024); + /* + * This actually causes the address to start paging messages after 10 x messages with 1024 payload is sent. + * Presumably due to additional meta-data, message headers etc... + */ + addressSettings.setMaxSizeBytes(16 * 1024); server.getAddressSettingsRepository().addMatch("#", addressSettings); int numberOfMessages = 0; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSyncTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSyncTest.java index 6379c9b3fce..bd9a50c0949 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSyncTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingSyncTest.java @@ -36,7 +36,7 @@ /** * A PagingOrderTest. - *
                      + *

                      * PagingTest has a lot of tests already. I decided to create a newer one more specialized on Ordering and counters */ public class PagingSyncTest extends ActiveMQTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverBackup.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverBackup.java index b02224cf3fd..6a3652907fb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverBackup.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverBackup.java @@ -19,8 +19,8 @@ import org.apache.activemq.artemis.utils.SpawnedVMSupport; /** - * There is no difference between this class and {@link PagingWithFailoverServer} - * other than helping us identify it on the logs, as it will show with a different name through spawned logs + * There is no difference between this class and {@link PagingWithFailoverServer} other than helping us identify it on + * the logs, as it will show with a different name through spawned logs */ public class PagingWithFailoverBackup extends PagingWithFailoverServer { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/AddressSettingsConfigurationStorageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/AddressSettingsConfigurationStorageTest.java index 20a4f1a85f6..a0472d76731 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/AddressSettingsConfigurationStorageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/AddressSettingsConfigurationStorageTest.java @@ -104,10 +104,6 @@ public void testStoreConfigDeleteSettings() throws Exception { checkAddresses(journal); } - /** - * @param journal1 - * @throws Exception - */ private void checkAddresses(StorageManager journal1) throws Exception { List listSetting = journal1.recoverAddressSettings(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/JMSStorageManagerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/JMSStorageManagerTest.java index 5e9ca168b0e..b7440d573e6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/JMSStorageManagerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/JMSStorageManagerTest.java @@ -170,7 +170,6 @@ public void testSettingsWithConnectorConfigs() throws Exception { } - //https://issues.jboss.org/browse/HORNETQ-812 @Test public void testJNDIPersistence() throws Exception { createJMSStorage(); @@ -216,9 +215,6 @@ public void testJNDIPersistence() throws Exception { } - /** - * @throws Exception - */ protected void createJMSStorage() throws Exception { jmsJournal = new JMSJournalStorageManagerImpl(null, new TimeAndCounterIDGenerator(), createDefaultInVMConfig(), null); runAfter(jmsJournal::stop); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RolesConfigurationStorageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RolesConfigurationStorageTest.java index 5ca507d333e..78a5add53f4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RolesConfigurationStorageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/RolesConfigurationStorageTest.java @@ -102,10 +102,6 @@ public void testStoreSecuritySettings2() throws Exception { checkSettings(); } - /** - * @param journal - * @throws Exception - */ private void checkSettings() throws Exception { List listSetting = journal.recoverSecuritySettings(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java index 49cc9286139..467e0a216a0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java @@ -84,9 +84,6 @@ public void tearDown() throws Exception { throw exception; } - /** - * @throws Exception - */ protected void createStorage() throws Exception { if (storeType == StoreConfiguration.StoreType.DATABASE) { @@ -104,26 +101,18 @@ protected void createStorage() throws Exception { /** * This forces a reload of the journal from disk - * - * @throws Exception */ protected void rebootStorage() throws Exception { journal.stop(); createStorage(); } - /** - * @param configuration - */ protected JournalStorageManager createJournalStorageManager(Configuration configuration) { JournalStorageManager jsm = new JournalStorageManager(configuration, EmptyCriticalAnalyzer.getInstance(), execFactory, execFactory); addActiveMQComponent(jsm); return jsm; } - /** - * @param configuration - */ protected JDBCJournalStorageManager createJDBCJournalStorageManager(Configuration configuration) { JDBCJournalStorageManager jsm = new JDBCJournalStorageManager(configuration, EmptyCriticalAnalyzer.getInstance(), execFactory, execFactory, scheduledExecutorService); addActiveMQComponent(jsm); 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 41a11c5ef3e..31ac829dd8a 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 @@ -197,7 +197,6 @@ public void testMessageProperties() throws Exception { /** * @return ClientSession - * @throws Exception */ private ClientSession basicSetUp() throws Exception { server = createServer(true); 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 85f29ddc5b8..0e3c853478a 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 @@ -43,10 +43,6 @@ import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; -/** - * - * - */ public abstract class AbstractPersistentStatTestSupport extends JMSTestBase { protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -189,11 +185,6 @@ protected void publishTestMessagesDurable(Connection connection, String[] subNam /** * Generate random messages between 100 bytes and maxMessageSize - * - * @param session - * @return - * @throws JMSException - * @throws ActiveMQException */ protected BytesMessage createMessage(int count, Session session, int maxMessageSize, AtomicLong publishedMessageSize) throws JMSException, ActiveMQException { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/CacheMetricsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/CacheMetricsTest.java index 3729a0fba7c..2ef2f1e9d1a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/CacheMetricsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/CacheMetricsTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.plugin; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/JvmMetricsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/JvmMetricsTest.java index 59320456839..774ed9d04cf 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/JvmMetricsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/JvmMetricsTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.plugin; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MetricsPluginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MetricsPluginTest.java index 13001cf5111..feac1ef2012 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MetricsPluginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MetricsPluginTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.plugin; import java.util.Arrays; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/NettyMetricsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/NettyMetricsTest.java index c3740d4e5a3..59d1e354b3a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/NettyMetricsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/NettyMetricsTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.plugin; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/SystemMetricsTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/SystemMetricsTest.java index d09c314af5b..e31af300f92 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/SystemMetricsTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/SystemMetricsTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.plugin; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/XmlConfigPluginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/XmlConfigPluginTest.java index a5161adf793..394976314a7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/XmlConfigPluginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/XmlConfigPluginTest.java @@ -54,7 +54,6 @@ public void testStopStart1() throws Exception { /** * Ensure the configuration is bring picked up correctly by LoggingActiveMQServerPlugin - * @throws Exception */ @Test public void testLoggingActiveMQServerPlugin() throws Exception { @@ -80,7 +79,6 @@ public void testLoggingActiveMQServerPlugin() throws Exception { /** * ensure the LoggingActiveMQServerPlugin uses default values when configured with incorrect values - * @throws Exception */ @Test public void testLoggingActiveMQServerPluginWrongValue() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQClusteredTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQClusteredTest.java index 499d04aff2a..1fd4a0ba3c9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQClusteredTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQClusteredTest.java @@ -49,9 +49,9 @@ public class ActiveMQClusteredTest extends ActiveMQRAClusteredTestBase { - /* - * the second server has no queue so this tests for partial initialisation - * */ + /** + * The second server has no queue so this tests for partial initialisation + */ @Test public void testShutdownOnPartialConnect() throws Exception { secondaryServer.getAddressSettingsRepository().getMatch(MDBQUEUE).setAutoCreateQueues(false).setAutoCreateAddresses(false); @@ -82,8 +82,6 @@ public void testShutdownOnPartialConnect() throws Exception { /** * https://bugzilla.redhat.com/show_bug.cgi?id=1029076 * Look at the logs for this test, if you see exceptions it's an issue. - * - * @throws Exception */ @Test public void testNonDurableInCluster() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java index 20c5ffd8386..e4d269d36f6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ActiveMQMessageHandlerTest.java @@ -372,9 +372,6 @@ public void testSimpleMessageReceivedOnQueueManyMessagesAndInterruptTimeout() th qResourceAdapter.stop(); } - /** - * @return - */ @Override protected ActiveMQResourceAdapter newResourceAdapter() { ActiveMQResourceAdapter qResourceAdapter = new ActiveMQResourceAdapter(); @@ -705,7 +702,6 @@ public void testNonDurableSubscription() throws Exception { qResourceAdapter.stop(); } - //https://issues.jboss.org/browse/JBPAPP-8017 @Test public void testNonDurableSubscriptionDeleteAfterCrash() throws Exception { ActiveMQResourceAdapter qResourceAdapter = newResourceAdapter(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java index 0805deff3fa..b9819dd366e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ra/ResourceAdapterTest.java @@ -372,7 +372,6 @@ private void testParams(Boolean b, assertEquals(qResourceAdapter.getUserName(), testuser); } - // https://issues.jboss.org/browse/JBPAPP-5790 @Test public void testResourceAdapterSetup() throws Exception { ActiveMQResourceAdapter adapter = new ActiveMQResourceAdapter(); @@ -425,7 +424,6 @@ public void testResourceAdapterSetup() throws Exception { } - // https://issues.jboss.org/browse/JBPAPP-5836 @Test public void testResourceAdapterSetupOverrideCFParams() throws Exception { ActiveMQResourceAdapter qResourceAdapter = new ActiveMQResourceAdapter(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/PingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/PingTest.java index 434f1bb1034..8066181ae3d 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/PingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/PingTest.java @@ -84,7 +84,7 @@ public void beforeReconnect(final ActiveMQException exception) { } } - /* + /** * Test that no failure listeners are triggered in a non failure case with pinging going on */ @Test @@ -137,7 +137,7 @@ public void testNoFailureWithPinging() throws Exception { locator.close(); } - /* + /** * Test that no failure listeners are triggered in a non failure case with no pinging going on */ @Test @@ -189,7 +189,7 @@ public void testNoFailureNoPinging() throws Exception { locator.close(); } - /* + /** * Test that pinging is disabled for in-vm connection when using the default settings */ @Test @@ -226,7 +226,7 @@ public void testNoPingingOnInVMConnection() throws Exception { locator.close(); } - /* + /** * Test the server timing out a connection since it doesn't receive a ping in time */ @Test @@ -295,9 +295,9 @@ public void testServerFailureNoPing() throws Exception { locator.close(); } - /* - * Test the client triggering failure due to no ping from server received in time - */ + /** + * Test the client triggering failure due to no ping from server received in time + */ @Test public void testClientFailureNoServerPing() throws Exception { // server must received at least one ping from the client to pass diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java index d97415f3dd5..efe4f607ad7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/ReplicationTest.java @@ -523,17 +523,10 @@ public void testClusterConnectionConfigs() throws Exception { assertEquals(checkPeriodOverride, replicationLocator.getClientFailureCheckPeriod()); } - /** - * @return - * @throws Exception - */ private JournalStorageManager getStorage() throws Exception { return new JournalStorageManager(createDefaultInVMConfig(), EmptyCriticalAnalyzer.getInstance(), factory, factory); } - /** - * @param manager1 - */ private void blockOnReplication(final StorageManager storage, final ReplicationManager manager1) throws Exception { final CountDownLatch latch = new CountDownLatch(1); storage.afterCompleteOperations(new IOCallback() { @@ -691,8 +684,8 @@ public void setUp() throws Exception { } /** - * We need to shutdown the executors before calling {@link super#tearDown()} (which will check - * for leaking threads). Due to that, we need to close/stop all components here. + * We need to shutdown the executors before calling {@link super#tearDown()} (which will check for leaking threads). + * Due to that, we need to close/stop all components here. */ @Override @AfterEach 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 d76915ae6f0..44e80322707 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 @@ -448,10 +448,9 @@ private Configuration createBackupConfiguration() throws Exception { ccconf.setConnectorName("backup"); conf.addClusterConfiguration(ccconf); - /** - * Set a bad url then, as a result the backup node would make a decision - * of replicating from live node in the case of connection failure. - * Set big check period to not schedule checking which would stop server. + /* + * Set a bad url then, as a result the backup node would make a decision of replicating from live node in the case + * of connection failure. Set big check period to not schedule checking which would stop server. */ conf.setNetworkCheckPeriod(1000000).setNetworkCheckURLList("http://localhost:28787").setSecurityEnabled(false).setJMXManagementEnabled(false).setJournalType(JournalType.MAPPED).setJournalFileSize(1024 * 512).setConnectionTTLOverride(60_000L); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java index ad719fd4074..854587d9a89 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/DelayedMessageTest.java @@ -51,9 +51,6 @@ public void setUp() throws Exception { initServer(); } - /** - * @throws Exception - */ protected void initServer() throws Exception { server = createServer(true, createDefaultInVMConfig()); server.start(); 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 c027085b7e4..c5610e5756d 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 @@ -59,9 +59,6 @@ public void setUp() throws Exception { initServer(); } - /** - * @throws Exception - */ protected void initServer() throws Exception { server = createServer(true, createDefaultInVMConfig()); server.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java index ee8aa6b4b4b..f69f52948e4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/scheduling/ScheduledMessageTest.java @@ -68,9 +68,6 @@ public void setUp() throws Exception { startServer(); } - /** - * @throws Exception - */ protected void startServer() throws Exception { configuration = createDefaultInVMConfig(); server = createServer(true, configuration); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/JMSXUserIDPluginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/JMSXUserIDPluginTest.java index 412a2d16840..222d1339b20 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/JMSXUserIDPluginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/JMSXUserIDPluginTest.java @@ -112,8 +112,6 @@ private static class JMSXUserIDPlugin implements ActiveMQServerPlugin { /** * used to pass configured properties to Plugin - * - * @param properties */ @Override public void init(Map properties) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/PersistedSecuritySettingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/PersistedSecuritySettingTest.java index 2a322ce40a0..02fae72cbfa 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/PersistedSecuritySettingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/PersistedSecuritySettingTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.security; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java index 7ecd832e4dc..9ef3fde5ff4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/SecurityTest.java @@ -103,9 +103,7 @@ public class SecurityTest extends ActiveMQTestBase { } } - /* - * create session tests - */ + // create session tests private static final String addressA = "addressA"; private static final String queueA = "queueA"; @@ -361,8 +359,6 @@ public void testJAASSecurityManagerAuthenticationWithCertsAndOpenWire() throws E /** * Verify role permissions are applied properly when using OpenWire - * - * @throws Exception */ @Test public void testJAASSecurityManagerOpenWireNegative() throws Exception { @@ -500,10 +496,11 @@ public void testJAASSecurityManagerAuthenticationBadPassword() throws Exception /** * This test requires a client-side certificate that will be trusted by the server but whose dname will be rejected * by the CertLogin login module. I created this cert with the follow commands: - * + *

                      {@code
                           * keytool -genkey -keystore bad-client-keystore.jks -storepass securepass -keypass securepass -dname "CN=Bad Client, OU=Artemis, O=ActiveMQ, L=AMQ, S=AMQ, C=AMQ" -keyalg RSA
                           * keytool -export -keystore bad-client-keystore.jks -file activemq-jks.cer -storepass securepass
                           * keytool -import -keystore client-ca-truststore.jks -file activemq-jks.cer -storepass securepass -keypass securepass -noprompt -alias bad
                      +    * }
                      */ @Test public void testJAASSecurityManagerAuthenticationWithBadClientCert() throws Exception { @@ -1195,10 +1192,6 @@ public void testCreateSessionWithNullUserPass() throws Exception { } } - /** - * @return - * @throws Exception - */ private ActiveMQServer createServer() throws Exception { configuration = createDefaultInVMConfig().setSecurityEnabled(true); ActiveMQServer server = createServer(false, configuration); @@ -1484,7 +1477,6 @@ public void testSendWithRole() throws Exception { roles.add(role); - // This was added to validate https://issues.jboss.org/browse/SOA-3363 securityRepository.addMatch(SecurityTest.addressA, roles); boolean failed = false; try { @@ -1492,7 +1484,6 @@ public void testSendWithRole() throws Exception { } catch (ActiveMQException e) { failed = true; } - // This was added to validate https://issues.jboss.org/browse/SOA-3363 ^^^^^ assertTrue(failed, "Failure expected on send after removing the match"); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AIOFileLockTimeoutTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AIOFileLockTimeoutTest.java index 9a78a222e1a..1f4d91e04ea 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AIOFileLockTimeoutTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/AIOFileLockTimeoutTest.java @@ -16,14 +16,17 @@ */ package org.apache.activemq.artemis.tests.integration.server; +import org.apache.activemq.artemis.logs.AssertionLoggerHandler; import org.junit.jupiter.api.Test; public class AIOFileLockTimeoutTest extends FileLockTimeoutTest { /** - * When running this test from an IDE add this to the test command line so that the AssertionLoggerHandler works properly: - * - * -Dlog4j2.configurationFile=file:/tests/config/log4j2-tests-config.properties + * When running this test from an IDE add this to the test command line so that the {@link AssertionLoggerHandler} works + * properly: + *
                      +    * -Dlog4j2.configurationFile=file:${path-to-source}/tests/config/log4j2-tests-config.properties
                      +    * 
                      */ @Test public void testAIOFileLockExpiration() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/NIOFileLockTimeoutTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/NIOFileLockTimeoutTest.java index f06408f2b46..d0c538f9515 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/NIOFileLockTimeoutTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/NIOFileLockTimeoutTest.java @@ -16,14 +16,17 @@ */ package org.apache.activemq.artemis.tests.integration.server; +import org.apache.activemq.artemis.logs.AssertionLoggerHandler; import org.junit.jupiter.api.Test; public class NIOFileLockTimeoutTest extends FileLockTimeoutTest { /** - * When running this test from an IDE add this to the test command line so that the AssertionLoggerHandler works properly: - * - * -Dlog4j2.configurationFile=file:/tests/config/log4j2-tests-config.properties + * When running this test from an IDE add this to the test command line so that the {@link AssertionLoggerHandler} works + * properly: + *
                      +    * -Dlog4j2.configurationFile=file:${path-to-source}/tests/config/log4j2-tests-config.properties
                      +    * 
                      */ @Test public void testNIOFileLockExpiration() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PotentialOOMELoggingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PotentialOOMELoggingTest.java index 4368c6a078c..f7387869ee2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PotentialOOMELoggingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/PotentialOOMELoggingTest.java @@ -30,9 +30,11 @@ public class PotentialOOMELoggingTest extends ActiveMQTestBase { /** - * When running this test from an IDE add this to the test command line so that the AssertionLoggerHandler works properly: - * - * -Dlog4j2.configurationFile=file:/tests/config/log4j2-tests-config.properties + * When running this test from an IDE add this to the test command line so that the {@link AssertionLoggerHandler} works + * properly: + *
                      +    * -Dlog4j2.configurationFile=file:${path-to-source}/tests/config/log4j2-tests-config.properties
                      +    * 
                      */ @Test public void testBlockLogging() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/RetroactiveAddressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/RetroactiveAddressTest.java index 68514017997..efb67aedb7f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/RetroactiveAddressTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/RetroactiveAddressTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.integration.server; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java index 4e51f826e13..ec81070ad02 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownDirectTest.java @@ -51,8 +51,8 @@ import org.junit.jupiter.api.extension.ExtendWith; /** - * On this test we will run ScaleDown directly as an unit-test in several cases, - * simulating what would happen during a real scale down. + * On this test we will run ScaleDown directly as an unit-test in several cases, simulating what would happen during a + * real scale down. */ @ExtendWith(ParameterizedTestExtension.class) public class ScaleDownDirectTest extends ClusterTestBase { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java index 81c3ed4c5e4..46a5587e0c4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/SimpleStartStopTest.java @@ -34,12 +34,10 @@ public class SimpleStartStopTest extends ActiveMQTestBase { /** - * Start / stopping the server shouldn't generate any errors. - * Also it shouldn't bloat the journal with lots of IDs (it should do some cleanup when possible) - *
                      + * Start / stopping the server shouldn't generate any errors. Also it shouldn't bloat the journal with lots of IDs + * (it should do some cleanup when possible) + *

                      * This is also validating that the same server could be restarted after stopped - * - * @throws Exception */ @Test public void testStartStopAndCleanupIDs() throws Exception { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java index 8f9b09a7501..9a6b7a33b23 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/ssl/CoreClientOverOneWaySSLTest.java @@ -845,18 +845,16 @@ public String getSuitableCipherSuite() throws Exception { String[] suites = getEnabledCipherSuites(); - /** - * The JKS certs are generated using Java keytool using RSA and not ECDSA but the JVM prefers ECDSA over RSA so we have - * to look through the cipher suites until we find one that's suitable for us. - * If the JVM running this test is version 7 from Oracle then this cipher suite will will almost certainly require - * TLSv1.2 (which is not enabled on the client by default). - * See http://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SunJSSEProvider for the + /* + * The JKS certs are generated using Java keytool using RSA and not ECDSA but the JVM prefers ECDSA over RSA so we + * have to look through the cipher suites until we find one that's suitable for us. If the JVM running this test + * is version 7 from Oracle then this cipher suite will will almost certainly require TLSv1.2 (which is not + * enabled on the client by default). See + * http://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SunJSSEProvider for the * preferred cipher suites. */ - /** - * JCEKS is essentially the same story as JKS - */ + // JCEKS is essentially the same story as JKS for (int i = 0; i < suites.length; i++) { String suite = suites[i]; String storeType = SSLSupport.getValidProviderAndType(this.storeProvider, this.storeType).getB(); @@ -939,7 +937,6 @@ public void testOneWaySSLWithIncorrectTrustStorePath() throws Exception { } } - // see https://jira.jboss.org/jira/browse/HORNETQ-234 @TestTemplate public void testPlainConnectionToSSLEndpoint() throws Exception { createCustomSslServer(); 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 524f68c287d..de75cd1ae49 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 @@ -1675,7 +1675,6 @@ public void testClientAckNotPartOfTransaction() throws Exception { conn.disconnect(); } - // HORNETQ-1007 @Test public void testMultiProtocolConsumers() throws Exception { final int TIME_OUT = 2000; @@ -1812,8 +1811,6 @@ public void testPrefix(final String prefix, final RoutingType routingType, final /** * This test and testPrefixedAutoCreatedMulticastAndAnycastWithSameName are basically the same but doing the * operations in opposite order. In this test the anycast subscription is created first. - * - * @throws Exception */ @Test public void testPrefixedAutoCreatedAnycastAndMulticastWithSameName() throws Exception { @@ -1891,8 +1888,6 @@ public void testPrefixedAutoCreatedAnycastAndMulticastWithSameName() throws Exce /** * This test and testPrefixedAutoCreatedMulticastAndAnycastWithSameName are basically the same but doing the * operations in opposite order. In this test the multicast subscription is created first. - * - * @throws Exception */ @Test public void testPrefixedAutoCreatedMulticastAndAnycastWithSameName() throws Exception { 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 5c1219bf273..cd190c6fed3 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 @@ -174,10 +174,6 @@ public void tearDownConnections() { AbstractStompClientConnection.tearDownConnections(); } - /** - * @return - * @throws Exception - */ protected ActiveMQServer createServer() throws Exception { String stompAcceptorURI = "tcp://" + TransportConstants.DEFAULT_HOST + ":" + TransportConstants.DEFAULT_STOMP_PORT + "?" + TransportConstants.STOMP_CONSUMER_WINDOW_SIZE + "=-1"; if (isEnableStompMessageId()) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithClientIdValidationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithClientIdValidationTest.java index 58be603d0ee..cf483df95f6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithClientIdValidationTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/StompWithClientIdValidationTest.java @@ -67,9 +67,7 @@ public Subject authenticate(String user, String password, RemotingConnection rem if ("STOMP".equals(remotingConnection.getProtocolName())) { final String clientId = remotingConnection.getClientID(); - /* - * perform some kind of clientId validation, e.g. check presence or format - */ + // perform some kind of clientId validation, e.g. check presence or format if (clientId == null || clientId.isEmpty()) { System.err.println("ClientID not set!"); return null; 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 cffd5b46ed8..39655666b16 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 @@ -793,10 +793,6 @@ public void testSimpleJoin() throws Exception { clientSession.close(); } - /** - * @throws ActiveMQException - * @throws XAException - */ protected void multipleQueuesInternalTest(final boolean createQueues, final boolean suspend, final boolean recreateSession, diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java index d2b70b7201c..5aac6eafd99 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/XaTimeoutTest.java @@ -508,11 +508,8 @@ public void testTimeoutOnConsumerResend() throws Exception { } /** - * In case a timeout happens the server's object may still have the previous XID. - * for that reason a new start call is supposed to clean it up with a log.warn - * but it should still succeed - * - * @throws Exception + * In case a timeout happens the server's object may still have the previous XID. for that reason a new start call is + * supposed to clean it up with a log.warn but it should still succeed */ @TestTemplate public void testChangeXID() throws Exception { @@ -631,15 +628,12 @@ public void testMultipleTransactionsTimedOut() throws Exception { assertNull(m); } - // HORNETQ-1117 - Test that will timeout on a XA transaction and then will perform another XA operation + // Test that will timeout on a XA transaction and then will perform another XA operation @TestTemplate public void testTimeoutOnXACall() throws Exception { final CountDownLatch latch = new CountDownLatch(1); class SomeInterceptor implements Interceptor { - /* (non-Javadoc) - * @see Interceptor#intercept(org.apache.activemq.artemis.core.protocol.core.Packet, RemotingConnection) - */ @Override public boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException { if (packet instanceof SessionXAStartMessage) { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java index 7754fb9d2f7..5256a331663 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/JMSClusteredTestBase.java @@ -65,9 +65,6 @@ public class JMSClusteredTestBase extends ActiveMQTestBase { protected static final int MAX_HOPS = 1; - /** - * @throws Exception - */ protected Queue createQueue(final String name) throws Exception { jmsServer2.createQueue(false, name, null, true, "/queue/" + name); jmsServer1.createQueue(false, name, null, true, "/queue/" + name); @@ -113,9 +110,6 @@ public void setUp() throws Exception { cf2 = ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(InVMConnectorFactory.class.getName(), generateInVMParams(2))); } - /** - * @throws Exception - */ private void setupServer2() throws Exception { Configuration configuration = createConfigServer(2, 1); @@ -128,9 +122,6 @@ private void setupServer2() throws Exception { jmsServer2.setRegistry(new JndiBindingRegistry(context2)); } - /** - * @throws Exception - */ private void setupServer1() throws Exception { Configuration configuration = createConfigServer(1, 2); @@ -147,9 +138,6 @@ protected boolean enablePersistence() { return false; } - /** - * @return - */ protected Configuration createConfigServer(final int source, final int destination) throws Exception { final String destinationLabel = "toServer" + destination; final String sourceLabel = "server" + source; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/TransportConfigurationUtils.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/TransportConfigurationUtils.java index bb426d03e6c..56ceb535fc5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/TransportConfigurationUtils.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/util/TransportConfigurationUtils.java @@ -68,11 +68,6 @@ public static TransportConfiguration getNettyConnector(final boolean live, int s return transportConfiguration(ActiveMQTestBase.NETTY_CONNECTOR_FACTORY, live, server, name); } - /** - * @param classname - * @param live - * @return - */ private static TransportConfiguration transportConfiguration(String classname, boolean live) { if (live) { return new TransportConfiguration(classname); 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 9a86ca3df21..ee4894e6fd7 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 @@ -471,7 +471,7 @@ public void testPartialClientAcknowledge() throws Exception { } } - /* + /** * Send some messages, consume them and verify the messages are not sent upon recovery */ @Test @@ -1238,8 +1238,8 @@ public void testTransactionalIgnoreACK() throws Exception { } /** - * Ensure no blocking calls in acknowledge flow when block on acknowledge = false. - * This is done by checking the performance compared to blocking is much improved. + * Ensure no blocking calls in acknowledge flow when block on acknowledge = false. This is done by checking the + * performance compared to blocking is much improved. */ @Test public void testNonBlockingAckPerf() throws Exception { diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/CTSMiscellaneousTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/CTSMiscellaneousTest.java index 986f08319c2..a1f29270b42 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/CTSMiscellaneousTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/CTSMiscellaneousTest.java @@ -47,7 +47,8 @@ public void setUp() throws Exception { } - /* By default we send non persistent messages asynchronously for performance reasons + /* + * By default we send non persistent messages asynchronously for performance reasons * when running with strictTCK we send them synchronously */ @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 9914353d8df..95530846a1a 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 @@ -113,9 +113,8 @@ public void testCannotReceiveMessageOnStoppedConnection() throws Exception { } /** - * A close terminates all pending message receives on the connection's session's consumers. The - * receives may return with a message or null depending on whether or not there was a message - * available at the time of the close. + * A close terminates all pending message receives on the connection's session's consumers. The receives may return + * with a message or null depending on whether there was a message available at the time of the close. */ @Test public void testCloseWhileReceiving() throws Exception { @@ -210,7 +209,8 @@ public void testCloseHierarchy() throws Exception { // Session - /* If the session is closed then any method invocation apart from close() + /* + * If the session is closed then any method invocation apart from close() * will throw an IllegalStateException */ try { @@ -256,7 +256,8 @@ public void testCloseHierarchy() throws Exception { // Producer - /* If the producer is closed then any method invocation apart from close() + /* + * If the producer is closed then any method invocation apart from close() * will throw an IllegalStateException */ try { 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 5775cc52600..44c1eda846d 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 @@ -68,8 +68,7 @@ public void setUp() throws Exception { } /** - * Test that ConnectionFactory can be cast to QueueConnectionFactory and QueueConnection can be - * created. + * Test that ConnectionFactory can be cast to QueueConnectionFactory and QueueConnection can be created. */ @Test public void testQueueConnectionFactory() throws Exception { @@ -81,8 +80,7 @@ public void testQueueConnectionFactory() throws Exception { } /** - * Test that ConnectionFactory can be cast to TopicConnectionFactory and TopicConnection can be - * created. + * Test that ConnectionFactory can be cast to TopicConnectionFactory and TopicConnection can be created. */ @Test public void testTopicConnectionFactory() throws Exception { @@ -147,7 +145,6 @@ public void testNoClientIDConfigured_2() throws Exception { undeployConnectionFactory("CF_XA_FALSE"); } - // Added for http://jira.jboss.org/jira/browse/JBMESSAGING-939 @Test public void testDurableSubscriptionOnPreConfiguredConnectionFactory() throws Exception { ActiveMQServerTestCase.deployConnectionFactory("TestConnectionFactory1", "cfTest", "/TestDurableCF"); 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 a1fe4c276ce..a990a30bd62 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 @@ -249,8 +249,6 @@ public void testExceptionListener() throws Exception { } - // This test is to check netty issue in https://jira.jboss.org/jira/browse/JBMESSAGING-1618 - @Test public void testConnectionListenerBug() throws Exception { for (int i = 0; i < 1000; i++) { @@ -267,8 +265,6 @@ public void testConnectionListenerBug() throws Exception { /** * This test is similar to a JORAM Test... * (UnifiedTest::testCreateDurableConnectionConsumerOnQueueConnection) - * - * @throws Exception */ @Test public void testDurableSubscriberOnQueueConnection() throws Exception { diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/DurableSubscriptionTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/DurableSubscriptionTest.java index 1188fe99e87..802d9fbdb39 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/DurableSubscriptionTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/DurableSubscriptionTest.java @@ -35,8 +35,7 @@ import org.junit.jupiter.api.Test; /** - * Tests focused on durable subscription behavior. More durable subscription tests can be found in - * MessageConsumerTest. + * Tests focused on durable subscription behavior. More durable subscription tests can be found in MessageConsumerTest. */ public class DurableSubscriptionTest extends JMSTestCase { @@ -156,10 +155,10 @@ public void testDurableSubscriptionRemovalRaceCondition() throws Exception { } /** - * JMS 1.1 6.11.1: A client can change an existing durable subscription by creating a durable - * TopicSubscriber with the same name and a new topic and/or message selector, or NoLocal - * attribute. Changing a durable subscription is equivalent to deleting and recreating it. - *
                      + * JMS 1.1 6.11.1: A client can change an existing durable subscription by creating a durable TopicSubscriber with + * the same name and a new topic and/or message selector, or NoLocal attribute. Changing a durable subscription is + * equivalent to deleting and recreating it. + *

                      * Test with a different topic (a redeployed topic is a different topic). */ @Test @@ -204,10 +203,10 @@ public void testDurableSubscriptionOnNewTopic() throws Exception { } /** - * JMS 1.1 6.11.1: A client can change an existing durable subscription by creating a durable - * TopicSubscriber with the same name and a new topic and/or message selector, or NoLocal - * attribute. Changing a durable subscription is equivalent to deleting and recreating it. - *
                      + * JMS 1.1 6.11.1: A client can change an existing durable subscription by creating a durable TopicSubscriber with + * the same name and a new topic and/or message selector, or NoLocal attribute. Changing a durable subscription is + * equivalent to deleting and recreating it. + *

                      * Test with a different selector. */ @Test @@ -244,7 +243,6 @@ public void testDurableSubscriptionDifferentSelector() throws Exception { // TODO: when subscriptions/durable subscription will be registered as MBean, use the JMX // interface to make sure the 'another red square message' is maintained by the // durable subascription - // http://jira.jboss.org/jira/browse/JBMESSAGING-217 conn.close(); 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 0e2003893a7..4011ba1c2a8 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 @@ -524,7 +524,8 @@ public void testCreateConsumerOnNonExistentQueue() throws Exception { // closed consumer tests // - /* Test that an ack can be sent after the consumer that received the message has been closed. + /* + * Test that an ack can be sent after the consumer that received the message has been closed. * Acks are scoped per session. */ @@ -682,8 +683,8 @@ public void testSendMessageAndCloseConsumer1() throws Exception { } /** - * Basically the same test as before, with more than one message and a slightly different - * way of checking the messages are back in the queue. + * Basically the same test as before, with more than one message and a slightly different way of checking the + * messages are back in the queue. */ @Test public void testSendMessageAndCloseConsumer2() throws Exception { @@ -1118,9 +1119,6 @@ public void testRedel6() throws Exception { } } - /** - * http://www.jboss.org/index.html?module=bb&op=viewtopic&t=71350 - */ @Test public void testRedel7() throws Exception { Connection conn = null; @@ -1172,9 +1170,6 @@ public void testRedel7() throws Exception { } } - /** - * http://www.jboss.org/index.html?module=bb&op=viewtopic&t=71350 - */ @Test public void testRedel8() throws Exception { Connection conn = null; @@ -2693,9 +2688,8 @@ public void testTopicRedelivery() throws Exception { } /** - * Topics shouldn't persist messages for non durable subscribers and redeliver them on reconnection - * even if delivery mode of persistent is specified - * See JMS spec. sec. 6.12 + * Topics shouldn't persist messages for non durable subscribers and redeliver them on reconnection even if delivery + * mode of persistent is specified See JMS spec. sec. 6.12 */ @Test public void testNoRedeliveryOnNonDurableSubscriber() throws Exception { @@ -3416,7 +3410,6 @@ public void testRedelMessageListener2() throws Exception { } } - // http://jira.jboss.org/jira/browse/JBMESSAGING-1294 - commented out until 2.0 beta @Test public void testExceptionMessageListener1() throws Exception { Connection conn = createConnection(); 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 0cc2eab0335..60aee188144 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 @@ -82,9 +82,6 @@ public void testSendForeignWithForeignDestinationSet() throws Exception { private static class SimpleDestination implements Destination, Serializable { - /** - * - */ private static final long serialVersionUID = -2553676986492799801L; } diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageWithReadResolveTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageWithReadResolveTest.java index dda5f9aa27b..981d4d72d41 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageWithReadResolveTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MessageWithReadResolveTest.java @@ -27,14 +27,7 @@ import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport; import org.junit.jupiter.api.Test; -/** - * A MessageWithReadResolveTest - *
                      - * See http://jira.jboss.com/jira/browse/JBMESSAGING-442 - */ public class MessageWithReadResolveTest extends JMSTestCase { - - @Test public void testSendReceiveMessage() throws Exception { Connection conn = createConnection(); @@ -72,7 +65,7 @@ public void testSendReceiveMessage() throws Exception { - /* This class would trigger the exception when serialized with jboss serialization */ + // This class would trigger the exception when serialized with jboss serialization public static class TestMessage implements Serializable { private static final long serialVersionUID = -5932581134414145967L; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MiscellaneousTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MiscellaneousTest.java index 9132af09b16..6aa0fd473f8 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MiscellaneousTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/MiscellaneousTest.java @@ -78,9 +78,6 @@ public void testBrowser() throws Exception { } } - /** - * Test case for http://jira.jboss.org/jira/browse/JBMESSAGING-542 - */ @Test public void testClosingConsumerFromMessageListenerAutoAck() throws Exception { Connection c = null; @@ -127,9 +124,6 @@ public void testClosingConsumerFromMessageListenerAutoAck() throws Exception { } - /** - * Test case for http://jira.jboss.org/jira/browse/JBMESSAGING-542 - */ @Test public void testClosingConsumerFromMessageListenerTransacted() throws Exception { Connection c = null; @@ -174,7 +168,6 @@ public void testClosingConsumerFromMessageListenerTransacted() throws Exception } - // Test case for http://jira.jboss.com/jira/browse/JBMESSAGING-788 @Test public void testGetDeliveriesForSession() throws Exception { Connection conn = null; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/NonDurableSubscriberTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/NonDurableSubscriberTest.java index db91e78897d..133c09702b5 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/NonDurableSubscriberTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/NonDurableSubscriberTest.java @@ -29,8 +29,6 @@ */ public class NonDurableSubscriberTest extends JMSTestCase { - - /** * Test introduced as a result of a TCK failure. */ 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 622079e2c18..1f9295a7c81 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 @@ -379,7 +379,7 @@ public void testMessageOrderPersistence_2() throws Exception { } } - /* + /** * Test durable subscription state survives a server crash */ @Test @@ -431,7 +431,7 @@ public void testDurableSubscriptionPersistence_1() throws Exception { } } - /* + /** * Test durable subscription state survives a restart */ @Test diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/QueueTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/QueueTest.java index a6a48d5b0ab..52dd3616a0e 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/QueueTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/QueueTest.java @@ -57,7 +57,6 @@ public void testQueue() throws Exception { } } - // http://jira.jboss.com/jira/browse/JBMESSAGING-1101 @Test public void testBytesMessagePersistence() throws Exception { Connection conn = null; @@ -104,7 +103,6 @@ public void testBytesMessagePersistence() throws Exception { } } - // added for http://jira.jboss.org/jira/browse/JBMESSAGING-899 @Test public void testClosedConsumerAfterStart() throws Exception { // This loop is to increase chances of a failure. diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ReferenceableTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ReferenceableTest.java index e165574c585..11d7c4dae7d 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ReferenceableTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ReferenceableTest.java @@ -38,7 +38,7 @@ /** * A ReferenceableTest. - *
                      + *

                      * All administered objects should be referenceable and serializable as per spec 4.2 */ public class ReferenceableTest extends JMSTestCase { diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java index d5ef0790fb8..2adbf31c522 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/SecurityTest.java @@ -49,7 +49,7 @@ /** * Test JMS Security. - *
                      + *

                      * This test must be run with the Test security config. on the server */ public class SecurityTest extends JMSTestCase { @@ -354,8 +354,6 @@ public void onException(Message message, Exception exception) { connection.close(); } - /* Now some client id tests */ - /** * user/pwd with preconfigured clientID, should return preconf */ @@ -409,7 +407,7 @@ public void testSetClientIDPreConf() throws Exception { } } - /* + /** * Try setting client ID after an operation has been performed on the connection */ @Test 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 8ff9e9ed45e..2fc10b9ed7e 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 @@ -123,9 +123,7 @@ public void testTemporaryQueueBasic() throws Exception { } } } - /** - * http://jira.jboss.com/jira/browse/JBMESSAGING-93 - */ + @Test public void testTemporaryQueueOnClosedSession() throws Exception { Connection producerConnection = null; @@ -310,9 +308,6 @@ public void testTemporaryTopicBasic() throws Exception { } } - /** - * http://jira.jboss.com/jira/browse/JBMESSAGING-93 - */ @Test public void testTemporaryTopicOnClosedSession() throws Exception { Connection producerConnection = null; @@ -371,9 +366,6 @@ public void testTemporaryQueueShouldNotBeInJNDI() throws Exception { } } - /** - * https://jira.jboss.org/jira/browse/JBMESSAGING-1566 - */ @Test public void testCanNotCreateConsumerFromAnotherConnectionForTemporaryQueue() throws Exception { Connection conn = createConnection(); @@ -396,9 +388,6 @@ public void testCanNotCreateConsumerFromAnotherConnectionForTemporaryQueue() thr anotherConn.close(); } - /** - * https://jira.jboss.org/jira/browse/JBMESSAGING-1566 - */ @Test public void testCanNotCreateConsumerFromAnotherCnnectionForTemporaryTopic() throws Exception { Connection conn = createConnection(); diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TopicTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TopicTest.java index 06a91daf609..982742e65be 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TopicTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/TopicTest.java @@ -74,9 +74,6 @@ public void testTopicName() throws Exception { ProxyAssertSupport.assertEquals("Topic1", topic.getTopicName()); } - /* - * See http://jira.jboss.com/jira/browse/JBMESSAGING-399 - */ @Test public void testRace() throws Exception { Connection conn = createConnection(); 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 90bd3177c67..b80c281e3a1 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 @@ -438,9 +438,8 @@ public void testRedeliveredQueue() throws Exception { } /** - * Make sure redelivered flag is set on redelivery via rollback, different setup: we close the - * rolled back session and we receive the message whose acknowledgment was cancelled on a new - * session. + * Make sure redelivered flag is set on redelivery via rollback, different setup: we close the rolled back session + * and we receive the message whose acknowledgment was cancelled on a new session. */ @Test public void testRedeliveredQueue2() throws Exception { @@ -950,7 +949,6 @@ public void testRollbackIllegalState() throws Exception { * Rollback the receiving session * Close the connection * Create a new connection, session and consumer - verify messages are redelivered - * */ @Test @@ -1019,10 +1017,9 @@ public void testAckRollbackQueue() throws Exception { } - /* + /** * Send multiple messages in multiple contiguous sessions */ - @Test public void testSendMultipleQueue() throws Exception { Connection conn = createConnection(); diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/BodyIsAssignableFromTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/BodyIsAssignableFromTest.java index 5c67326307c..dcfa26f0741 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/BodyIsAssignableFromTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/BodyIsAssignableFromTest.java @@ -73,12 +73,6 @@ private void bodyAssignableFrom(JmsMessageType type, Class... clazz) throws JMSE bodyAssignableFrom(type, true, clazz); } - /** - * @param type - * @param clazz - * @param bool - * @throws JMSException - */ private void bodyAssignableFrom(final JmsMessageType type, final boolean bool, Class... clazz) throws JMSException { assertNotNull(clazz, "clazz!=null"); assertTrue(clazz.length > 0, "clazz[] not empty"); @@ -107,10 +101,6 @@ private void bodyAssignableFrom(final JmsMessageType type, final boolean bool, C } } - /** - * @param type - * @throws JMSException - */ private Object createBodySendAndReceive(JmsMessageType type) throws JMSException { Object res = null; Message msg = null; diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/BytesMessageTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/BytesMessageTest.java index 47c175d7277..7cf969d2f6d 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/BytesMessageTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/BytesMessageTest.java @@ -29,8 +29,6 @@ */ public class BytesMessageTest extends MessageTestBase { - - @Override @BeforeEach public void setUp() throws Exception { diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSReplyToHeaderTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSReplyToHeaderTest.java index 8021eedb717..1d3afe634dd 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSReplyToHeaderTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSReplyToHeaderTest.java @@ -22,13 +22,8 @@ import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport; import org.junit.jupiter.api.Test; -/** - * A JMSReplyToHeaderTest - */ public class JMSReplyToHeaderTest extends MessageHeaderTestBase { - - @Test public void testJMSDestinationSimple() throws Exception { Message m = queueProducerSession.createMessage(); 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 a61fdc88c85..54ade045b19 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 @@ -766,20 +766,16 @@ class FakeSession implements ClientSession { @Override public ClientConsumer createConsumer(final SimpleString queueName, final boolean browseOnly) throws ActiveMQException { - // TODO Auto-generated method stub return null; } @Override public ClientConsumer createConsumer(final String queueName, final boolean browseOnly) throws ActiveMQException { - // TODO Auto-generated method stub return null; } @Override public void createQueue(final String address, final String queueName) throws ActiveMQException { - // TODO Auto-generated method stub - } private final ClientMessage message; @@ -866,48 +862,16 @@ public void createTemporaryQueue(final String address, final String filter) throws ActiveMQException { } - /** - * Creates a non-temporary queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param durable whether the queue is durable or not - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable) throws ActiveMQException { } - /** - * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted - *

                      - * Notice: you will get an exception if the address or the filter doesn't match to an already existent queue - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param durable if the queue is durable - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable) throws ActiveMQException { } - /** - * Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted - *

                      - * Notice: you will get an exception if the address or the filter doesn't match to an already existent queue - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter whether the queue is durable or not - * @param durable if the queue is durable - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable) throws ActiveMQException { @@ -925,88 +889,32 @@ public void createSharedQueue(SimpleString address, SimpleString queueName, Queu } - /** - * Creates a non-temporary queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param durable whether the queue is durable or not - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createQueue(String address, RoutingType routingType, String queueName, boolean durable) throws ActiveMQException { } - /** - * Creates a non-temporary queue non-durable queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createQueue(String address, RoutingType routingType, String queueName) throws ActiveMQException { } - /** - * Creates a non-temporary queue non-durable queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName) throws ActiveMQException { } - /** - * Creates a non-temporary queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable) throws ActiveMQException { } - /** - * Creates a non-temporaryqueue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable) throws ActiveMQException { } - /** - * Creates a non-temporary queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not - * @param autoCreated whether to mark this queue as autoCreated or not - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable, @@ -1038,17 +946,6 @@ public void createQueue(SimpleString address, SimpleString queueName, boolean au } - /** - * Creates a non-temporaryqueue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @param durable whether the queue is durable or not - * @param autoCreated whether to mark this queue as autoCreated or not - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable, @@ -1075,27 +972,11 @@ public void createQueue(String address, RoutingType routingType, String queueNam } - /** - * Creates a temporary queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleString queueName) throws ActiveMQException { } - /** - * Creates a temporary queue. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createTemporaryQueue(String address, RoutingType routingType, String queueName) throws ActiveMQException { @@ -1113,15 +994,6 @@ public void createTemporaryQueue(SimpleString address, SimpleString queueName, Q } - /** - * Creates a temporary queue with a filter. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createTemporaryQueue(SimpleString address, RoutingType routingType, @@ -1130,15 +1002,6 @@ public void createTemporaryQueue(SimpleString address, } - /** - * Creates a temporary queue with a filter. - * - * @param address the queue will be bound to this address - * @param routingType the delivery mode for this queue, MULTICAST or ANYCAST - * @param queueName the name of the queue - * @param filter only messages which match this filter will be put in the queue - * @throws ActiveMQException in an exception occurs while creating the queue - */ @Override public void createTemporaryQueue(String address, RoutingType routingType, String queueName, String filter) throws ActiveMQException { @@ -1425,13 +1288,6 @@ public int getVersion() { public void createAddress(SimpleString address, EnumSet routingTypes, boolean autoCreated) throws ActiveMQException { } - /** - * Create Address with a single initial routing type - * - * @param address - * @param routingTypes - * @param autoCreated @throws ActiveMQException - */ @Override public void createAddress(SimpleString address, Set routingTypes, @@ -1439,14 +1295,6 @@ public void createAddress(SimpleString address, } - /** - * Create Address with a single initial routing type - * - * @param address - * @param routingType - * @param autoCreated - * @throws ActiveMQException - */ @Override public void createAddress(SimpleString address, RoutingType routingType, @@ -1514,66 +1362,40 @@ public boolean setTransactionTimeout(final int i) throws XAException { public void start(final Xid xid, final int i) throws XAException { } - /* (non-Javadoc) - * @see ClientSession#createTransportBuffer(byte[]) - */ public ActiveMQBuffer createBuffer(final byte[] bytes) { - // TODO Auto-generated method stub return null; } - /* (non-Javadoc) - * @see ClientSession#createTransportBuffer(int) - */ public ActiveMQBuffer createBuffer(final int size) { - // TODO Auto-generated method stub return null; } @Override public void addFailureListener(final SessionFailureListener listener) { - // TODO Auto-generated method stub } @Override public boolean removeFailureListener(final SessionFailureListener listener) { - // TODO Auto-generated method stub return false; } - /* (non-Javadoc) - * @see ClientSession#createQueue(org.apache.activemq.artemis.utils.SimpleString, org.apache.activemq.artemis.utils.SimpleString) - */ @Override public void createQueue(SimpleString address, SimpleString queueName) throws ActiveMQException { - // TODO Auto-generated method stub } - /* (non-Javadoc) - * @see ClientSession#setClientID(java.lang.String) - */ public void setClientID(String clientID) { - // TODO Auto-generated method stub } - /* (non-Javadoc) - * @see ClientSession#addMetaData(java.lang.String, java.lang.String) - */ @Override public void addMetaData(String key, String data) throws ActiveMQException { - // TODO Auto-generated method stub } - /* (non-Javadoc) - * @see ClientSession#addUniqueMetaData(java.lang.String, java.lang.String) - */ @Override public void addUniqueMetaData(String key, String data) throws ActiveMQException { - // TODO Auto-generated method stub } diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/ObjectMessageDeliveryTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/ObjectMessageDeliveryTest.java index 4c903435cfb..dec2df5e0e3 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/ObjectMessageDeliveryTest.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/ObjectMessageDeliveryTest.java @@ -28,13 +28,8 @@ import org.apache.activemq.artemis.jms.tests.util.ProxyAssertSupport; import org.junit.jupiter.api.Test; -/** - * ObjectMessageDeliveryTest - */ public class ObjectMessageDeliveryTest extends ActiveMQServerTestCase { - - static class TestObject implements Serializable { private static final long serialVersionUID = -340663970717491155L; @@ -42,9 +37,6 @@ static class TestObject implements Serializable { String text; } - /** - * - */ @Test public void testTopic() throws Exception { TopicConnection conn = getTopicConnectionFactory().createTopicConnection(); diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSBytesMessage.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSBytesMessage.java index ce113ccc9c7..17d88f38b7a 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSBytesMessage.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSBytesMessage.java @@ -396,10 +396,6 @@ public long getBodyLength() throws JMSException { return internalArray.length; } - - - - /** * Check the message is readable * diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSMapMessage.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSMapMessage.java index 7faaf657c33..e449175deb9 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSMapMessage.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSMapMessage.java @@ -433,9 +433,6 @@ public boolean itemExists(final String name) throws JMSException { } - - - /** * Check the name * diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSMessage.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSMessage.java index a32c1a6e531..7b771876586 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSMessage.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/SimpleJMSMessage.java @@ -32,13 +32,11 @@ public class SimpleJMSMessage implements Message { private boolean ignoreSetDestination; - - public SimpleJMSMessage() { properties.put("JMSXDeliveryCount", 0); } - /* + /** * This constructor is used to simulate an activemq message in which the set of the destination is ignored after receipt. */ public SimpleJMSMessage(final Destination dest) { 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 3c43a1af92f..578203ba4fa 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 @@ -47,12 +47,9 @@ public class SelectorTest extends ActiveMQServerTestCase { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); /** - * Test case for http://jira.jboss.org/jira/browse/JBMESSAGING-105 - *
                      - * Two Messages are sent to a queue. There is one receiver on the queue. The receiver only - * receives one of the messages due to a message selector only matching one of them. The receiver - * is then closed. A new receiver is now attached to the queue. Redelivery of the remaining - * message is now attempted. The message should be redelivered. + * Two Messages are sent to a queue. There is one receiver on the queue. The receiver only receives one of the + * messages due to a message selector only matching one of them. The receiver is then closed. A new receiver is now + * attached to the queue. Redelivery of the remaining message is now attempted. The message should be redelivered. */ @Test public void testSelectiveClosingConsumer() throws Exception { @@ -224,8 +221,6 @@ public void testManyQueue() throws Exception { } - // http://jira.jboss.org/jira/browse/JBMESSAGING-775 - @Test public void testManyQueueWithExpired() throws Exception { String selector1 = "beatle = 'john'"; @@ -871,8 +866,6 @@ public void testJMSCorrelationIDOnSelector() throws Exception { } } - // Test case proposed by a customer on this user forum: - // http://community.jboss.org/thread/153426?tstart=0 // This test needs to be moved away @Test @Disabled @@ -896,7 +889,7 @@ public void testMultipleConsumers() throws Exception { MessageProducer msgProducer = session.createProducer(queue1); TextMessage tm; - /* Publish messages */ + // Publish messages tm = session.createTextMessage(); tm.setText("1"); tm.setStringProperty("PROP1", "VALUE1"); 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 489cc663449..7a6daeaf9db 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 @@ -28,8 +28,8 @@ import org.slf4j.LoggerFactory; /** - * Collection of static methods to use to start/stop and interact with the in-memory JMS server. It - * is also use to start/stop a remote server. + * Collection of static methods to use to start/stop and interact with the in-memory JMS server. It is also use to + * start/stop a remote server. */ public class ServerManagement { @@ -57,8 +57,8 @@ public class ServerManagement { private static List servers = new ArrayList<>(); /** - * Makes sure that a "hollow" TestServer (either local or remote, depending on the nature of the - * test), exists and it's ready to be started. + * Makes sure that a "hollow" TestServer (either local or remote, depending on the nature of the test), exists and + * it's ready to be started. */ public static synchronized Server create() throws Exception { return new LocalTestServer(); @@ -69,8 +69,8 @@ public static void start(final int i, final String config, final boolean clearDa } /** - * When this method correctly completes, the server (local or remote) is started and fully - * operational (the server container and the server peer are created and started). + * When this method correctly completes, the server (local or remote) is started and fully operational (the server + * container and the server peer are created and started). */ public static void start(final int i, final String config, diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactory.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactory.java index 9af3dd1baf8..64d206ea40f 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactory.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/InVMInitialContextFactory.java @@ -36,7 +36,7 @@ public static Hashtable getJNDIEnvironment() { } /** - * @return the JNDI environment to use to get this InitialContextFactory. + * @return the JNDI environment to use to get this InitialContextFactory */ public static Hashtable getJNDIEnvironment(final int serverIndex) { Hashtable env = new Hashtable<>(); diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/Server.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/Server.java index 62b840fa898..817fbecd62b 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/Server.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/tools/container/Server.java @@ -35,32 +35,33 @@ public interface Server extends Remote { int getServerID() throws Exception; /** - * @param attrOverrides - server attribute overrides that will take precedence over values - * read from configuration files. + * Start this server. + * + * @param attrOverrides server attribute overrides that will take precedence over values read from configuration + * files. */ void start(Map configuration, boolean clearDatabase) throws Exception; /** - * @return true if the server was stopped indeed, or false if the server was stopped already - * when the method was invoked. + * Stop this server. + * + * @return true if the server was stopped indeed, or false if the server was stopped already when the method was + * invoked. */ boolean stop() throws Exception; /** - * For a remote server, it "abruptly" kills the VM running the server. For a local server - * it just stops the server. + * For a remote server, it "abruptly" kills the VM running the server. For a local server it just stops the server. */ void kill() throws Exception; /** - * When kill is called you are actually scheduling the server to be killed in few milliseconds. - * There are certain cases where we need to assure the server was really killed. - * For that we have this simple ping we can use to verify if the server still alive or not. + * When kill is called you are actually scheduling the server to be killed in few milliseconds. There are certain + * cases where we need to assure the server was really killed. For that we have this simple ping we can use to verify + * if the server still alive or not. */ void ping() throws Exception; - /** - */ void startServerPeer() throws Exception; void stopServerPeer() throws Exception; @@ -68,19 +69,8 @@ public interface Server extends Remote { boolean isStarted() throws Exception; /** - * Only for in-VM use! - */ - // MessageStore getMessageStore() throws Exception; - - /** - * Only for in-VM use! + * Only for in-VM use */ - // DestinationManager getDestinationManager() throws Exception; - // StorageManager getPersistenceManager() throws Exception; - // - // /** - // * Only for in-VM use - // */ ActiveMQServer getServerPeer() throws Exception; void createQueue(String name, String jndiName) throws Exception; @@ -91,48 +81,6 @@ public interface Server extends Remote { void destroyTopic(String name, String jndiName) throws Exception; - // /** - // * Simulates a topic deployment (copying the topic descriptor in the deploy directory). - // */ - // void deployTopic(String name, String jndiName, boolean manageConfirmations) throws Exception; - // - // /** - // * Simulates a topic deployment (copying the topic descriptor in the deploy directory). - // */ - // void deployTopic(String name, String jndiName, int fullSize, int pageSize, - // int downCacheSize, boolean manageConfirmations) throws Exception; - // - // /** - // * Creates a topic programmatically. - // */ - // void deployTopicProgrammatically(String name, String jndiName) throws Exception; - // - // /** - // * Simulates a queue deployment (copying the queue descriptor in the deploy directory). - // */ - // void deployQueue(String name, String jndiName, boolean manageConfirmations) throws Exception; - // - // /** - // * Simulates a queue deployment (copying the queue descriptor in the deploy directory). - // */ - // void deployQueue(String name, String jndiName, int fullSize, int pageSize, - // int downCacheSize, boolean manageConfirmations) throws Exception; - // - // /** - // * Creates a queue programmatically. - // */ - // void deployQueueProgrammatically(String name, String jndiName) throws Exception; - - /** - * Simulates a destination un-deployment (deleting the destination descriptor from the deploy - * directory). - */ - // void undeployDestination(boolean isQueue, String name) throws Exception; - - /** - * Destroys a programmatically created destination. - */ - // boolean undeployDestinationProgrammatically(boolean isQueue, String name) throws Exception; void deployConnectionFactory(String clientId, JMSFactoryType type, String objectName, diff --git a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/amqpJMS/ActiveMQAMQPAdmin.java b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/amqpJMS/ActiveMQAMQPAdmin.java index c9b3509fac2..ef673ad70b5 100644 --- a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/amqpJMS/ActiveMQAMQPAdmin.java +++ b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/amqpJMS/ActiveMQAMQPAdmin.java @@ -35,9 +35,6 @@ import org.apache.qpid.jms.JmsQueue; import org.apache.qpid.jms.JmsTopic; -/** - * - */ public class ActiveMQAMQPAdmin extends AbstractAdmin { Context context; diff --git a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/amqpJMS/JoramAMQPAggregationTest.java b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/amqpJMS/JoramAMQPAggregationTest.java index 882d6bd50c7..2975ec2b3b2 100644 --- a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/amqpJMS/JoramAMQPAggregationTest.java +++ b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/amqpJMS/JoramAMQPAggregationTest.java @@ -53,8 +53,6 @@ public class JoramAMQPAggregationTest extends Assert { /** * Should be overridden - * - * @return */ protected static Properties getProviderProperties() throws IOException { Properties props = new Properties(); diff --git a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/AbstractAdmin.java b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/AbstractAdmin.java index 1b048b9a109..3a842222db6 100644 --- a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/AbstractAdmin.java +++ b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/AbstractAdmin.java @@ -38,9 +38,6 @@ import org.apache.activemq.artemis.utils.SpawnedVMSupport; import org.objectweb.jtests.jms.admin.Admin; -/** - * AbstractAdmin. - */ public class AbstractAdmin implements Admin { protected ClientSession clientSession; @@ -59,9 +56,8 @@ public class AbstractAdmin implements Admin { public static final boolean spawnServer = false; /** - * Determines whether to act or 'no-op' on serverStart() and - * serverStop(). This is used when testing combinations of client and - * servers with different versions. + * Determines whether to act or 'no-op' on serverStart() and serverStop(). This is used when testing combinations of + * client and servers with different versions. */ private static final String SERVER_LIVE_CYCLE_PROPERTY = "org.apache.activemq.artemis.jms.ActiveMQAMQPAdmin.serverLifeCycle"; 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 f6f9455e662..0e76b585413 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 @@ -45,22 +45,17 @@ /** * A read-only Context *

                      - * This version assumes it and all its subcontext are - * read-only and any attempt to modify (e.g. through bind) will result in an - * OperationNotSupportedException. Each Context in the tree builds a cache of - * the entries in all sub-contexts to optimise the performance of lookup. + * This version assumes it and all its subcontext are read-only and any attempt to modify (e.g. through bind) will + * result in an OperationNotSupportedException. Each Context in the tree builds a cache of the entries in all + * sub-contexts to optimise the performance of lookup. *

                      - *

                      - * This implementation is intended to optimise the performance of lookup(String) - * to about the level of a HashMap get. It has been observed that the scheme - * resolution phase performed by the JVM takes considerably longer, so for - * optimum performance lookups should be coded like: - *

                      - * - * Context componentContext = (Context)new InitialContext().lookup("java:comp"); - * String envEntry = (String) componentContext.lookup("env/myEntry"); - * String envEntry2 = (String) componentContext.lookup("env/myEntry2"); - * + * This implementation is intended to optimise the performance of lookup(String) to about the level of a HashMap get. It + * has been observed that the scheme resolution phase performed by the JVM takes considerably longer, so for optimum + * performance lookups should be coded like: + *
                      {@code
                      + * Context componentContext = (Context)new InitialContext().lookup("java:comp"); String envEntry = (String)
                      + * componentContext.lookup("env/myEntry"); String envEntry2 = (String) componentContext.lookup("env/myEntry2");
                      + * }
                      */ @SuppressWarnings("unchecked") public class TestContext implements Context, Serializable { @@ -139,19 +134,11 @@ boolean isFrozen() { } /** - * internalBind is intended for use only during setup or possibly by - * suitably synchronized superclasses. It binds every possible lookup into a - * map in each context. To do this, each context strips off one name segment - * and if necessary creates a new context for it. Then it asks that context - * to bind the remaining name. It returns a map containing all the bindings - * from the next context, plus the context it just created (if it in fact - * created it). (the names are suitably extended by the segment originally - * lopped off). - * - * @param name - * @param value - * @return - * @throws NamingException + * internalBind is intended for use only during setup or possibly by suitably synchronized superclasses. It binds + * every possible lookup into a map in each context. To do this, each context strips off one name segment and if + * necessary creates a new context for it. Then it asks that context to bind the remaining name. It returns a map + * containing all the bindings from the next context, plus the context it just created (if it in fact created it). + * (the names are suitably extended by the segment originally lopped off). */ protected Map internalBind(String name, Object value) throws NamingException { assert name != null && !name.isEmpty(); diff --git a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/testjndi/TestContextFactory.java b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/testjndi/TestContextFactory.java index 15cc51cb8bf..ea59df13579 100644 --- a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/testjndi/TestContextFactory.java +++ b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/common/testjndi/TestContextFactory.java @@ -31,11 +31,10 @@ import org.apache.activemq.artemis.uri.ConnectionFactoryParser; /** - * A factory of the ActiveMQ Artemis InitialContext which contains - * {@link ConnectionFactory} instances as well as a child context called + * A factory of the ActiveMQ Artemis InitialContext which contains {@link ConnectionFactory} instances as well as a + * child context called * destinations which contain all of the current active destinations, in - * child context depending on the QoS such as transient or durable and queue or - * topic. + * child context depending on the QoS such as transient or durable and queue or topic. */ public class TestContextFactory implements InitialContextFactory { diff --git a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/jms/JoramCoreAggregationTest.java b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/jms/JoramCoreAggregationTest.java index 96bd41b5841..13d66235ed5 100644 --- a/tests/joram-tests/src/test/java/org/apache/activemq/artemis/jms/JoramCoreAggregationTest.java +++ b/tests/joram-tests/src/test/java/org/apache/activemq/artemis/jms/JoramCoreAggregationTest.java @@ -53,8 +53,6 @@ public class JoramCoreAggregationTest extends Assert { /** * Should be overridden - * - * @return */ protected static Properties getProviderProperties() throws IOException { Properties props = new Properties(); diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/admin/Admin.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/admin/Admin.java index ea150f3fb6f..39aec82009b 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/admin/Admin.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/admin/Admin.java @@ -21,100 +21,90 @@ /** * Simple Administration interface. - *
                      - * JMS Provider has to implement this - * simple interface to be able to use the test suite. + *

                      + * JMS Provider has to implement this simple interface to be able to use the test suite. */ public interface Admin { /** - * Returns the name of the JMS Provider. - * - * @return name of the JMS Provider + * {@return name of the JMS Provider} */ String getName(); /** - * Returns an Context for the JMS Provider. - * - * @return an Context for the JMS Provider. + * {@return an {@code Context} for the JMS Provider} */ Context createContext() throws NamingException; /** - * Creates a ConnectionFactory and makes it available - * from JNDI with name name. + * Creates a {@code ConnectionFactory} and makes it available from JNDI with name {@code name}. * - * @param name JNDI name of the ConnectionFactory + * @param name JNDI name of the {@code ConnectionFactory} * @since JMS 1.1 */ void createConnectionFactory(String name); /** - * Creates a QueueConnectionFactory and makes it available - * from JNDI with name name. + * Creates a {@code QueueConnectionFactory} and makes it available from JNDI with name {@code name}. * - * @param name JNDI name of the QueueConnectionFactory + * @param name JNDI name of the {@code QueueConnectionFactory} */ void createQueueConnectionFactory(String name); /** - * Creates a TopicConnectionFactory and makes it available - * from JNDI with name name. + * Creates a {@code TopicConnectionFactory} and makes it available from JNDI with name {@code name}. * - * @param name JNDI name of the TopicConnectionFactory + * @param name JNDI name of the {@code TopicConnectionFactory} */ void createTopicConnectionFactory(String name); /** - * Creates a Queue and makes it available - * from JNDI with name name. + * Creates a {@code Queue} and makes it available from JNDI with name {@code name}. * - * @param name JNDI name of the Queue + * @param name JNDI name of the {@code Queue} */ void createQueue(String name); /** - * Creates a Topic and makes it available - * from JNDI with name name. + * Creates a {@code Topic} and makes it available from JNDI with name {@code name}. * - * @param name JNDI name of the Topic + * @param name JNDI name of the {@code Topic} */ void createTopic(String name); /** - * Removes the Queue of name name from JNDI and deletes it + * Removes the {@code Queue} of name {@code name} from JNDI and deletes it * - * @param name JNDI name of the Queue + * @param name JNDI name of the {@code Queue} */ void deleteQueue(String name); /** - * Removes the Topic of name name from JNDI and deletes it + * Removes the {@code Topic} of name {@code name} from JNDI and deletes it * - * @param name JNDI name of the Topic + * @param name JNDI name of the {@code Topic} */ void deleteTopic(String name); /** - * Removes the ConnectionFactory of name name from JNDI and deletes it + * Removes the {@code ConnectionFactory} of name {@code name} from JNDI and deletes it * - * @param name JNDI name of the ConnectionFactory + * @param name JNDI name of the {@code ConnectionFactory} * @since JMS 1.1 */ void deleteConnectionFactory(String name); /** - * Removes the QueueConnectionFactory of name name from JNDI and deletes it + * Removes the {@code QueueConnectionFactory} of name {@code name} from JNDI and deletes it * - * @param name JNDI name of the QueueConnectionFactory + * @param name JNDI name of the {@code QueueConnectionFactory} */ void deleteQueueConnectionFactory(String name); /** - * Removes the TopicConnectionFactory of name name from JNDI and deletes it + * Removes the {@code TopicConnectionFactory} of name {@code name} from JNDI and deletes it * - * @param name JNDI name of the TopicConnectionFactory + * @param name JNDI name of the {@code TopicConnectionFactory} */ void deleteTopicConnectionFactory(String name); @@ -129,8 +119,8 @@ public interface Admin { void stopServer() throws Exception; /** - * Optional method for processing to be made after the Admin is instantiated and before - * it is used to create the administrated objects + * Optional method for processing to be made after the Admin is instantiated and before it is used to create the + * administrated objects */ void start() throws Exception; diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/connection/ConnectionTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/connection/ConnectionTest.java index 86fa092cb9e..9048c2cc06c 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/connection/ConnectionTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/connection/ConnectionTest.java @@ -34,8 +34,8 @@ public class ConnectionTest extends PTPTestCase { /** - * Test that invoking the acknowledge() method of a received message - * from a closed connection's session must throw an IllegalStateException. + * Test that invoking the {@code acknowledge()} method of a received message from a closed connection's session must + * throw an {@code IllegalStateException}. */ @Test public void testAcknowledge() { @@ -66,8 +66,9 @@ public void testAcknowledge() { } /** - * Test that an attempt to use a Connection which has been closed - * throws a javax.jms.IllegalStateException. + * Test that an attempt to use a {@code Connection} which has been closed + * + * @throws a {@code javax.jms.IllegalStateException}. */ @Test public void testUseClosedConnection() { @@ -84,8 +85,7 @@ public void testUseClosedConnection() { } /** - * Test that a MessageProducer can send messages while a - * Connection is stopped. + * Test that a {@code MessageProducer} can send messages while a {@code Connection} is stopped. */ @Test public void testMessageSentWhenConnectionClosed() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageBodyTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageBodyTest.java index 245cde62d2f..998f804c6d5 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageBodyTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageBodyTest.java @@ -32,8 +32,7 @@ public class MessageBodyTest extends PTPTestCase { /** - * Test that the TextMessage.clearBody() method does not clear the - * message properties. + * Test that the {@code TextMessage.clearBody()} method does not clear the message properties. */ @Test public void testClearBody_2() { @@ -48,7 +47,7 @@ public void testClearBody_2() { } /** - * Test that the TextMessage.clearBody() effectively clear the body of the message + * Test that the {@code TextMessage.clearBody()} effectively clear the body of the message */ @Test public void testClearBody_1() { @@ -63,8 +62,8 @@ public void testClearBody_1() { } /** - * Test that a call to the TextMessage.setText() method on a - * received message raises a javax.jms.MessageNotWriteableException. + * Test that a call to the {@code TextMessage.setText()} method on a received message raises a + * {@code javax.jms.MessageNotWriteableException}. */ @Test public void testWriteOnReceivedBody() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageDefaultTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageDefaultTest.java index ca3ede0ec8c..88673aeee7f 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageDefaultTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageDefaultTest.java @@ -25,13 +25,13 @@ // FIXME include in TestSuite @RunWith(Suite.class)@Suite.SuiteClasses(...) /** - * Test the default constants of the javax.jms.Message interface. + * Test the default constants of the {@code javax.jms.Message} interface. */ public class MessageDefaultTest extends JMSTestCase { /** - * test that the DEFAULT_ROUTING_TYPE of javax.jms.Message - * corresponds to javax.jms.Delivery.PERSISTENT. + * test that the {@code DEFAULT_ROUTING_TYPE} of {@code javax.jms.Message} corresponds to + * {@code javax.jms.Delivery.PERSISTENT}. */ @Test public void testDEFAULT_DELIVERY_MODE() { @@ -39,8 +39,7 @@ public void testDEFAULT_DELIVERY_MODE() { } /** - * test that the DEFAULT_PRIORITY of javax.jms.Message - * corresponds to 4. + * test that the {@code DEFAULT_PRIORITY} of {@code javax.jms.Message} corresponds to 4. */ @Test public void testDEFAULT_PRIORITY() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageTypeTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageTypeTest.java index a9bf928802e..28df5a6998d 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageTypeTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/MessageTypeTest.java @@ -33,26 +33,23 @@ /** * Test the different types of messages provided by JMS. - *
                      + *

                      * JMS provides 6 types of messages which differs by the type of their body: *

                        - *
                      1. Message which doesn't have a body
                      2. - *
                      3. TextMessage with a String as body
                      4. - *
                      5. ObjectMessage with any Object as body
                      6. - *
                      7. BytesMessage with a body made of bytes
                      8. - *
                      9. MapMessage with name-value pairs of Java primitives in its body
                      10. - *
                      11. StreamMessage with a stream of Java primitives as body
                      12. + *
                      13. {@code Message} which doesn't have a body
                      14. + *
                      15. {@code TextMessage} with a {@code String} as body
                      16. + *
                      17. {@code ObjectMessage} with any {@code Object} as body
                      18. + *
                      19. {@code BytesMessage} with a body made of {@code bytes}
                      20. + *
                      21. {@code MapMessage} with name-value pairs of Java primitives in its body
                      22. + *
                      23. {@code StreamMessage} with a stream of Java primitives as body
                      24. *
                      - *
                      - * For each of this type of message, we test that a message can be sent and received - * with an empty body or not. + * For each of this type of message, we test that a message can be sent and received with an empty body or not. */ public class MessageTypeTest extends PTPTestCase { /** - * Send a StreamMessage with 2 Java primitives in its body (a - * String and a double). - *
                      + * Send a {@code StreamMessage} with 2 Java primitives in its body (a {@code String} and a {@code double}). + *

                      * Receive it and test that the values of the primitives of the body are correct */ @Test @@ -74,10 +71,9 @@ public void testStreamMessage_2() { } /** - * Send a StreamMessage with an empty body. - *
                      - * Receive it and test if the message is effectively an instance of - * StreamMessage + * Send a {@code StreamMessage} with an empty body. + *

                      + * Receive it and test if the message is effectively an instance of {@code StreamMessage} */ @Test public void testStreamMessage_1() { @@ -93,8 +89,8 @@ public void testStreamMessage_1() { } /** - * Test in MapMessage the conversion between getObject("foo") and - * getDouble("foo") (the later returning a java.lang.Double and the former a double) + * Test in MapMessage the conversion between {@code getObject("foo")} and {@code getDouble("foo")} (the later + * returning a java.lang.Double and the former a double) */ @Test public void testMapMessageConversion() { @@ -115,11 +111,8 @@ public void testMapMessageConversion() { } /** - * Test that the if the name parameter of the set methods of a MapMessage is null, - * the method must throw the error java.lang.IllegalArgumentException. - *
                      - * - * @since JMS 1.1 + * Test that the if the name parameter of the set methods of a {@code MapMessage} is {@code null}, the method must + * throw the error {@code java.lang.IllegalArgumentException}. */ @Test public void testNullInSetMethodsForMapMessage() { @@ -134,11 +127,8 @@ public void testNullInSetMethodsForMapMessage() { } /** - * Test that the if the name parameter of the set methods of a MapMessage is an empty String, - * the method must throw the error java.lang.IllegalArgumentException. - *
                      - * - * @since JMS 1.1 + * Test that the if the name parameter of the set methods of a {@code MapMessage} is an empty String, the method must + * throw the error {@code java.lang.IllegalArgumentException}. */ @Test public void testEmptyStringInSetMethodsForMapMessage() { @@ -153,9 +143,9 @@ public void testEmptyStringInSetMethodsForMapMessage() { } /** - * Test that the MapMessage.getMapNames() method returns an - * empty Enumeration when no map has been defined before. - *
                      + * Test that the {@code MapMessage.getMapNames()} method returns an empty {@code Enumeration} when no map has been + * defined before. + *

                      * Also test that the same method returns the correct names of the map. */ @Test @@ -173,9 +163,8 @@ public void testgetMapNames() { } /** - * Send a MapMessage with 2 Java primitives in its body (a - * String and a double). - *
                      + * Send a {@code MapMessage} with 2 Java primitives in its body (a {@code String} and a {@code double}). + *

                      * Receive it and test that the values of the primitives of the body are correct */ @Test @@ -197,10 +186,9 @@ public void testMapMessage_2() { } /** - * Send a MapMessage with an empty body. - *
                      - * Receive it and test if the message is effectively an instance of - * MapMessage + * Send a {@code MapMessage} with an empty body. + *

                      + * Receive it and test if the message is effectively an instance of {@code MapMessage} */ @Test public void testMapMessage_1() { @@ -216,9 +204,9 @@ public void testMapMessage_1() { } /** - * Send an ObjectMessage with a Vector (composed of a - * String and a double) in its body. - *
                      + * Send an {@code ObjectMessage} with a {@code Vector} (composed of a {@code String} and a {@code double}) in its + * body. + *

                      * Receive it and test that the values of the primitives of the body are correct */ @Test @@ -242,10 +230,9 @@ public void testObjectMessage_2() { } /** - * Send a ObjectMessage with an empty body. - *
                      - * Receive it and test if the message is effectively an instance of - * ObjectMessage + * Send a {@code ObjectMessage} with an empty body. + *

                      + * Receive it and test if the message is effectively an instance of {@code ObjectMessage} */ @Test public void testObjectMessage_1() { @@ -261,9 +248,8 @@ public void testObjectMessage_1() { } /** - * Send a BytesMessage with 2 Java primitives in its body (a - * String and a double). - *
                      + * Send a {@code BytesMessage} with 2 Java primitives in its body (a {@code String} and a {@code double}). + *

                      * Receive it and test that the values of the primitives of the body are correct */ @Test @@ -288,10 +274,9 @@ public void testBytesMessage_2() { } /** - * Send a BytesMessage with an empty body. - *
                      - * Receive it and test if the message is effectively an instance of - * BytesMessage + * Send a {@code BytesMessage} with an empty body. + *

                      + * Receive it and test if the message is effectively an instance of {@code BytesMessage} */ @Test public void testBytesMessage_1() { @@ -307,10 +292,9 @@ public void testBytesMessage_1() { } /** - * Send a TextMessage with a String in its body. - *
                      - * Receive it and test that the received String corresponds to - * the sent one. + * Send a {@code TextMessage} with a {@code String} in its body. + *

                      + * Receive it and test that the received {@code String} corresponds to the sent one. */ @Test public void testTextMessage_2() { @@ -329,10 +313,9 @@ public void testTextMessage_2() { } /** - * Send a TextMessage with an empty body. - *
                      - * Receive it and test if the message is effectively an instance of - * TextMessage + * Send a {@code TextMessage} with an empty body. + *

                      + * Receive it and test if the message is effectively an instance of {@code TextMessage} */ @Test public void testTextMessage_1() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/headers/MessageHeaderTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/headers/MessageHeaderTest.java index 7eea7f10da7..ec54c4b2c39 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/headers/MessageHeaderTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/headers/MessageHeaderTest.java @@ -39,8 +39,7 @@ public class MessageHeaderTest extends PTPTestCase { /** - * Test that the MessageProducer.setPriority() changes effectively - * priority of the message. + * Test that the {@code MessageProducer.setPriority()} changes effectively priority of the message. */ @Test public void testJMSPriority_2() { @@ -58,9 +57,8 @@ public void testJMSPriority_2() { } /** - * Test that the priority set by Message.setJMSPriority() is ignored when a - * message is sent and that it holds the value specified when sending the message (i.e. - * Message.DEFAULT_PRIORITY in this test). + * Test that the priority set by {@code Message.setJMSPriority()} is ignored when a message is sent and that it holds + * the value specified when sending the message (i.e. {@code Message.DEFAULT_PRIORITY} in this test). */ @Test public void testJMSPriority_1() { @@ -78,8 +76,8 @@ public void testJMSPriority_1() { } /** - * Test that the value of the JMSExpiration header field is the same - * for the sent message and the received one. + * Test that the value of the {@code JMSExpiration} header field is the same for the sent message and the + * received one. */ @Test public void testJMSExpiration() { @@ -95,8 +93,8 @@ public void testJMSExpiration() { } /** - * Test that the JMSMessageID is set by the provider when the send method returns - * and that it starts with "ID:". + * Test that the {@code JMSMessageID} is set by the provider when the {@code send} method returns and that it starts + * with {@code "ID:"}. */ @Test public void testJMSMessageID_2() { @@ -114,8 +112,7 @@ public void testJMSMessageID_2() { } /** - * Test that the JMSMessageID header field value is - * ignored when the message is sent. + * Test that the {@code JMSMessageID} header field value is ignored when the message is sent. */ @Test public void testJMSMessageID_1() { @@ -131,9 +128,9 @@ public void testJMSMessageID_1() { } /** - * Test that the JMSDeliveryMode header field value is ignored - * when the message is sent and that it holds the value specified by the sending - * method (i.e. Message.DEFAULT_ROUTING_TYPE in this test when the message is received. + * Test that the {@code JMSDeliveryMode} header field value is ignored when the message is sent and that it holds the + * value specified by the sending method (i.e. {@code Message.DEFAULT_ROUTING_TYPE} in this test when the message is + * received. */ @Test public void testJMSDeliveryMode() { @@ -154,10 +151,9 @@ public void testJMSDeliveryMode() { } /** - * Test that the JMSDestination header field value is ignored when the message - * is sent and that after completion of the sending method, it holds the Destination - * specified by the sending method. - * Also test that the value of the header on the received message is the same that on the sent message. + * Test that the {@code JMSDestination} header field value is ignored when the message is sent and that after + * completion of the sending method, it holds the {@code Destination} specified by the sending method. Also test that + * the value of the header on the received message is the same that on the sent message. */ @Test public void testJMSDestination() { @@ -193,9 +189,8 @@ public void testJMSDestination() { } /** - * Test that a Destination set by the setJMSReplyTo() - * method on a sended message corresponds to the Destination get by - * the getJMSReplyTo() method. + * Test that a {@code Destination} set by the {@code setJMSReplyTo()} method on a sended message corresponds to the + * {@code Destination} get by the {@code getJMSReplyTo()} method. */ @Test public void testJMSReplyTo_1() { @@ -215,9 +210,8 @@ public void testJMSReplyTo_1() { } /** - * Test that if the JMS ReplyTo header field has been set as a TemporaryQueue, - * it will be rightly get also as a TemporaryQueue - * (and not only as a Queue). + * Test that if the JMS ReplyTo header field has been set as a {@code TemporaryQueue}, it will be rightly get also as + * a {@code TemporaryQueue} (and not only as a {@code Queue}). */ @Test public void testJMSReplyTo_2() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/JMSXPropertyTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/JMSXPropertyTest.java index 414884a03f1..d758e9dde3e 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/JMSXPropertyTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/JMSXPropertyTest.java @@ -29,13 +29,13 @@ /** * Test the JMSX defined properties. - *
                      + *

                      * See JMS Specification, sec. 3.5.9 JMS Defined Properties */ public class JMSXPropertyTest extends PTPTestCase { /** - * Test that the JMSX property JMSXGroupID is supported. + * Test that the JMSX property {@code JMSXGroupID} is supported. */ @Test public void testSupportsJMSXGroupID() { @@ -56,7 +56,7 @@ public void testSupportsJMSXGroupID() { } /** - * Test that the JMSX property JMSXGroupID works + * Test that the JMSX property {@code JMSXGroupID} works */ @Test public void testJMSXGroupID_1() { @@ -78,7 +78,7 @@ public void testJMSXGroupID_1() { } /** - * Test that the JMSX property JMSXDeliveryCount works. + * Test that the JMSX property {@code JMSXDeliveryCount} works. */ @Test public void testJMSXDeliveryCount() throws Exception { @@ -150,7 +150,7 @@ public void testJMSXDeliveryCount() throws Exception { } /** - * checks if the JMSX property JMSXDeliveryCount is supported. + * checks if the JMSX property {@code JMSXDeliveryCount} is supported. */ private boolean supportsJMSXDeliveryCount() throws Exception { ConnectionMetaData metaData = senderConnection.getMetaData(); diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/MessagePropertyConversionTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/MessagePropertyConversionTest.java index d6fcc665b23..6453dd3f7d6 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/MessagePropertyConversionTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/MessagePropertyConversionTest.java @@ -25,14 +25,13 @@ import org.objectweb.jtests.jms.framework.PTPTestCase; /** - * Test the conversion of primitive types for the javax.jms.Message properties. - *
                      + * Test the conversion of primitive types for the {@code javax.jms.Message} properties. + *

                      * See JMS Specification, sec. 3.5.4 Property Value Conversion and the corresponding table (p.33-34). - *
                      - * The method name testXXX2YYY means that we test if a property - * which has been set as a XXX type can be read as a YYY type, - * where XXX and YYY can be boolean, byte, short, long, float - * double or String. + *

                      + * The method name {@code testXXX2YYY} means that we test if a property which has been set as a {@code XXX} type can be + * read as a {@code YYY} type, where {@code XXX} and {@code YYY} can be {@code boolean, byte, short, long, float + * double} or {@code String}. * *

                        *          ---------------------------------------------------------------|
                      @@ -49,17 +48,16 @@
                        * |-----------------------------------------------------------------------|
                        * 
                      * A value set as the row type can be read as the column type. - *
                      - * The unmarked cases must throw a javax.jms.MessageFormatException - *
                      - * The cases marked with a Y should throw a java.lang.MessageFormatException if the - * String is not a correct representation of the column type (otherwise, it returns the property). + *

                      + * The unmarked cases must throw a {@code javax.jms.MessageFormatException} + *

                      + * The cases marked with a Y should throw a {@code java.lang.MessageFormatException} if the String is + * not a correct representation of the column type (otherwise, it returns the property). */ public class MessagePropertyConversionTest extends PTPTestCase { /** - * if a property is set as a java.lang.String, - * it can also be read as a java.lang.String. + * if a property is set as a {@code java.lang.String}, it can also be read as a {@code java.lang.String}. */ @Test public void testString2String() { @@ -73,10 +71,9 @@ public void testString2String() { } /** - * if a property is set as a java.lang.String, - * to get it as a double throws a java.lang.NuberFormatException - * if the String is not a correct representation for a double - * (e.g. "not a number"). + * if a property is set as a {@code java.lang.String}, to get it as a {@code double} throws a + * {@code java.lang.NuberFormatException} if the {@code String} is not a correct representation for a {@code double} + * (e.g. {@code "not a number"}). */ @Test public void testString2Double_2() { @@ -92,9 +89,8 @@ public void testString2Double_2() { } /** - * if a property is set as a java.lang.String, - * it can also be read as a double as long as the String - * is a correct representation of a double (e.g. "3.14159"). + * if a property is set as a {@code java.lang.String}, it can also be read as a {@code double} as long as the + * {@code String} is a correct representation of a {@code double} (e.g. {@code "3.14159"}). */ @Test public void testString2Double_1() { @@ -108,10 +104,9 @@ public void testString2Double_1() { } /** - * if a property is set as a java.lang.String, - * to get it as a float throws a java.lang.NuberFormatException - * if the String is not a correct representation for a float - * (e.g. "not_a_number"). + * if a property is set as a {@code java.lang.String}, to get it as a {@code float} throws a + * {@code java.lang.NuberFormatException} if the {@code String} is not a correct representation for a {@code float} + * (e.g. {@code "not_a_number"}). */ @Test public void testString2Float_2() { @@ -127,9 +122,8 @@ public void testString2Float_2() { } /** - * if a property is set as a java.lang.String, - * it can also be read as a float as long as the String - * is a correct representation of a float (e.g. "3.14159"). + * if a property is set as a {@code java.lang.String}, it can also be read as a {@code float} as long as the + * {@code String} is a correct representation of a {@code float} (e.g. {@code "3.14159"}). */ @Test public void testString2Float_1() { @@ -143,10 +137,9 @@ public void testString2Float_1() { } /** - * if a property is set as a java.lang.String, - * to get it as a long throws a java.lang.NuberFormatException - * if the String is not a correct representation for a long - * (e.g. "3.14159"). + * if a property is set as a {@code java.lang.String}, to get it as a {@code long} throws a + * {@code java.lang.NuberFormatException} if the {@code String} is not a correct representation for a {@code long} + * (e.g. {@code "3.14159"}). */ @Test public void testString2Long_2() { @@ -162,9 +155,8 @@ public void testString2Long_2() { } /** - * if a property is set as a java.lang.String, - * it can also be read as a long as long as the String - * is a correct representation of a long (e.g. "0"). + * if a property is set as a {@code java.lang.String}, it can also be read as a {@code long} as long as the + * {@code String} is a correct representation of a {@code long} (e.g. {@code "0"}). */ @Test public void testString2Long_1() { @@ -178,10 +170,9 @@ public void testString2Long_1() { } /** - * if a property is set as a java.lang.String, - * to get it as a int throws a java.lang.NuberFormatException - * if the String is not a correct representation for a int - * (e.g. "3.14159"). + * if a property is set as a {@code java.lang.String}, to get it as a {@code int} throws a + * {@code java.lang.NuberFormatException} if the {@code String} is not a correct representation for a {@code int} + * (e.g. {@code "3.14159"}). */ @Test public void testString2Int_2() { @@ -197,9 +188,8 @@ public void testString2Int_2() { } /** - * if a property is set as a java.lang.String, - * it can also be read as a int as long as the String - * is a correct representation of a int (e.g. "0"). + * if a property is set as a {@code java.lang.String}, it can also be read as a {@code int} as long as the + * {@code String} is a correct representation of a {@code int} (e.g. {@code "0"}). */ @Test public void testString2Int_1() { @@ -213,10 +203,9 @@ public void testString2Int_1() { } /** - * if a property is set as a java.lang.String, - * to get it as a short throws a java.lang.NuberFormatException - * if the String is not a correct representation for a short - * (e.g. "3.14159"). + * if a property is set as a {@code java.lang.String}, to get it as a {@code short} throws a + * {@code java.lang.NuberFormatException} if the {@code String} is not a correct representation for a {@code short} + * (e.g. {@code "3.14159"}). */ @Test public void testString2Short_2() { @@ -232,9 +221,8 @@ public void testString2Short_2() { } /** - * if a property is set as a java.lang.String, - * it can also be read as a short as long as the String - * is a correct representation of a short (e.g. "0"). + * if a property is set as a {@code java.lang.String}, it can also be read as a {@code short} as long as the + * {@code String} is a correct representation of a {@code short} (e.g. {@code "0"}). */ @Test public void testString2Short_1() { @@ -248,10 +236,9 @@ public void testString2Short_1() { } /** - * if a property is set as a java.lang.String, - * to get it as a byte throws a java.lang.NuberFormatException - * if the String is not a correct representation for a byte - * (e.g. "3.14159"). + * if a property is set as a {@code java.lang.String}, to get it as a {@code byte} throws a + * {@code java.lang.NuberFormatException} if the {@code String} is not a correct representation for a {@code byte} + * (e.g. {@code "3.14159"}). */ @Test public void testString2Byte_2() { @@ -267,9 +254,8 @@ public void testString2Byte_2() { } /** - * if a property is set as a java.lang.String, - * it can also be read as a byte if the String - * is a correct representation of a byte (e.g. "0"). + * if a property is set as a {@code java.lang.String}, it can also be read as a {@code byte} if the {@code String} is + * a correct representation of a {@code byte} (e.g. {@code "0"}). */ @Test public void testString2Byte_1() { @@ -283,10 +269,9 @@ public void testString2Byte_1() { } /** - * if a property is set as a java.lang.String, - * to get it as a boolean returns true if the property is not - * null and is equal, ignoring case, to the string "true" (.eg. "True" is ok), else it - * returns false (e.g. "test") + * if a property is set as a {@code java.lang.String}, to get it as a {@code boolean} returns {@code true} if the + * property is not null and is equal, ignoring case, to the string "true" (.eg. "True" is ok), else it returns + * {@code false} (e.g. "test") */ @Test public void testString2Boolean_2() { @@ -301,9 +286,8 @@ public void testString2Boolean_2() { } /** - * if a property is set as a java.lang.String, - * it can also be read as a boolean if the String - * is a correct representation of a boolean (e.g. "true"). + * if a property is set as a {@code java.lang.String}, it can also be read as a {@code boolean} if the {@code String} + * is a correct representation of a {@code boolean} (e.g. {@code "true"}). */ @Test public void testString2Boolean_1() { @@ -317,8 +301,7 @@ public void testString2Boolean_1() { } /** - * if a property is set as a double, - * it can also be read as a java.lang.String. + * if a property is set as a {@code double}, it can also be read as a {@code java.lang.String}. */ @Test public void testDouble2String() { @@ -332,8 +315,7 @@ public void testDouble2String() { } /** - * if a property is set as a double, - * it can also be read as a double. + * if a property is set as a {@code double}, it can also be read as a {@code double}. */ @Test public void testDouble2Double() { @@ -347,8 +329,8 @@ public void testDouble2Double() { } /** - * if a property is set as a double, - * to get is as a float throws a javax.jms.MessageFormatException. + * if a property is set as a {@code double}, to get is as a {@code float} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testDouble2Float() { @@ -364,8 +346,8 @@ public void testDouble2Float() { } /** - * if a property is set as a double, - * to get is as a long throws a javax.jms.MessageFormatException. + * if a property is set as a {@code double}, to get is as a {@code long} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testDouble2Long() { @@ -381,8 +363,8 @@ public void testDouble2Long() { } /** - * if a property is set as a double, - * to get is as an int throws a javax.jms.MessageFormatException. + * if a property is set as a {@code double}, to get is as an {@code int} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testDouble2Int() { @@ -398,8 +380,8 @@ public void testDouble2Int() { } /** - * if a property is set as a double, - * to get is as a short throws a javax.jms.MessageFormatException. + * if a property is set as a {@code double}, to get is as a {@code short} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testDouble2Short() { @@ -416,8 +398,8 @@ public void testDouble2Short() { } /** - * if a property is set as a double, - * to get is as a byte throws a javax.jms.MessageFormatException. + * if a property is set as a {@code double}, to get is as a {@code byte} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testDouble2Byte() { @@ -434,8 +416,8 @@ public void testDouble2Byte() { } /** - * if a property is set as a double, - * to get is as a boolean throws a javax.jms.MessageFormatException. + * if a property is set as a {@code double}, to get is as a {@code boolean} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testDouble2Boolean() { @@ -452,8 +434,7 @@ public void testDouble2Boolean() { } /** - * if a property is set as a float, - * it can also be read as a String. + * if a property is set as a {@code float}, it can also be read as a {@code String}. */ @Test public void testFloat2String() { @@ -467,8 +448,7 @@ public void testFloat2String() { } /** - * if a property is set as a float, - * it can also be read as a double. + * if a property is set as a {@code float}, it can also be read as a {@code double}. */ @Test public void testFloat2Double() { @@ -482,8 +462,7 @@ public void testFloat2Double() { } /** - * if a property is set as a float, - * it can also be read as a float. + * if a property is set as a {@code float}, it can also be read as a {@code float}. */ @Test public void testFloat2Float() { @@ -497,8 +476,8 @@ public void testFloat2Float() { } /** - * if a property is set as a float, - * to get is as a long throws a javax.jms.MessageFormatException. + * if a property is set as a {@code float}, to get is as a {@code long} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testFloat2Long() { @@ -514,8 +493,8 @@ public void testFloat2Long() { } /** - * if a property is set as a float, - * to get is as a int throws a javax.jms.MessageFormatException. + * if a property is set as a {@code float}, to get is as a {@code int} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testFloat2Int() { @@ -531,8 +510,8 @@ public void testFloat2Int() { } /** - * if a property is set as a float, - * to get is as a short throws a javax.jms.MessageFormatException. + * if a property is set as a {@code float}, to get is as a {@code short} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testFloat2Short() { @@ -549,8 +528,8 @@ public void testFloat2Short() { } /** - * if a property is set as a float, - * to get is as a byte throws a javax.jms.MessageFormatException. + * if a property is set as a {@code float}, to get is as a {@code byte} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testFloat2Byte() { @@ -567,8 +546,8 @@ public void testFloat2Byte() { } /** - * if a property is set as a float, - * to get is as a boolean throws a javax.jms.MessageFormatException. + * if a property is set as a {@code float}, to get is as a {@code boolean} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testFloat2Boolean() { @@ -585,8 +564,7 @@ public void testFloat2Boolean() { } /** - * if a property is set as a long, - * it can also be read as a String. + * if a property is set as a {@code long}, it can also be read as a {@code String}. */ @Test public void testLong2String() { @@ -600,8 +578,8 @@ public void testLong2String() { } /** - * if a property is set as a long, - * to get is as a double throws a javax.jms.MessageFormatException. + * if a property is set as a {@code long}, to get is as a {@code double} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testLong2Double() { @@ -617,8 +595,8 @@ public void testLong2Double() { } /** - * if a property is set as a long, - * to get is as a float throws a javax.jms.MessageFormatException. + * if a property is set as a {@code long}, to get is as a {@code float} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testLong2Float() { @@ -634,8 +612,7 @@ public void testLong2Float() { } /** - * if a property is set as a long, - * it can also be read as a long. + * if a property is set as a {@code long}, it can also be read as a {@code long}. */ @Test public void testLong2Long() { @@ -649,8 +626,8 @@ public void testLong2Long() { } /** - * if a property is set as a long, - * to get is as an int throws a javax.jms.MessageFormatException. + * if a property is set as a {@code long}, to get is as an {@code int} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testLong2Int() { @@ -666,8 +643,8 @@ public void testLong2Int() { } /** - * if a property is set as a long, - * to get is as a short throws a javax.jms.MessageFormatException. + * if a property is set as a {@code long}, to get is as a {@code short} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testLong2Short() { @@ -684,8 +661,8 @@ public void testLong2Short() { } /** - * if a property is set as a long, - * to get is as a byte throws a javax.jms.MessageFormatException. + * if a property is set as a {@code long}, to get is as a {@code byte} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testLong2Byte() { @@ -702,8 +679,8 @@ public void testLong2Byte() { } /** - * if a property is set as a long, - * to get is as a boolean throws a javax.jms.MessageFormatException. + * if a property is set as a {@code long}, to get is as a {@code boolean} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testLong2Boolean() { @@ -720,8 +697,7 @@ public void testLong2Boolean() { } /** - * if a property is set as an int, - * it can also be read as a String. + * if a property is set as an {@code int}, it can also be read as a {@code String}. */ @Test public void testInt2String() { @@ -735,8 +711,8 @@ public void testInt2String() { } /** - * if a property is set as a int, - * to get is as a double throws a javax.jms.MessageFormatException. + * if a property is set as a {@code int}, to get is as a {@code double} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testInt2Double() { @@ -752,8 +728,8 @@ public void testInt2Double() { } /** - * if a property is set as a int, - * to get is as a float throws a javax.jms.MessageFormatException. + * if a property is set as a {@code int}, to get is as a {@code float} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testInt2Float() { @@ -769,8 +745,7 @@ public void testInt2Float() { } /** - * if a property is set as an int, - * it can also be read as a long. + * if a property is set as an {@code int}, it can also be read as a {@code long}. */ @Test public void testInt2Long() { @@ -784,8 +759,7 @@ public void testInt2Long() { } /** - * if a property is set as an int, - * it can also be read as an int. + * if a property is set as an {@code int}, it can also be read as an {@code int}. */ @Test public void testInt2Int() { @@ -799,8 +773,8 @@ public void testInt2Int() { } /** - * if a property is set as a int, - * to get is as a short throws a javax.jms.MessageFormatException. + * if a property is set as a {@code int}, to get is as a {@code short} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testInt2Short() { @@ -817,8 +791,8 @@ public void testInt2Short() { } /** - * if a property is set as a int, - * to get is as a byte throws a javax.jms.MessageFormatException. + * if a property is set as a {@code int}, to get is as a {@code byte} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testInt2Byte() { @@ -835,8 +809,8 @@ public void testInt2Byte() { } /** - * if a property is set as a int, - * to get is as a boolean throws a javax.jms.MessageFormatException. + * if a property is set as a {@code int}, to get is as a {@code boolean} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testInt2Boolean() { @@ -853,8 +827,7 @@ public void testInt2Boolean() { } /** - * if a property is set as a short, - * it can also be read as a String. + * if a property is set as a {@code short}, it can also be read as a {@code String}. */ @Test public void testShort2String() { @@ -868,8 +841,8 @@ public void testShort2String() { } /** - * if a property is set as a short, - * to get is as a double throws a javax.jms.MessageFormatException. + * if a property is set as a {@code short}, to get is as a {@code double} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testShort2Double() { @@ -885,8 +858,8 @@ public void testShort2Double() { } /** - * if a property is set as a short, - * to get is as a float throws a javax.jms.MessageFormatException. + * if a property is set as a {@code short}, to get is as a {@code float} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testShort2Float() { @@ -902,8 +875,7 @@ public void testShort2Float() { } /** - * if a property is set as a short, - * it can also be read as a long. + * if a property is set as a {@code short}, it can also be read as a {@code long}. */ @Test public void testShort2Long() { @@ -917,8 +889,7 @@ public void testShort2Long() { } /** - * if a property is set as a short, - * it can also be read as an int. + * if a property is set as a {@code short}, it can also be read as an {@code int}. */ @Test public void testShort2Int() { @@ -932,8 +903,7 @@ public void testShort2Int() { } /** - * if a property is set as a short, - * it can also be read as a short. + * if a property is set as a {@code short}, it can also be read as a {@code short}. */ @Test public void testShort2Short() { @@ -947,8 +917,8 @@ public void testShort2Short() { } /** - * if a property is set as a short, - * to get is as a byte throws a javax.jms.MessageFormatException. + * if a property is set as a {@code short}, to get is as a {@code byte} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testShort2Byte() { @@ -964,8 +934,8 @@ public void testShort2Byte() { } /** - * if a property is set as a short, - * to get is as a boolean throws a javax.jms.MessageFormatException. + * if a property is set as a {@code short}, to get is as a {@code boolean} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testShort2Boolean() { @@ -982,8 +952,7 @@ public void testShort2Boolean() { } /** - * if a property is set as a byte, - * it can also be read as a String. + * if a property is set as a {@code byte}, it can also be read as a {@code String}. */ @Test public void testByte2String() { @@ -997,8 +966,8 @@ public void testByte2String() { } /** - * if a property is set as a byte, - * to get is as a double throws a javax.jms.MessageFormatException. + * if a property is set as a {@code byte}, to get is as a {@code double} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testByte2Double() { @@ -1014,8 +983,8 @@ public void testByte2Double() { } /** - * if a property is set as a byte, - * to get is as a float throws a javax.jms.MessageFormatException. + * if a property is set as a {@code byte}, to get is as a {@code float} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testByte2Float() { @@ -1031,8 +1000,7 @@ public void testByte2Float() { } /** - * if a property is set as a byte, - * it can also be read as a long. + * if a property is set as a {@code byte}, it can also be read as a {@code long}. */ @Test public void testByte2Long() { @@ -1046,8 +1014,7 @@ public void testByte2Long() { } /** - * if a property is set as a byte, - * it can also be read as an int. + * if a property is set as a {@code byte}, it can also be read as an {@code int}. */ @Test public void testByte2Int() { @@ -1061,8 +1028,7 @@ public void testByte2Int() { } /** - * if a property is set as a byte, - * it can also be read as a short. + * if a property is set as a {@code byte}, it can also be read as a {@code short}. */ @Test public void testByte2Short() { @@ -1076,8 +1042,7 @@ public void testByte2Short() { } /** - * if a property is set as a byte, - * it can also be read as a byte. + * if a property is set as a {@code byte}, it can also be read as a {@code byte}. */ @Test public void testByte2Byte() { @@ -1091,8 +1056,8 @@ public void testByte2Byte() { } /** - * if a property is set as a byte, - * to get is as a boolean throws a javax.jms.MessageFormatException. + * if a property is set as a {@code byte}, to get is as a {@code boolean} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testByte2Boolean() { @@ -1109,8 +1074,7 @@ public void testByte2Boolean() { } /** - * if a property is set as a boolean, - * it can also be read as a String. + * if a property is set as a {@code boolean}, it can also be read as a {@code String}. */ @Test public void testBoolean2String() { @@ -1124,8 +1088,8 @@ public void testBoolean2String() { } /** - * if a property is set as a boolean, - * to get is as a double throws a javax.jms.MessageFormatException. + * if a property is set as a {@code boolean}, to get is as a {@code double} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testBoolean2Double() { @@ -1142,8 +1106,8 @@ public void testBoolean2Double() { } /** - * if a property is set as a boolean, - * to get is as a float throws a javax.jms.MessageFormatException. + * if a property is set as a {@code boolean}, to get is as a {@code float} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testBoolean2Float() { @@ -1160,8 +1124,8 @@ public void testBoolean2Float() { } /** - * if a property is set as a boolean, - * to get is as a long throws a javax.jms.MessageFormatException. + * if a property is set as a {@code boolean}, to get is as a {@code long} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testBoolean2Long() { @@ -1178,8 +1142,8 @@ public void testBoolean2Long() { } /** - * if a property is set as a boolean, - * to get is as a int throws a javax.jms.MessageFormatException. + * if a property is set as a {@code boolean}, to get is as a {@code int} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testBoolean2Int() { @@ -1196,8 +1160,8 @@ public void testBoolean2Int() { } /** - * if a property is set as a boolean, - * to get is as a short throws a javax.jms.MessageFormatException. + * if a property is set as a {@code boolean}, to get is as a {@code short} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testBoolean2Short() { @@ -1214,8 +1178,8 @@ public void testBoolean2Short() { } /** - * if a property is set as a boolean, - * to get is as a byte throws a javax.jms.MessageFormatException. + * if a property is set as a {@code boolean}, to get is as a {@code byte} throws a + * {@code javax.jms.MessageFormatException}. */ @Test public void testBoolean2Byte() { @@ -1232,8 +1196,7 @@ public void testBoolean2Byte() { } /** - * if a property is set as a boolean, - * it can also be read as a boolean. + * if a property is set as a {@code boolean}, it can also be read as a {@code boolean}. */ @Test public void testBoolean2Boolean() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/MessagePropertyTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/MessagePropertyTest.java index c9c22742a12..57528682469 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/MessagePropertyTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/MessagePropertyTest.java @@ -28,16 +28,15 @@ import org.objectweb.jtests.jms.framework.PTPTestCase; /** - * Test the javax.jms.Message properties. - *
                      + * Test the {@code javax.jms.Message} properties. + *

                      * See JMS Specification, sec. 3.5 Message Properties (p.32-37) */ public class MessagePropertyTest extends PTPTestCase { /** - * Test that any other class than Boolean, Byte, Short, Integer, Long, - * Float, Double and String used in the Message.setObjectProperty() - * method throws a javax.jms.MessageFormatException. + * Test that any other class than {@code Boolean, Byte, Short, Integer, Long, Float, Double} and {@code String} used + * in the {@code Message.setObjectProperty()} method throws a {@code javax.jms.MessageFormatException}. */ @Test public void testSetObjectProperty_2() { @@ -52,8 +51,8 @@ public void testSetObjectProperty_2() { } /** - * if a property is set as a Float with the Message.setObjectProperty() - * method, it can be retrieve directly as a double by Message.getFloatProperty() + * if a property is set as a {@code Float} with the {@code Message.setObjectProperty()} method, it can be retrieve + * directly as a {@code double} by {@code Message.getFloatProperty()} */ @Test public void testSetObjectProperty_1() { @@ -67,8 +66,8 @@ public void testSetObjectProperty_1() { } /** - * Test that a null value is returned by the Message.getObjectProperty() method - * if a property by the specified name does not exits. + * Test that a {@code null} value is returned by the {@code Message.getObjectProperty()} method if a property by the + * specified name does not exits. */ @Test public void testGetObjectProperty() { @@ -81,8 +80,8 @@ public void testGetObjectProperty() { } /** - * Test that a null value is returned by the Message.getStringProperty() method - * if a property by the specified name does not exits. + * Test that a {@code null} value is returned by the {@code Message.getStringProperty()} method if a property by the + * specified name does not exits. */ @Test public void testGetStringProperty() { @@ -95,8 +94,8 @@ public void testGetStringProperty() { } /** - * Test that an attempt to get a double property which does not exist throw - * a java.lang.NullPointerException + * Test that an attempt to get a {@code double} property which does not exist throw a + * {@code java.lang.NullPointerException} */ @Test public void testGetDoubleProperty() { @@ -111,8 +110,8 @@ public void testGetDoubleProperty() { } /** - * Test that an attempt to get a float property which does not exist throw - * a java.lang.NullPointerException + * Test that an attempt to get a {@code float} property which does not exist throw a + * {@code java.lang.NullPointerException} */ @Test public void testGetFloatProperty() { @@ -127,8 +126,8 @@ public void testGetFloatProperty() { } /** - * Test that an attempt to get a long property which does not exist throw - * a java.lang.NumberFormatException + * Test that an attempt to get a {@code long} property which does not exist throw a + * {@code java.lang.NumberFormatException} */ @Test public void testGetLongProperty() { @@ -143,8 +142,8 @@ public void testGetLongProperty() { } /** - * Test that an attempt to get a int property which does not exist throw - * a java.lang.NumberFormatException + * Test that an attempt to get a {@code int} property which does not exist throw a + * {@code java.lang.NumberFormatException} */ @Test public void testGetIntProperty() { @@ -159,8 +158,8 @@ public void testGetIntProperty() { } /** - * Test that an attempt to get a short property which does not exist throw - * a java.lang.NumberFormatException + * Test that an attempt to get a {@code short} property which does not exist throw a + * {@code java.lang.NumberFormatException} */ @Test public void testGetShortProperty() { @@ -175,8 +174,8 @@ public void testGetShortProperty() { } /** - * Test that an attempt to get a byte property which does not exist throw - * a java.lang.NumberFormatException + * Test that an attempt to get a {@code byte} property which does not exist throw a + * {@code java.lang.NumberFormatException} */ @Test public void testGetByteProperty() { @@ -190,9 +189,9 @@ public void testGetByteProperty() { } } - /** - * Test that an attempt to get a boolean property which does not exist - * returns false + /* + * Test that an attempt to get a {@code boolean} property which does not exist + * returns {@code false} */ @Test public void testGetBooleanProperty() { @@ -205,8 +204,8 @@ public void testGetBooleanProperty() { } /** - * Test that the Message.getPropertyNames() method does not return - * the name of the JMS standard header fields (e.g. JMSCorrelationID). + * Test that the {@code Message.getPropertyNames()} method does not return the name of the JMS standard header fields + * (e.g. {@code JMSCorrelationID}). */ @Test public void testGetPropertyNames() { @@ -226,7 +225,7 @@ public void testGetPropertyNames() { } /** - * Test that the Message.getPropertyNames() methods. + * Test that the {@code Message.getPropertyNames()} methods. */ @Test public void testPropertyIteration() { @@ -258,8 +257,7 @@ public void testPropertyIteration() { } /** - * Test that the Message.clearProperties() method does not clear the - * value of the Message's body. + * Test that the {@code Message.clearProperties()} method does not clear the value of the Message's body. */ @Test public void testClearProperties_2() { @@ -274,8 +272,7 @@ public void testClearProperties_2() { } /** - * Test that the Message.clearProperties() method deletes all the - * properties of the Message. + * Test that the {@code Message.clearProperties()} method deletes all the properties of the Message. */ @Test public void testClearProperties_1() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/queue/QueueBrowserTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/queue/QueueBrowserTest.java index 9f22d7b315e..7168868f092 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/queue/QueueBrowserTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/queue/QueueBrowserTest.java @@ -30,22 +30,16 @@ import org.objectweb.jtests.jms.framework.TestConfig; /** - * Test the javax.jms.QueueBrowser features. + * Test the {@code javax.jms.QueueBrowser} features. */ public class QueueBrowserTest extends PTPTestCase { - /** - * The QueueBrowser of the receiver's session - */ protected QueueBrowser receiverBrowser; - /** - * The QueueBrowser of the sender's session - */ protected QueueBrowser senderBrowser; /** - * Test the QueueBrowser of the sender. + * Test the {@code QueueBrowser} of the sender. */ @Test public void testSenderBrowser() { @@ -103,8 +97,8 @@ public void testSenderBrowser() { } /** - * Test that a QueueBrowser created with a message selector - * browses only the messages matching this selector. + * Test that a {@code QueueBrowser} created with a message selector browses only the messages matching this + * selector. */ @Test public void testBrowserWithMessageSelector() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/queue/TemporaryQueueTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/queue/TemporaryQueueTest.java index 870a817c215..525ec475789 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/queue/TemporaryQueueTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/queue/TemporaryQueueTest.java @@ -27,18 +27,12 @@ import org.objectweb.jtests.jms.framework.PTPTestCase; import org.objectweb.jtests.jms.framework.TestConfig; -/** - * Test the javax.jms.TemporaryQueue features. - */ public class TemporaryQueueTest extends PTPTestCase { private TemporaryQueue tempQueue; private QueueReceiver tempReceiver; - /** - * Test a TemporaryQueue - */ @Test public void testTemporaryQueue() { try { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/selector/SelectorSyntaxTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/selector/SelectorSyntaxTest.java index 9c4203c13db..b44615c1f4e 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/selector/SelectorSyntaxTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/selector/SelectorSyntaxTest.java @@ -29,11 +29,11 @@ public class SelectorSyntaxTest extends PTPTestCase { /** - * Test that identifiers that start with a valid Java identifier start character are valid. - * A valid identifier means that the method Character.isJavaIdentifierStart returns - * true for this identifier first character. + * Test that identifiers that start with a valid Java identifier start character are valid. A valid identifier means + * that the method {@code Character.isJavaIdentifierStart} returns {@code true} for this identifier first character. * - * @see Character.isJavaIdentifierStart(char) + * @see Character.isJavaIdentifierStart(char) */ @Test public void testValidIdentifiersStart() { @@ -92,7 +92,7 @@ public void testEmptyStringAsSelector() { } /** - * Test that identifiers can't be NULL. + * Test that identifiers can't be {@code NULL}. */ @Test public void testIdentifierNULL() { @@ -106,7 +106,7 @@ public void testIdentifierNULL() { } /** - * Test that identifiers can't be TRUE. + * Test that identifiers can't be {@code TRUE}. */ @Test public void testIdentifierTRUE() { @@ -118,7 +118,7 @@ public void testIdentifierTRUE() { } /** - * Test that identifiers can't be FALSE. + * Test that identifiers can't be {@code FALSE}. */ @Test public void testIdentifierFALSE() { @@ -130,7 +130,7 @@ public void testIdentifierFALSE() { } /** - * Test that identifiers can't be NOT. + * Test that identifiers can't be {@code NOT}. */ @Test public void testIdentifierNOT() { @@ -142,7 +142,7 @@ public void testIdentifierNOT() { } /** - * Test that identifiers can't be AND. + * Test that identifiers can't be {@code AND}. */ @Test public void testIdentifierAND() { @@ -154,7 +154,7 @@ public void testIdentifierAND() { } /** - * Test that identifiers can't be OR. + * Test that identifiers can't be {@code OR}. */ @Test public void testIdentifierOR() { @@ -166,7 +166,7 @@ public void testIdentifierOR() { } /** - * Test that identifiers can't be BETWEEN. + * Test that identifiers can't be {@code BETWEEN}. */ @Test public void testIdentifierBETWEEN() { @@ -178,7 +178,7 @@ public void testIdentifierBETWEEN() { } /** - * Test that identifiers can't be LIKE. + * Test that identifiers can't be {@code LIKE}. */ @Test public void testIdentifierLIKE() { @@ -190,7 +190,7 @@ public void testIdentifierLIKE() { } /** - * Test that identifiers can't be IN. + * Test that identifiers can't be {@code IN}. */ @Test public void testIdentifierIN() { @@ -202,7 +202,7 @@ public void testIdentifierIN() { } /** - * Test that identifiers can't be IS. + * Test that identifiers can't be {@code IS}. */ @Test public void testIdentifierIS() { @@ -214,7 +214,7 @@ public void testIdentifierIS() { } /** - * Test that identifiers can't be ESCAPE. + * Test that identifiers can't be {@code ESCAPE}. */ @Test public void testIdentifierESCAPE() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/selector/SelectorTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/selector/SelectorTest.java index 2b22e5e9e12..124cff52b62 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/selector/SelectorTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/selector/SelectorTest.java @@ -30,8 +30,8 @@ public class SelectorTest extends PTPTestCase { /** - * Test that an empty string as a message selector indicates that there - * is no message selector for the message consumer. + * Test that an empty string as a message selector indicates that there is no message selector for the message + * consumer. */ @Test public void testEmptyStringAsSelector() throws Exception { @@ -51,12 +51,10 @@ public void testEmptyStringAsSelector() throws Exception { /** * Tats that String literals are well handled by the message selector. - *
                      *

                        - *
                      • "string = 'literal''s;" is true for "literal's" and false for "literal"
                      • + *
                      • {@code "string = 'literal''s;"} is {@code true} for "literal's" and {@code false} for "literal"
                      • *
                      */ - @Test public void testStringLiterals() throws Exception { if (receiver != null) { @@ -80,8 +78,8 @@ public void testStringLiterals() throws Exception { } /** - * Test that the JMS property JMSDeliveryMode is treated as having the values 'PERSISTENT' - * or 'NON_PERSISTENT' when used in a message selector (chapter 3.8.1.3). + * Test that the JMS property {@code JMSDeliveryMode} is treated as having the values {@code 'PERSISTENT'} or + * {@code 'NON_PERSISTENT'} when used in a message selector (chapter 3.8.1.3). */ @Test public void testJMSDeliveryModeInSelector() throws Exception { @@ -108,9 +106,8 @@ public void testJMSDeliveryModeInSelector() throws Exception { } /** - * Test that conversions that apply to the get methods for properties do not - * apply when a property is used in a message selector expression. - * Based on the example of chapter 3.8.1.1 about identifiers. + * Test that conversions that apply to the {@code get} methods for properties do not apply when a property is used in + * a message selector expression. Based on the example of chapter 3.8.1.1 about identifiers. */ @Test public void testIdentifierConversion() throws Exception { @@ -135,9 +132,8 @@ public void testIdentifierConversion() throws Exception { /** * Test the message selector using the filter example provided by the JMS specifications. - *
                      *
                        - *
                      • "JMSType = 'car' AND color = 'blue' AND weight > 2500"
                      • + *
                      • {@code "JMSType = 'car' AND color = 'blue' AND weight > 2500"}
                      • *
                      */ @Test @@ -167,9 +163,8 @@ public void testSelectorExampleFromSpecs() throws Exception { /** * Test the ">" condition in message selector. - *
                      *
                        - *
                      • "weight > 2500" is true for 3000 and false for 1000
                      • + *
                      • {@code "weight > 2500"} is {@code true} for 3000 and {@code false} for 1000
                      • *
                      */ @Test @@ -195,9 +190,8 @@ public void testGreaterThan() throws Exception { /** * Test the "=" condition in message selector. - *
                      *
                        - *
                      • "weight = 2500" is true for 2500 and false for 1000
                      • + *
                      • {@code "weight = 2500"} is {@code true} for 2500 and {@code false} for 1000
                      • *
                      */ @Test @@ -223,9 +217,8 @@ public void testEquals() throws Exception { /** * Test the "<>" (not equal) condition in message selector. - *
                      *
                        - *
                      • "weight <> 2500" is true for 1000 and false for 2500
                      • + *
                      • {@code "weight <> 2500"} is {@code true} for 1000 and {@code false} for 2500
                      • *
                      */ @Test @@ -251,9 +244,8 @@ public void testNotEquals() throws Exception { /** * Test the BETWEEN condition in message selector. - *
                      *
                        - *
                      • "age BETWEEN 15 and 19" is true for 17 and false for 20
                      • + *
                      • "age BETWEEN 15 and 19" is {@code true} for 17 and {@code false} for 20
                      • *
                      */ @Test @@ -281,9 +273,8 @@ public void testBetween() throws Exception { /** * Test the IN condition in message selector. - *
                      *
                        - *
                      • "Country IN ('UK', 'US', 'France')" is true for 'UK' and false for 'Peru'
                      • + *
                      • "Country IN ('UK', 'US', 'France')" is {@code true} for 'UK' and {@code false} for 'Peru'
                      • *
                      */ @Test @@ -311,9 +302,8 @@ public void testIn() throws Exception { /** * Test the LIKE ... ESCAPE condition in message selector - *
                      *
                        - *
                      • "underscored LIKE '\_%' ESCAPE '\'" is true for '_foo' and false for 'bar'
                      • + *
                      • "underscored LIKE '\_%' ESCAPE '\'" is {@code true} for '_foo' and {@code false} for 'bar'
                      • *
                      */ @Test @@ -341,9 +331,8 @@ public void testLikeEscape() throws Exception { /** * Test the LIKE condition with '_' in the pattern. - *
                      *
                        - *
                      • "word LIKE 'l_se'" is true for 'lose' and false for 'loose'
                      • + *
                      • "word LIKE 'l_se'" is {@code true} for 'lose' and {@code false} for 'loose'
                      • *
                      */ @Test @@ -371,9 +360,8 @@ public void testLike_2() throws Exception { /** * Test the LIKE condition with '%' in the pattern. - *
                      *
                        - *
                      • "phone LIKE '12%3'" is true for '12993' and false for '1234'
                      • + *
                      • "phone LIKE '12%3'" is {@code true} for '12993' and {@code false} for '1234'
                      • *
                      */ @Test @@ -400,10 +388,9 @@ public void testLike_1() throws Exception { } /** - * Test the NULL value in message selector. - *
                      + * Test the {@code NULL} value in message selector. *
                        - *
                      • "prop IS NULL"
                      • + *
                      • {@code "prop IS NULL"}
                      • *
                      */ @Test diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/QueueSessionTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/QueueSessionTest.java index 3c73fabe55b..af08ee27d4b 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/QueueSessionTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/QueueSessionTest.java @@ -30,14 +30,13 @@ /** * Test queue sessions - *
                      + *

                      * See JMS specifications, sec. 4.4 Session */ public class QueueSessionTest extends PTPTestCase { /** - * Test that if we rollback a transaction which has consumed a message, - * the message is effectively redelivered. + * Test that if we rollback a transaction which has consumed a message, the message is effectively redelivered. */ @Test public void testRollbackRececeivedMessage() { @@ -100,8 +99,8 @@ public void testRollbackRececeivedMessage() { } /** - * Test that a call to the createBrowser() method with an invalid - * messaeg session throws a javax.jms.InvalidSelectorException. + * Test that a call to the {@code createBrowser()} method with an invalid messaeg session throws a + * {@code javax.jms.InvalidSelectorException}. */ @Test public void testCreateBrowser_2() { @@ -115,8 +114,8 @@ public void testCreateBrowser_2() { } /** - * Test that a call to the createBrowser() method with an invalid - * Queue throws a javax.jms.InvalidDestinationException. + * Test that a call to the {@code createBrowser()} method with an invalid {@code Queue} throws a + * {@code javax.jms.InvalidDestinationException}. */ @Test public void testCreateBrowser_1() { @@ -130,8 +129,8 @@ public void testCreateBrowser_1() { } /** - * Test that a call to the createReceiver() method with an invalid - * message selector throws a javax.jms.InvalidSelectorException. + * Test that a call to the {@code createReceiver()} method with an invalid message selector throws a + * {@code javax.jms.InvalidSelectorException}. */ @Test public void testCreateReceiver_2() { @@ -145,8 +144,8 @@ public void testCreateReceiver_2() { } /** - * Test that a call to the createReceiver() method with an invalid - * Queue throws a javax.jms.InvalidDestinationException> + * Test that a call to the {@code createReceiver()} method with an invalid {@code Queue} throws a + * {@code javax.jms.InvalidDestinationException}> */ @Test public void testCreateReceiver_1() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/SessionTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/SessionTest.java index c7c50bc6e8d..e582c3783fe 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/SessionTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/SessionTest.java @@ -28,15 +28,14 @@ /** * Test sessions - *
                      + *

                      * See JMS specifications, sec. 4.4 Session */ public class SessionTest extends PTPTestCase { /** - * Test that an attempt to call the recover() method on a - * transacted Session throws a - * javax.jms.IllegalStateException. + * Test that an attempt to call the {@code recover()} method on a transacted {@code Session} throws + * a {@code javax.jms.IllegalStateException}. */ @Test public void testRecoverTransactedSession() { @@ -57,8 +56,7 @@ public void testRecoverTransactedSession() { } /** - * Test that a call to the rollback() method on a - * transacted Session rollbacks all + * Test that a call to the {@code rollback()} method on a transacted {@code Session} rollbacks all * the messages sent in the transaction. */ @Test @@ -86,8 +84,7 @@ public void testRollbackTransactedSession() { } /** - * Test that a call to the rollback() method on a - * transacted Session rollbacks all + * Test that a call to the {@code rollback()} method on a transacted {@code Session} rollbacks all * the messages sent in the transaction. */ @Test @@ -119,9 +116,8 @@ public void testCommitTransactedSession() { } /** - * Test that an attempt to call the roolback() method on a - * non transacted Session throws a - * javax.jms.IllegalStateException. + * Test that an attempt to call the {@code roolback()} method on a non transacted {@code Session} + * throws a {@code javax.jms.IllegalStateException}. */ @Test public void testRollbackNonTransactedSession() { @@ -139,9 +135,8 @@ public void testRollbackNonTransactedSession() { } /** - * Test that an attempt to call the commit() method on a - * non transacted Session throws a - * javax.jms.IllegalStateException. + * Test that an attempt to call the {@code commit()} method on a non transacted {@code Session} + * throws a {@code javax.jms.IllegalStateException}. */ @Test public void testCommitNonTransactedSession() { @@ -159,8 +154,8 @@ public void testCommitNonTransactedSession() { } /** - * Test that the getTransacted() method of a Session returns true - * if the session is transacted, false else. + * Test that the {@code getTransacted()} method of a {@code Session} returns {@code true} if the session is + * transacted, {@code false} else. */ @Test public void testGetTransacted() { @@ -176,8 +171,8 @@ public void testGetTransacted() { } /** - * Test that invoking the acknowledge() method of a received message - * from a closed session must throw an IllegalStateException. + * Test that invoking the {@code acknowledge()} method of a received message from a closed session must throw an + * {@code IllegalStateException}. */ @Test public void testAcknowledge() { @@ -204,8 +199,8 @@ public void testAcknowledge() { } /** - * Test that it is valid to use message objects created or received via the [closed] session with the - * exception of a received message acknowledge() method. + * Test that it is valid to use message objects created or received via the [closed] session with the exception of a + * received message {@code acknowledge()} method. */ @Test public void testUseMessage() { @@ -223,8 +218,8 @@ public void testUseMessage() { } /** - * Test that an attempt to use a Session which has been closed - * throws a javax.jms.IllegalStateException. + * Test that an attempt to use a {@code Session} which has been closed throws a + * {@code javax.jms.IllegalStateException}. */ @Test public void testUsedClosedSession() { @@ -241,8 +236,7 @@ public void testUsedClosedSession() { } /** - * Test that closing a closed session does not throw - * an exception. + * Test that closing a closed session does not throw an exception. */ @Test public void testCloseClosedSession() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/TopicSessionTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/TopicSessionTest.java index 36b3c04d344..d056ea335a2 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/TopicSessionTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/TopicSessionTest.java @@ -31,14 +31,13 @@ /** * Test topic sessions - *
                      + *

                      * See JMS specifications, sec. 4.4 Session */ public class TopicSessionTest extends PubSubTestCase { /** - * Test that if we rollback a transaction which has consumed a message, - * the message is effectively redelivered. + * Test that if we rollback a transaction which has consumed a message, the message is effectively redelivered. */ @Test public void testRollbackReceivedMessage() { @@ -92,8 +91,7 @@ public void testRollbackReceivedMessage() { } /** - * Test that a durable subscriber effectively receives the messages sent to its - * topic while it was inactive. + * Test that a durable subscriber effectively receives the messages sent to its topic while it was inactive. */ @Test public void testDurableSubscriber() { @@ -138,8 +136,8 @@ public void testUnsubscribe() { } /** - * Test that a call to the createDurableSubscriber() method with an invalid - * message selector throws a javax.jms.InvalidSelectorException. + * Test that a call to the {@code createDurableSubscriber()} method with an invalid message selector throws a + * {@code javax.jms.InvalidSelectorException}. */ @Test public void testCreateDurableSubscriber_2() { @@ -153,8 +151,8 @@ public void testCreateDurableSubscriber_2() { } /** - * Test that a call to the createDurableSubscriber() method with an invalid - * Topic throws a javax.jms.InvalidDestinationException. + * Test that a call to the {@code createDurableSubscriber()} method with an invalid {@code Topic} throws a + * {@code javax.jms.InvalidDestinationException}. */ @Test public void testCreateDurableSubscriber_1() { @@ -168,8 +166,8 @@ public void testCreateDurableSubscriber_1() { } /** - * Test that a call to the createSubscriber() method with an invalid - * message selector throws a javax.jms.InvalidSelectorException. + * Test that a call to the {@code createSubscriber()} method with an invalid message selector throws a + * {@code javax.jms.InvalidSelectorException}. */ @Test public void testCreateSubscriber_2() { @@ -183,8 +181,8 @@ public void testCreateSubscriber_2() { } /** - * Test that a call to the createSubscriber() method with an invalid - * Topic throws a javax.jms.InvalidDestinationException. + * Test that a call to the {@code createSubscriber()} method with an invalid {@code Topic} throws a + * {@code javax.jms.InvalidDestinationException}. */ @Test public void testCreateSubscriber_1() { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/UnifiedSessionTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/UnifiedSessionTest.java index 5b20f398c5e..f08845829da 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/UnifiedSessionTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/session/UnifiedSessionTest.java @@ -32,16 +32,13 @@ /** * Test unified JMS 1.1 sessions. - *
                      + *

                      * See JMS 1.1 specifications * * @since JMS 1.1 */ public class UnifiedSessionTest extends UnifiedTestCase { - /** - * QueueConnection - */ protected QueueConnection queueConnection; /** @@ -49,9 +46,6 @@ public class UnifiedSessionTest extends UnifiedTestCase { */ protected QueueSession queueSession; - /** - * TopicConnection - */ protected TopicConnection topicConnection; /** @@ -60,10 +54,8 @@ public class UnifiedSessionTest extends UnifiedTestCase { protected TopicSession topicSession; /** - * Test that a call to createDurableConnectionConsumer() method - * on a QueueConnection throws a - * javax.jms.IllegalStateException. - * (see JMS 1.1 specs, table 4-1). + * Test that a call to {@code createDurableConnectionConsumer()} method on a {@code QueueConnection} throws a + * {@code javax.jms.IllegalStateException}. (see JMS 1.1 specs, table 4-1). * * @since JMS 1.1 */ @@ -79,10 +71,8 @@ public void testCreateDurableConnectionConsumerOnQueueConnection() { } /** - * Test that a call to createDurableSubscriber() method - * on a QueueSession throws a - * javax.jms.IllegalStateException. - * (see JMS 1.1 specs, table 4-1). + * Test that a call to {@code createDurableSubscriber()} method on a {@code QueueSession} throws a + * {@code javax.jms.IllegalStateException}. (see JMS 1.1 specs, table 4-1). * * @since JMS 1.1 */ @@ -98,10 +88,8 @@ public void testCreateDurableSubscriberOnQueueSession() { } /** - * Test that a call to createTemporaryTopic() method - * on a QueueSession throws a - * javax.jms.IllegalStateException. - * (see JMS 1.1 specs, table 4-1). + * Test that a call to {@code createTemporaryTopic()} method on a {@code QueueSession} throws a + * {@code javax.jms.IllegalStateException}. (see JMS 1.1 specs, table 4-1). * * @since JMS 1.1 */ @@ -117,10 +105,8 @@ public void testCreateTemporaryTopicOnQueueSession() { } /** - * Test that a call to createTopic() method - * on a QueueSession throws a - * javax.jms.IllegalStateException. - * (see JMS 1.1 specs, table 4-1). + * Test that a call to {@code createTopic()} method on a {@code QueueSession} throws a + * {@code javax.jms.IllegalStateException}. (see JMS 1.1 specs, table 4-1). * * @since JMS 1.1 */ @@ -136,10 +122,8 @@ public void testCreateTopicOnQueueSession() { } /** - * Test that a call to unsubscribe() method - * on a QueueSession throws a - * javax.jms.IllegalStateException. - * (see JMS 1.1 specs, table 4-1). + * Test that a call to {@code unsubscribe()} method on a {@code QueueSession} throws a + * {@code javax.jms.IllegalStateException}. (see JMS 1.1 specs, table 4-1). * * @since JMS 1.1 */ @@ -155,10 +139,8 @@ public void testUnsubscribeOnQueueSession() { } /** - * Test that a call to createBrowser() method - * on a TopicSession throws a - * javax.jms.IllegalStateException. - * (see JMS 1.1 specs, table 4-1). + * Test that a call to {@code createBrowser()} method on a {@code TopicSession} throws a + * {@code javax.jms.IllegalStateException}. (see JMS 1.1 specs, table 4-1). * * @since JMS 1.1 */ @@ -174,10 +156,8 @@ public void testCreateBrowserOnTopicSession() { } /** - * Test that a call to createQueue() method - * on a TopicSession throws a - * javax.jms.IllegalStateException. - * (see JMS 1.1 specs, table 4-1). + * Test that a call to {@code createQueue()} method on a {@code TopicSession} throws a + * {@code javax.jms.IllegalStateException}. (see JMS 1.1 specs, table 4-1). * * @since JMS 1.1 */ @@ -193,10 +173,8 @@ public void testCreateQueueOnTopicSession() { } /** - * Test that a call to createTemporaryQueue() method - * on a TopicSession throws a - * javax.jms.IllegalStateException. - * (see JMS 1.1 specs, table 4-1). + * Test that a call to {@code createTemporaryQueue()} method on a {@code TopicSession} throws a + * {@code javax.jms.IllegalStateException}. (see JMS 1.1 specs, table 4-1). * * @since JMS 1.1 */ diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/topic/TemporaryTopicTest.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/topic/TemporaryTopicTest.java index 71e5baed823..360bc0448e7 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/topic/TemporaryTopicTest.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/topic/TemporaryTopicTest.java @@ -27,18 +27,12 @@ import org.objectweb.jtests.jms.framework.PubSubTestCase; import org.objectweb.jtests.jms.framework.TestConfig; -/** - * Test the javax.jms.TemporaryTopic features. - */ public class TemporaryTopicTest extends PubSubTestCase { private TemporaryTopic tempTopic; private TopicSubscriber tempSubscriber; - /** - * Test a TemporaryTopic - */ @Test public void testTemporaryTopic() { try { diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/JMSTestCase.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/JMSTestCase.java index dd32281a42d..b8f04eb38d3 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/JMSTestCase.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/JMSTestCase.java @@ -26,11 +26,10 @@ import org.objectweb.jtests.jms.admin.AdminFactory; /** - * Class extending junit.framework.TestCase to - * provide a new fail() method with an Exception - * as parameter. - *
                      - * Every Test Case for JMS should extend this class instead of junit.framework.TestCase + * Class extending {@code junit.framework.TestCase} to provide a new {@code fail()} method with an {@code Exception} as + * parameter. + *

                      + * Every Test Case for JMS should extend this class instead of {@code junit.framework.TestCase} */ public abstract class JMSTestCase extends Assert { @@ -51,10 +50,9 @@ public static void setPropFileName(String fileName) { /** * Fails a test with an exception which will be used for a message. - * - * If the exception is an instance of javax.jms.JMSException, the - * message of the failure will contained both the JMSException and its linked exception - * (provided there's one). + *

                      + * If the exception is an instance of {@code javax.jms.JMSException}, the message of the failure will contained both + * the JMSException and its linked exception (provided there's one). */ public void fail(final Exception e) { if (e instanceof javax.jms.JMSException exception) { @@ -71,8 +69,6 @@ public void fail(final Exception e) { /** * Should be overridden - * - * @return */ protected Properties getProviderProperties() throws IOException { Properties props = new Properties(); diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/PTPTestCase.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/PTPTestCase.java index 3dd2aba8a64..202692bc67f 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/PTPTestCase.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/PTPTestCase.java @@ -30,13 +30,11 @@ /** * Creates convenient Point to Point JMS objects which can be needed for tests. - *
                      - * This class defines the setUp and tearDown methods so - * that JMS administrated objects and other "ready to use" PTP objects (that is to say queues, - * sessions, senders and receviers) are available conveniently for the test cases. - *
                      - * Classes which want that convenience should extend PTPTestCase instead of - * JMSTestCase. + *

                      + * This class defines the setUp and tearDown methods so that JMS administrated objects and other "ready to use" PTP + * objects (that is to say queues, sessions, senders and receviers) are available conveniently for the test cases. + *

                      + * Classes which want that convenience should extend {@code PTPTestCase} instead of {@code JMSTestCase}. */ public abstract class PTPTestCase extends JMSTestCase { @@ -46,24 +44,12 @@ public abstract class PTPTestCase extends JMSTestCase { private static final String QUEUE_NAME = "testJoramQueue"; - /** - * Queue used by a sender - */ protected Queue senderQueue; - /** - * Sender on queue - */ protected QueueSender sender; - /** - * QueueConnectionFactory of the sender - */ protected QueueConnectionFactory senderQCF; - /** - * QueueConnection of the sender - */ protected QueueConnection senderConnection; /** @@ -71,24 +57,12 @@ public abstract class PTPTestCase extends JMSTestCase { */ protected QueueSession senderSession; - /** - * Queue used by a receiver - */ protected Queue receiverQueue; - /** - * Receiver on queue - */ protected QueueReceiver receiver; - /** - * QueueConnectionFactory of the receiver - */ protected QueueConnectionFactory receiverQCF; - /** - * QueueConnection of the receiver - */ protected QueueConnection receiverConnection; /** @@ -98,7 +72,7 @@ public abstract class PTPTestCase extends JMSTestCase { /** * Create all administrated objects connections and sessions ready to use for tests. - *
                      + *

                      * Start connections. */ @Override diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/PubSubTestCase.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/PubSubTestCase.java index eb6e49bcda7..a2998411ea2 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/PubSubTestCase.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/PubSubTestCase.java @@ -30,13 +30,11 @@ /** * Creates convenient JMS Publish/Subscribe objects which can be needed for tests. - *
                      - * This class defines the setUp and tearDown methods so - * that JMS administrated objects and other "ready to use" Pub/Sub objects (that is to say topics, - * sessions, publishers and subscribers) are available conveniently for the test cases. - *
                      - * Classes which want that convenience should extend PubSubTestCase instead of - * JMSTestCase. + *

                      + * This class defines the setUp and tearDown methods so that JMS administrated objects and other "ready to use" Pub/Sub + * objects (that is to say topics, sessions, publishers and subscribers) are available conveniently for the test cases. + *

                      + * Classes which want that convenience should extend {@code PubSubTestCase} instead of {@code JMSTestCase}. */ public abstract class PubSubTestCase extends JMSTestCase { @@ -44,24 +42,12 @@ public abstract class PubSubTestCase extends JMSTestCase { private static final String TOPIC_NAME = "testJoramTopic"; - /** - * Topic used by a publisher - */ protected Topic publisherTopic; - /** - * Publisher on queue - */ protected TopicPublisher publisher; - /** - * TopicConnectionFactory of the publisher - */ protected TopicConnectionFactory publisherTCF; - /** - * TopicConnection of the publisher - */ protected TopicConnection publisherConnection; /** @@ -69,24 +55,12 @@ public abstract class PubSubTestCase extends JMSTestCase { */ protected TopicSession publisherSession; - /** - * Topic used by a subscriber - */ protected Topic subscriberTopic; - /** - * Subscriber on queue - */ protected TopicSubscriber subscriber; - /** - * TopicConnectionFactory of the subscriber - */ protected TopicConnectionFactory subscriberTCF; - /** - * TopicConnection of the subscriber - */ protected TopicConnection subscriberConnection; /** @@ -96,7 +70,7 @@ public abstract class PubSubTestCase extends JMSTestCase { /** * Create all administrated objects connections and sessions ready to use for tests. - *
                      + *

                      * Start connections. */ @Override diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/TestConfig.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/TestConfig.java index 2491f4e377c..5a89050bd04 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/TestConfig.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/TestConfig.java @@ -30,8 +30,8 @@ public class TestConfig { private static final String PROP_NAME = "timeout"; /** - * timeout value used by receive method in the tests. - * the value is specified in the config/test.properties file. + * timeout value used by {@code receive} method in the tests. the value is specified in the + * {@code config/test.properties} file. */ public static final long TIMEOUT; diff --git a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/UnifiedTestCase.java b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/UnifiedTestCase.java index 7d0901cb626..4d06a45e7ce 100644 --- a/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/UnifiedTestCase.java +++ b/tests/joram-tests/src/test/java/org/objectweb/jtests/jms/framework/UnifiedTestCase.java @@ -33,13 +33,12 @@ /** * Creates convenient Unified JMS 1.1 objects which can be needed for tests. - *
                      - * This class defines the setUp and tearDown methods so - * that JMS administrated objects and other "ready to use" JMS objects (that is to say destinations, - * sessions, producers and consumers) are available conveniently for the test cases. - *
                      - * Classes which want that convenience should extend UnifiedTestCase instead of - * JMSTestCase. + *

                      + * This class defines the setUp and tearDown methods so that JMS administrated objects and other "ready to use" JMS + * objects (that is to say destinations, sessions, producers and consumers) are available conveniently for the test + * cases. + *

                      + * Classes which want that convenience should extend {@code UnifiedTestCase} instead of {@code JMSTestCase}. * * @since JMS 1.1 */ @@ -63,24 +62,12 @@ public abstract class UnifiedTestCase extends JMSTestCase { // Unified Domain // // ////////////////// - /** - * Destination used by a producer - */ protected Destination producerDestination; - /** - * Producer - */ protected MessageProducer producer; - /** - * ConnectionFactory of the producer - */ protected ConnectionFactory producerCF; - /** - * Connection of the producer - */ protected Connection producerConnection; /** @@ -88,24 +75,12 @@ public abstract class UnifiedTestCase extends JMSTestCase { */ protected Session producerSession; - /** - * Destination used by a consumer - */ protected Destination consumerDestination; - /** - * Consumer on destination - */ protected MessageConsumer consumer; - /** - * ConnectionFactory of the consumer - */ protected ConnectionFactory consumerCF; - /** - * Connection of the consumer - */ protected Connection consumerConnection; /** @@ -117,33 +92,21 @@ public abstract class UnifiedTestCase extends JMSTestCase { // PTP Domain // // ////////////// - /** - * QueueConnectionFactory - */ protected QueueConnectionFactory queueConnectionFactory; - /** - * Queue - */ protected Queue queue; // ////////////////// // Pub/Sub Domain // // ////////////////// - /** - * TopicConnectionFactory - */ protected TopicConnectionFactory topicConnectionFactory; - /** - * Topic - */ protected Topic topic; /** * Create all administrated objects connections and sessions ready to use for tests. - *
                      + *

                      * Start connections. */ @Override diff --git a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/FilteredPagingLeakTest.java b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/FilteredPagingLeakTest.java index 537dfed964d..b17263a5d7a 100644 --- a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/FilteredPagingLeakTest.java +++ b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/FilteredPagingLeakTest.java @@ -52,9 +52,10 @@ import static org.apache.activemq.artemis.tests.leak.MemoryAssertions.assertMemory; import static org.junit.jupiter.api.Assumptions.assumeTrue; -/* This test creates a condition where one queue is filtering a lot of data. -* Upon completing a page after the ignored filter. -* it will then make sure the removed references list and acked list is cleared from the PageInfo map. */ +/** + * This test creates a condition where one queue is filtering a lot of data. Upon completing a page after the ignored + * filter. it will then make sure the removed references list and acked list is cleared from the PageInfo map. + */ public class FilteredPagingLeakTest extends AbstractLeakTest { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/JournalLeakTest.java b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/JournalLeakTest.java index 366e8f97702..aebe374429c 100644 --- a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/JournalLeakTest.java +++ b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/JournalLeakTest.java @@ -53,7 +53,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/* at the time this test was written JournalFileImpl was leaking through JournalFileImpl::negative creating a linked list (or leaked-list, pun intended) */ +/* + * At the time this test was written JournalFileImpl was leaking through JournalFileImpl::negative creating a linked + * list (or leaked-list, pun intended) + */ public class JournalLeakTest extends AbstractLeakTest { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/MemoryAssertions.java b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/MemoryAssertions.java index a8449c13d86..b532c3ea5d4 100644 --- a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/MemoryAssertions.java +++ b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/MemoryAssertions.java @@ -51,7 +51,9 @@ public static void basicMemoryAsserts() throws Exception { basicMemoryAsserts(true); } - /** most tests should have these as 0 after execution. */ + /** + * most tests should have these as 0 after execution. + */ public static void basicMemoryAsserts(boolean validateMessages) throws Exception { CheckLeak checkLeak = new CheckLeak(); assertMemory(checkLeak, 0, OpenWireConnection.class.getName()); diff --git a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/MessageReferenceLeakTest.java b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/MessageReferenceLeakTest.java index 360dcac5425..695b817bbc1 100755 --- a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/MessageReferenceLeakTest.java +++ b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/MessageReferenceLeakTest.java @@ -1,20 +1,21 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *

                      - * http://www.apache.org/licenses/LICENSE-2.0 - *

                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.leak; import io.github.checkleak.core.CheckLeak; diff --git a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/PagingLeakTest.java b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/PagingLeakTest.java index e89cd7ac706..38a697abc53 100644 --- a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/PagingLeakTest.java +++ b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/PagingLeakTest.java @@ -51,7 +51,10 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assumptions.assumeTrue; -/* at the time this test was written JournalFileImpl was leaking through JournalFileImpl::negative creating a linked list (or leaked-list, pun intended) */ +/* + * At the time this test was written JournalFileImpl was leaking through JournalFileImpl::negative creating a linked + * list (or leaked-list, pun intended) + */ public class PagingLeakTest extends AbstractLeakTest { ActiveMQServer server; diff --git a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/FakeJournalImplTest.java b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/FakeJournalImplTest.java index 5874e06ae5f..e10ef26fa43 100644 --- a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/FakeJournalImplTest.java +++ b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/journal/FakeJournalImplTest.java @@ -19,9 +19,6 @@ import org.apache.activemq.artemis.core.io.SequentialFileFactory; import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.FakeSequentialFileFactory; -/** - * A FakeJournalImplTest - */ public class FakeJournalImplTest extends JournalImplTestUnit { @Override diff --git a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/paging/MeasurePagingMultiThreadTest.java b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/paging/MeasurePagingMultiThreadTest.java index c7b758bd936..d2c861d2e56 100644 --- a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/paging/MeasurePagingMultiThreadTest.java +++ b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/paging/MeasurePagingMultiThreadTest.java @@ -149,13 +149,6 @@ public void run() { - /** - * @param adr - * @param nMessages - * @param messageSize - * @param factory - * @throws ActiveMQException - */ private void sendInitialBatch(final SimpleString adr, final int nMessages, final int messageSize, @@ -169,12 +162,6 @@ private void sendInitialBatch(final SimpleString adr, sendMessages(nMessages, producer, msg); } - /** - * @param nMessages - * @param producer - * @param msg - * @throws ActiveMQException - */ private void sendMessages(final int nMessages, final ClientProducer producer, final ClientMessage msg) throws ActiveMQException { @@ -183,11 +170,6 @@ private void sendMessages(final int nMessages, } } - /** - * @param factory - * @param adr - * @throws ActiveMQException - */ private void createDestination(final ClientSessionFactory factory, final SimpleString adr) throws ActiveMQException { { ClientSession session = factory.createSession(false, false, false); diff --git a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/AbstractSendReceivePerfTest.java b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/AbstractSendReceivePerfTest.java index b1251a08755..a9e09bda1a2 100644 --- a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/AbstractSendReceivePerfTest.java +++ b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/AbstractSendReceivePerfTest.java @@ -95,8 +95,7 @@ protected void doSendReceiveTestImpl() throws Exception { final Semaphore pendingCredit = new Semaphore(5000); /** - * to be called after a message is consumed - * so the flow control of the test kicks in. + * to be called after a message is consumed so the flow control of the test kicks in. */ protected final void afterConsume(Message message) { if (message != null) { @@ -184,7 +183,7 @@ public void run() { } } - /* This will by default send non persistent messages */ + // This will by default send non persistent messages protected void sendMessages(Connection c, String qName) throws JMSException { Session s = null; s = c.createSession(false, Session.AUTO_ACKNOWLEDGE); diff --git a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/MeasureCommitPerfTest.java b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/MeasureCommitPerfTest.java index 519627949b1..d3b35b14106 100644 --- a/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/MeasureCommitPerfTest.java +++ b/tests/performance-tests/src/test/java/org/apache/activemq/artemis/tests/performance/sends/MeasureCommitPerfTest.java @@ -28,7 +28,7 @@ public class MeasureCommitPerfTest extends AbstractSendReceivePerfTest { protected void consumeMessages(Connection c, String qName) throws Exception { } - /* This will by default send non persistent messages */ + // This will by default send non persistent messages @Override protected void sendMessages(Connection c, String qName) throws JMSException { Session s = c.createSession(true, Session.SESSION_TRANSACTED); diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/BrokerConnectionBridgeSecurityTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/BrokerConnectionBridgeSecurityTest.java index 4cebfa8af0a..d67aaa31427 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/BrokerConnectionBridgeSecurityTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/BrokerConnectionBridgeSecurityTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.smoke.brokerConnection; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/BrokerConnectionMirrorSecurityTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/BrokerConnectionMirrorSecurityTest.java index 63104ea52b6..1ff34bb5cb0 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/BrokerConnectionMirrorSecurityTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/BrokerConnectionMirrorSecurityTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.smoke.brokerConnection; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/DualFederationTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/DualFederationTest.java index 502efd03ffb..8c3d6535db1 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/DualFederationTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/DualFederationTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.smoke.brokerConnection; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/DualMirrorNoContainerTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/DualMirrorNoContainerTest.java index ebca97a60e7..7280c354316 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/DualMirrorNoContainerTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/DualMirrorNoContainerTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.smoke.brokerConnection; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirrorInfiniteRetryReplicaTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirrorInfiniteRetryReplicaTest.java index cb39371e967..fd3a3b8558a 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirrorInfiniteRetryReplicaTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirrorInfiniteRetryReplicaTest.java @@ -43,9 +43,11 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -/** This test will keep a consumer active on both nodes. Up to the point an ack would give up. - * It has configured a massive number of retries, so even after keeping the consumer on for some time should not make the ack retry to go away. - * as soon as the consumer gives up the message the retry should succeed. */ +/** + * This test will keep a consumer active on both nodes. Up to the point an ack would give up. It has configured a + * massive number of retries, so even after keeping the consumer on for some time should not make the ack retry to go + * away. as soon as the consumer gives up the message the retry should succeed. + */ public class MirrorInfiniteRetryReplicaTest extends SmokeTestBase { private static final String QUEUE_NAME = "MirrorInfiniteRetryReplicaTestQueue"; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirroredSubscriptionTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirroredSubscriptionTest.java index 4186c9a96d4..0de59a9eb3b 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirroredSubscriptionTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirroredSubscriptionTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.smoke.brokerConnection; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/PagedMirrorSmokeTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/PagedMirrorSmokeTest.java index 40f6ceb81da..158ed4d71cc 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/PagedMirrorSmokeTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/PagedMirrorSmokeTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.smoke.brokerConnection; import javax.jms.Connection; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/console/ConsoleTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/console/ConsoleTest.java index 3dc53b4b369..582b17e86a7 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/console/ConsoleTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/console/ConsoleTest.java @@ -51,7 +51,9 @@ import org.testcontainers.containers.BrowserWebDriverContainer; import org.testcontainers.shaded.org.apache.commons.io.FileUtils; -/** The server for ConsoleTest is created on the pom as there are some properties that are passed by argument on the CI */ +/** + * The server for ConsoleTest is created on the pom as there are some properties that are passed by argument on the CI + */ @ExtendWith(ParameterizedTestExtension.class) public abstract class ConsoleTest extends SmokeTestBase { diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmx/JmxConnectionTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmx/JmxConnectionTest.java index e7cc2cf0c75..1baeedabd6d 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmx/JmxConnectionTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/jmx/JmxConnectionTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.smoke.jmx; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -117,7 +118,8 @@ public void testJmxConnection() throws Throwable { try { - /* Now I need to extract the RMI registry port to make sure it's equal to the configured one. It's gonna be + /* + * Now I need to extract the RMI registry port to make sure it's equal to the configured one. It's gonna be * messy because I have to use reflection to reach the information. */ diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/resourcetest/MaxQueueResourceTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/resourcetest/MaxQueueResourceTest.java index 2acc90f9526..90d7a97d6bd 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/resourcetest/MaxQueueResourceTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/resourcetest/MaxQueueResourceTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.smoke.resourcetest; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/CompareUpgradeTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/CompareUpgradeTest.java index 3fd64df0255..7c1033ea58a 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/CompareUpgradeTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/CompareUpgradeTest.java @@ -48,7 +48,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** This test will compare expected values at the upgraded servers. */ +/** + * This test will compare expected values at the upgraded servers. + */ public class CompareUpgradeTest { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/UpgradeTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/UpgradeTest.java index e18e076e62b..f6970d75e83 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/UpgradeTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/upgradeTest/UpgradeTest.java @@ -1,20 +1,21 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.smoke.upgradeTest; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -35,7 +36,9 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -/** This test is making sure the upgrade command would be able to upgrade a test I created with artemis 2.25.0 */ +/** + * This test is making sure the upgrade command would be able to upgrade a test I created with artemis 2.25.0 + */ public class UpgradeTest extends SmokeTestBase { File upgradedServer; 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 5742a4d1608..7c7d279cd90 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 @@ -28,9 +28,9 @@ import java.lang.invoke.MethodHandles; /** - * WARNING: This is not a sample on how you should handle XA. You are supposed to use a - * TransactionManager. This class is doing the job of a TransactionManager that fits for the purpose - * of this test only, however there are many more pitfalls to deal with Transactions. + * WARNING: This is not a sample on how you should handle XA. You are supposed to use a TransactionManager. This + * class is doing the job of a TransactionManager that fits for the purpose of this test only, however there are many + * more pitfalls to deal with Transactions. *

                      * This is just to stress and soak test Transactions with ActiveMQ Artemis. *

                      @@ -51,8 +51,7 @@ public abstract class ClientAbstract extends Thread { protected int errors = 0; /** - * A commit was called - * case we don't find the Xid, means it was accepted + * A commit was called case we don't find the Xid, means it was accepted */ protected volatile boolean pendingCommit = false; @@ -149,9 +148,6 @@ public void setRunning(final boolean running) { this.running = running; } - /** - * @return - */ private XidImpl newXID() { return new XidImpl("tst".getBytes(), 1, UUIDGenerator.getInstance().generateStringUUID().getBytes()); } 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 7b71afe1484..25f38b1cc6c 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 @@ -94,9 +94,6 @@ public void run() { } } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.jms.example.ClientAbstract#connectClients() - */ @Override protected void connectClients() throws Exception { @@ -105,9 +102,6 @@ protected void connectClients() throws Exception { session.start(); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.jms.example.ClientAbstract#onCommit() - */ @Override protected void onCommit() { msgs += pendingMsgs; @@ -116,9 +110,6 @@ protected void onCommit() { pendingMsgs = 0; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.jms.example.ClientAbstract#onRollback() - */ @Override protected void onRollback() { minConsume.release(pendingMsgs); @@ -130,9 +121,6 @@ public String toString() { return "Receiver::" + this.queue + ", msgs=" + msgs + ", pending=" + pendingMsgs; } - /** - * @param pendingMsgs2 - */ public void messageProduced(int producedMessages) { minConsume.release(producedMessages); currentDiff.addAndGet(producedMessages); diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/Sender.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/Sender.java index 394565b689e..d820ba16e89 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/Sender.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/Sender.java @@ -22,7 +22,6 @@ public class Sender extends ClientAbstract { - protected ClientProducer producer; protected String queue; @@ -65,9 +64,6 @@ public void run() { } } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.jms.example.ClientAbstract#onCommit() - */ @Override protected void onCommit() { this.msgs += pendingMsgs; @@ -78,9 +74,6 @@ protected void onCommit() { pendingMsgs = 0; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.jms.example.ClientAbstract#onRollback() - */ @Override protected void onRollback() { pendingMsgs = 0; @@ -89,7 +82,5 @@ protected void onRollback() { @Override public String toString() { return "Sender, msgs=" + msgs + ", pending=" + pendingMsgs; - } - } diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/clusterNotificationsContinuity/ClusterNotificationsContinuityTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/clusterNotificationsContinuity/ClusterNotificationsContinuityTest.java index 947db11ebf1..f3afa9e59c8 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/clusterNotificationsContinuity/ClusterNotificationsContinuityTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/clusterNotificationsContinuity/ClusterNotificationsContinuityTest.java @@ -1,20 +1,21 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *

                      - * http://www.apache.org/licenses/LICENSE-2.0 - *

                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.soak.clusterNotificationsContinuity; import static org.apache.activemq.artemis.utils.TestParameters.testProperty; @@ -54,13 +55,10 @@ /** * Refer to ./scripts/parameters.sh for suggested parameters - * - * Tests for an issue that's dependent on high overall system load. - * The following parameters are used to tune the resource demands of the test: - * NUMBER_OF_SERVERS, NUMBER_OF_QUEUES, NUMBER_OF_CONSUMERS - * + *

                      + * Tests for an issue that's dependent on high overall system load. The following parameters are used to tune the + * resource demands of the test: NUMBER_OF_SERVERS, NUMBER_OF_QUEUES, NUMBER_OF_CONSUMERS */ - public class ClusterNotificationsContinuityTest extends SoakTestBase { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/interrupt/JournalFlushInterruptTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/interrupt/JournalFlushInterruptTest.java index 707b343030a..d618e472382 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/interrupt/JournalFlushInterruptTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/interrupt/JournalFlushInterruptTest.java @@ -1,20 +1,21 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *

                      - * http://www.apache.org/licenses/LICENSE-2.0 - *

                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package org.apache.activemq.artemis.tests.soak.interrupt; import javax.jms.Connection; diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/interruptlm/LargeMessageFrozenTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/interruptlm/LargeMessageFrozenTest.java index 3e8f1054830..27ba0903367 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/interruptlm/LargeMessageFrozenTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/interruptlm/LargeMessageFrozenTest.java @@ -52,7 +52,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** Test various scenarios with broker communication in large message */ +/** + * Test various scenarios with broker communication in large message + */ public class LargeMessageFrozenTest extends ActiveMQTestBase { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/owleak/OWLeakTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/owleak/OWLeakTest.java index a5c0d1b645a..cf62bbcdc43 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/owleak/OWLeakTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/owleak/OWLeakTest.java @@ -60,9 +60,9 @@ /** * Refer to ./scripts/parameters.sh for suggested parameters - * - * Even though this test is not testing Paging, it will use Page just to generate enough load to the server to compete for resources in Native Buffers. - * + *

                      + * Even though this test is not testing Paging, it will use Page just to generate enough load to the server to compete + * for resources in Native Buffers. */ @ExtendWith(ParameterizedTestExtension.class) public class OWLeakTest extends SoakTestBase { 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 b3dfc779cfd..12b37e16715 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 @@ -55,9 +55,9 @@ import static org.apache.activemq.artemis.utils.TestParameters.testProperty; /** - * Refer to ./scripts/parameters.sh for suggested parameters - * #You may choose to use zip files to save some time on producing if you want to run this test over and over when debugging - * export TEST_FLOW_ZIP_LOCATION=a folder */ + * Refer to ./scripts/parameters.sh for suggested parameters #You may choose to use zip files to save some time on + * producing if you want to run this test over and over when debugging export TEST_FLOW_ZIP_LOCATION=a folder + */ @ExtendWith(ParameterizedTestExtension.class) public class FlowControlPagingTest extends SoakTestBase { 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 ce74b178c03..2015da2d115 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 @@ -55,10 +55,9 @@ import java.lang.invoke.MethodHandles; /** - * Refer to ./scripts/parameters.sh for suggested parameters - * #You may choose to use zip files to save some time on producing if you want to run this test over and over when debugging - * export TEST_HORIZONTAL_ZIP_LOCATION=a folder - * */ + * Refer to ./scripts/parameters.sh for suggested parameters #You may choose to use zip files to save some time on + * producing if you want to run this test over and over when debugging export TEST_HORIZONTAL_ZIP_LOCATION=a folder + */ @ExtendWith(ParameterizedTestExtension.class) public class HorizontalPagingTest extends SoakTestBase { diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/MegaCleanerPagingTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/MegaCleanerPagingTest.java index 07f8a380ad7..8a498f97434 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/MegaCleanerPagingTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/MegaCleanerPagingTest.java @@ -54,7 +54,7 @@ /** * PageCleanup should still be able to perform it well. - * */ + */ // supressing because the helper methods need to be public as they are called from a spawned java @SuppressWarnings("JUnit4TestNotRun") public class MegaCleanerPagingTest extends ActiveMQTestBase { 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 aabed636898..8fdb93f35eb 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 @@ -57,9 +57,12 @@ import java.lang.invoke.MethodHandles; /** - * Refer to ./scripts/parameters.sh for suggested parameters - * #You may choose to use zip files to save some time on producing if you want to run this test over and over when debugging - * export TEST_FLOW_ZIP_LOCATION=a folder */ + * Refer to ./scripts/parameters.sh for suggested parameters. You may choose to use zip files to save some time on + * producing if you want to run this test over and over when debugging: + *

                      + * export TEST_FLOW_ZIP_LOCATION=a folder
                      + * 
                      + */ @ExtendWith(ParameterizedTestExtension.class) public class SubscriptionPagingTest extends SoakTestBase { diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/replicaTxCheck/ReplicaTXCheckTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/replicaTxCheck/ReplicaTXCheckTest.java index bc396e3e904..7c68bb26851 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/replicaTxCheck/ReplicaTXCheckTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/replicaTxCheck/ReplicaTXCheckTest.java @@ -137,10 +137,9 @@ public void testTXCheckCORE_2() throws Exception { } /** - * this test is using three pairs of servers. - * It will send messages to one pair, then it consumes from that pair and sends to a second pair - * if killTarget==true the target pair is the one that's being killed, otherwise is the one with the consumers - * if useStop==true then the server is stopped with a regular stop call, otherwise it's halted + * This test is using three pairs of servers. It will send messages to one pair, then it consumes from that pair and + * sends to a second pair if killTarget==true the target pair is the one that's being killed, otherwise is the one + * with the consumers if useStop==true then the server is stopped with a regular stop call, otherwise it's halted */ void testTXCheck(String protocol, boolean killTarget, boolean useStop) throws Exception { diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AIOMultiThreadCompactorStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AIOMultiThreadCompactorStressTest.java index 48aea468684..bcd49bbd5fa 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AIOMultiThreadCompactorStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/AIOMultiThreadCompactorStressTest.java @@ -27,9 +27,6 @@ public static void hasAIO() { org.junit.jupiter.api.Assumptions.assumeTrue(AIOSequentialFileFactory.isSupported(), "Test case needs AIO to run"); } - /** - * @return - */ @Override protected JournalType getJournalType() { return JournalType.ASYNCIO; diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java index 6465f993b95..404c3ea9c7c 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java @@ -251,9 +251,6 @@ public void testAppend() throws Exception { journal.stop(); } - /** - * @throws Exception - */ private void reloadJournal() throws Exception { assertEquals(0, errors.get()); @@ -450,8 +447,8 @@ public void onError(final int errorCode, final String errorMessage) { } /** - * Adds stuff to the journal, but it will take a long time to remove them. - * This will cause cleanup and compacting to happen more often + * Adds stuff to the journal, but it will take a long time to remove them. This will cause cleanup and compacting to + * happen more often */ class SlowAppenderNoTX extends Thread { diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalRestartStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalRestartStressTest.java index b0ab922faaa..5d9e09745d8 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalRestartStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalRestartStressTest.java @@ -32,9 +32,8 @@ import org.junit.jupiter.api.Test; /** - * Simulates the journal being updated, compacted cleared up, - * and having multiple restarts, - * To make sure the journal would survive at multiple restarts of the server + * Simulates the journal being updated, compacted cleared up, and having multiple restarts, To make sure the journal + * would survive at multiple restarts of the server */ public class JournalRestartStressTest extends ActiveMQTestBase { @@ -85,13 +84,6 @@ public void testLoad() throws Throwable { } - /** - * @param sf - * @param NMSGS - * @throws ActiveMQException - * @throws InterruptedException - * @throws Throwable - */ private void produceMessages(final ClientSessionFactory sf, final int NMSGS) throws Throwable { final int TIMEOUT = 5000; diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/LargeJournalStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/LargeJournalStressTest.java index 8b4b5dd3a3c..1a41b0e2693 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/LargeJournalStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/LargeJournalStressTest.java @@ -226,9 +226,6 @@ public void setUp() throws Exception { locator = createInVMNonHALocator().setBlockOnAcknowledge(false).setBlockOnNonDurableSend(false).setBlockOnDurableSend(false); } - /** - * @throws Exception - */ private void setupServer(final JournalType journalType) throws Exception { Configuration config = createDefaultInVMConfig().setJournalSyncNonTransactional(false).setJournalFileSize(ActiveMQDefaultConfiguration.getDefaultJournalFileSize()).setJournalType(journalType).setJournalCompactMinFiles(0).setJournalCompactPercentage(50); diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MixupCompactorTestBase.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MixupCompactorTestBase.java index 9aaf7777157..afb58b42cff 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MixupCompactorTestBase.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MixupCompactorTestBase.java @@ -148,10 +148,6 @@ protected void beforeJournalOperation() throws Exception { checkJournalOperation(); } - /** - * @throws InterruptedException - * @throws Exception - */ protected void checkJournalOperation() throws Exception { if (startCompactAt == currentOperation) { threadCompact(); diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MultiThreadConsumerStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MultiThreadConsumerStressTest.java index 48e3f3c4bd8..f42c64c4129 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MultiThreadConsumerStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/MultiThreadConsumerStressTest.java @@ -41,7 +41,7 @@ /** * A MultiThreadConsumerStressTest - *
                      + *

                      * This test validates consuming / sending messages while compacting is working */ public class MultiThreadConsumerStressTest extends ActiveMQTestBase { diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/NIOMultiThreadCompactorStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/NIOMultiThreadCompactorStressTest.java index 4b419dc7d13..665c6abd6f9 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/NIOMultiThreadCompactorStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/NIOMultiThreadCompactorStressTest.java @@ -119,17 +119,10 @@ public void testMultiThreadCompact() throws Throwable { } } - /** - * @return - */ protected JournalType getJournalType() { return JournalType.NIO; } - /** - * @param xid - * @throws ActiveMQException - */ private void addEmptyTransaction(final Xid xid) throws Exception { ClientSessionFactory sf = createSessionFactory(locator); ClientSession session = sf.createSession(true, false, false); @@ -226,11 +219,6 @@ public void internalTestProduceAndConsume() throws Throwable { } - /** - * @param numberOfMessagesExpected - * @param queue - * @throws ActiveMQException - */ private void drainQueue(final int numberOfMessagesExpected, final SimpleString queue) throws ActiveMQException { ClientSession sess = sf.createSession(true, true); @@ -253,9 +241,6 @@ private void drainQueue(final int numberOfMessagesExpected, final SimpleString q sess.close(); } - /** - * @throws ActiveMQException - */ private void addBogusData(final int nmessages, final String queue) throws ActiveMQException { ClientSession session = sf.createSession(false, false); try { diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java index 5d4ef5308cb..0c61eb742fc 100644 --- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java +++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/paging/PageCursorStressTest.java @@ -566,9 +566,6 @@ private RoutingContextImpl generateCTX(Transaction tx) { return ctx; } - /** - * @throws Exception - */ private void waitCleanup() throws Exception { // The cleanup is done asynchronously, so we need to wait some time long timeout = System.currentTimeMillis() + 10000; @@ -734,10 +731,6 @@ private long addMessages(final int start, final int numMessages, final int messa return pageStore.getNumberOfPages(); } - /** - * @return - * @throws Exception - */ private PagingStoreImpl lookupPageStore(SimpleString address) throws Exception { return (PagingStoreImpl) server.getPagingManager().getPageStore(address); } @@ -755,9 +748,6 @@ public void setUp() throws Exception { lock = new ReentrantReadWriteLock().readLock(); } - /** - * @throws Exception - */ private void createServer() throws Exception { OperationContextImpl.clearContext(); @@ -776,10 +766,6 @@ private void createServer() throws Exception { } } - /** - * @return - * @throws Exception - */ private PageSubscription createNonPersistentCursor(Filter filter) throws Exception { long id = server.getStorageManager().generateID(); FakeQueue queue = new FakeQueue(SimpleString.of(filter.toString()), id); @@ -792,23 +778,10 @@ private PageSubscription createNonPersistentCursor(Filter filter) throws Excepti return subs; } - /** - * @return - * @throws Exception - */ private PageCursorProvider lookupCursorProvider() throws Exception { return lookupPageStore(ADDRESS).getCursorProvider(); } - /** - * @param storage - * @param pageStore - * @param pgParameter - * @param start - * @param NUM_MESSAGES - * @param messageSize - * @throws Exception - */ private Transaction pgMessages(StorageManager storage, PagingStoreImpl pageStore, long pgParameter, 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 da6d8f51b43..3b8b8e60bf3 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 @@ -67,9 +67,7 @@ public void testMultiThreadOpenAndCloses() throws Exception { } - /* - * Test the client triggering failure due to no pong received in time - */ + // Test the client triggering failure due to no pong received in time private void internalTest() throws Exception { Interceptor noPongInterceptor = (packet, conn) -> { PingStressTest.logger.info("In interceptor, packet is {}", packet.getType()); 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 103b9bd067e..8c5dfc729ba 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 @@ -37,7 +37,7 @@ /** * A concurrent QueueTest - * + *

                      * All the concurrent queue tests go in here */ public class QueueConcurrentTest extends ActiveMQTestBase { @@ -60,7 +60,7 @@ public void tearDown() throws Exception { super.tearDown(); } - /* + /** * Concurrent set consumer not busy, busy then, call deliver while messages are being added and consumed */ @Test 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 7039ae7a006..ab1d9e145fe 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 @@ -44,11 +44,13 @@ import java.lang.invoke.MethodHandles; /** - * you need to define -Djava.library.path=${project-root}/native/src/.libs when calling the JVM + * You need to define {@literal -Djava.library.path=${project-root}/native/src/.libs} when calling the JVM * If you are running this test in eclipse you should do: - * I - Run->Open Run Dialog - * II - Find the class on the list (you will find it if you already tried running this testcase before) - * III - Add -Djava.library.path=/native/src/.libs + *

                        + *
                      1. Run->Open Run Dialog + *
                      2. Find the class on the list (you will find it if you already tried running this testcase before) + *
                      3. Add {@literal -Djava.library.path=${project-root}/native/src/.libs} + *
                      */ public class MultiThreadAsynchronousFileTest extends AIOTestBase { diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/client/impl/LargeMessageBufferTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/client/impl/LargeMessageBufferTest.java index be30952abc8..510aacd2f87 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/client/impl/LargeMessageBufferTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/client/impl/LargeMessageBufferTest.java @@ -1,18 +1,20 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - *
                      - * http://www.apache.org/licenses/LICENSE-2.0 - *
                      - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.apache.activemq.artemis.tests.unit.core.client.impl; @@ -582,9 +584,6 @@ public void testReadBytesOnStreaming() throws Exception { is.close(); } - /** - * @return - */ private LargeMessageControllerImpl create15BytesSample() throws Exception { return splitBuffer(5, new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}); } @@ -644,9 +643,6 @@ private LargeMessageControllerImpl splitBuffer(final int splitFactor, } - /** - * @param bytes - */ private void validateAgainstSample(final byte[] bytes) { for (int i = 1; i <= 15; i++) { assertEquals(i, bytes[i - 1]); @@ -824,21 +820,13 @@ public ClientConsumer setManualFlowMessageHandler(MessageHandler handler) throws public void resetIfSlowConsumer() { } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal#getNonXAsession() - */ public ClientSessionInternal getSession() { - return null; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal#prepareForClose() - */ @Override public Thread prepareForClose(FutureLatch future) throws ActiveMQException { return null; } } - } diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java index 29283939aed..676bf6c8b1d 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/config/impl/ConnectorsServiceTest.java @@ -54,8 +54,6 @@ public void setUp() throws Exception { /** * Test that the connectors added via the service registry are added to the connectorsService, - * - * @throws Exception */ @Test public void testConnectorsServiceUsesInjectedConnectorServiceFactory() throws Exception { @@ -75,8 +73,6 @@ public void testConnectorsServiceUsesInjectedConnectorServiceFactory() throws Ex /** * Test that the connectors added via the config are added to the connectors service. - * - * @throws Exception */ @Test public void testConnectorsServiceUsesConfiguredConnectorServices() throws Exception { @@ -94,8 +90,6 @@ public void testConnectorsServiceUsesConfiguredConnectorServices() throws Except /** * Test that connectors can be created and destroyed directly. - * - * @throws Exception */ @Test public void testConnectorServiceUsedDirectly() throws Exception { 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 e7054416e89..bd83d823f82 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 @@ -428,8 +428,8 @@ public void decode(ActiveMQBuffer buffer) { }; /** - * This test is showing the behaviour of the TimedBuffer with a blocking API (NIO/MAPPED) and - * how the timeout value is not == 1/IOPS like the ASYNCIO case + * This test is showing the behaviour of the TimedBuffer with a blocking API (NIO/MAPPED) and how the timeout value + * is not == 1/IOPS like the ASYNCIO case */ @Test public void timeoutShouldMatchFlushIOPSWithNotBlockingFlush() { @@ -469,8 +469,8 @@ public void timeoutShouldMatchFlushIOPSWithNotBlockingFlush() { } /** - * This test is showing the behaviour of the TimedBuffer with a blocking API (NIO/MAPPED) and - * how the timeout value is not == 1/IOPS like the ASYNCIO case + * This test is showing the behaviour of the TimedBuffer with a blocking API (NIO/MAPPED) and how the timeout value + * is not == 1/IOPS like the ASYNCIO case */ @Test public void timeoutShouldMatchFlushIOPSWithBlockingFlush() { diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java index 30e3fe667f5..166bbadcb62 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PageTest.java @@ -325,13 +325,6 @@ protected void testAddMessages(final StorageManager storageManager, - /** - * @param simpleDestination - * @param page - * @param numberOfElements - * @return - * @throws Exception - */ protected void addPageElements(final StorageManager storageManager, final SimpleString simpleDestination, final Page page, diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java index b7c72fa03af..384b37b5b61 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/paging/impl/PagingManagerImplTest.java @@ -138,11 +138,10 @@ protected ByteBuffer createRandomBuffer(final int size) { return buffer; } - - /** depage is now done within the page's executor. - * This unit test needs to call the depage within that executor */ + /** + * depage is now done within the page's executor. This unit test needs to call the depage within that executor + */ protected Page depageOnExecutor(final PagingStore store) throws Exception { return callOnExecutor(store.getExecutor(), () -> store.depage(), 10, TimeUnit.SECONDS); } - } 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 01cb703dc16..1e5c1d4ef65 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 @@ -1095,9 +1095,6 @@ public void testBlockUnblock() throws Exception { } } - /** - * @return - */ protected PagingManager createMockManager() { return new FakePagingManager(); } @@ -1279,10 +1276,10 @@ public void testCheckExecutionIsNotRepeated() throws Exception { } } - /** depage is done within the page's executor. - * This unit test needs to call the depage within that executor */ + /** + * depage is done within the page's executor. This unit test needs to call the depage within that executor + */ private Page depageOnExecutor(final PagingStore store) throws Exception { return callOnExecutor(store.getExecutor(), () -> store.depage(), 10, TimeUnit.SECONDS); } - } diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java index 4ed491d9cde..d17ef7759f1 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/postoffice/impl/BindingsImplTest.java @@ -250,33 +250,21 @@ public void resume() { } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.transaction.Transaction#rollback() - */ @Override public void rollback() throws Exception { } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.transaction.Transaction#setState(org.apache.activemq.artemis.core.transaction.Transaction.State) - */ @Override public void setState(final State state) { } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.transaction.Transaction#suspend() - */ @Override public void suspend() { } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.transaction.Transaction#getDistinctQueues() - */ public Set getDistinctQueues() { return Collections.emptySet(); } @@ -301,7 +289,6 @@ public void setWaitBeforeCommit(boolean waitBeforeCommit) { @Override public RefsOperation createRefsOperation(Queue queue, AckReason reason) { - // TODO Auto-generated method stub return null; } @@ -313,17 +300,11 @@ public boolean hasTimedOut() { private final class FakeFilter implements Filter { - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.filter.Filter#getFilterString() - */ @Override public SimpleString getFilterString() { return null; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.filter.Filter#match(org.apache.activemq.artemis.core.server.ServerMessage) - */ @Override public boolean match(final Message message) { return false; @@ -339,7 +320,6 @@ public boolean match(Map map) { public boolean match(Filterable filterable) { return false; } - } private class FakeBinding implements Binding { @@ -368,35 +348,23 @@ public SimpleString getAddress() { return null; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.postoffice.Binding#getBindable() - */ @Override public Bindable getBindable() { return null; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.postoffice.Binding#getClusterName() - */ @Override public SimpleString getClusterName() { return null; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.postoffice.Binding#getDistance() - */ @Override public int getDistance() { return 0; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.postoffice.Binding#getFilter() - */ @Override public Filter getFilter() { return filter; @@ -407,26 +375,16 @@ public Long getID() { return 0L; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.postoffice.Binding#getRoutingName() - */ @Override public SimpleString getRoutingName() { return name; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.postoffice.Binding#getType() - */ @Override public BindingType getType() { - return null; } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.postoffice.Binding#getUniqueName() - */ @Override public SimpleString getUniqueName() { return uniqueName; @@ -447,9 +405,6 @@ public void route(final Message message, final RoutingContext context) throws Ex routedCount.incrementAndGet(); } - /* (non-Javadoc) - * @see org.apache.activemq.artemis.core.postoffice.Binding#toManagementString() - */ @Override public String toManagementString() { return null; @@ -462,9 +417,7 @@ public boolean isConnected() { @Override public void routeWithAck(Message message, RoutingContext context) { - } - } private final class FakeRemoteBinding extends FakeBinding implements RemoteQueueBinding { 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 6971d88cae2..63de0af84d1 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 @@ -61,9 +61,6 @@ import java.util.function.BiConsumer; -/** - * This test is replicating the behaviour from https://issues.jboss.org/browse/HORNETQ-988. - */ public class WildcardAddressManagerUnitTest extends ActiveMQTestBase { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -78,18 +75,16 @@ public void testUnitOnWildCardFailingScenario() throws Exception { try { ad.removeBinding(SimpleString.of("two"), null); } catch (Throwable e) { - // We are not failing the test here as this test is replicating the exact scenario - // that was happening under https://issues.jboss.org/browse/HORNETQ-988 - // In which this would be ignored + // We are not failing the test here as this test is replicating the exact scenario reported by the user in + // which this would be ignored. errors++; e.printStackTrace(); } try { ad.addBinding(new BindingFake("Topic1", "three")); } catch (Throwable e) { - // We are not failing the test here as this test is replicating the exact scenario - // that was happening under https://issues.jboss.org/browse/HORNETQ-988 - // In which this would be ignored + // We are not failing the test here as this test is replicating the exact scenario reported by the user in + // which this would be ignored. errors++; e.printStackTrace(); } @@ -108,18 +103,16 @@ public void testUnitOnWildCardFailingScenarioFQQN() throws Exception { try { ad.removeBinding(SimpleString.of("*::two"), null); } catch (Throwable e) { - // We are not failing the test here as this test is replicating the exact scenario - // that was happening under https://issues.jboss.org/browse/HORNETQ-988 - // In which this would be ignored + // We are not failing the test here as this test is replicating the exact scenario reported by the user in + // which this would be ignored. errors++; e.printStackTrace(); } try { ad.addBinding(new BindingFake("Topic1", "three")); } catch (Throwable e) { - // We are not failing the test here as this test is replicating the exact scenario - // that was happening under https://issues.jboss.org/browse/HORNETQ-988 - // In which this would be ignored + // We are not failing the test here as this test is replicating the exact scenario reported by the user in + // which this would be ignored. errors++; e.printStackTrace(); } diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/ChannelBufferWrapper2Test.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/ChannelBufferWrapper2Test.java index 632b064ee88..a4c70dd045f 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/ChannelBufferWrapper2Test.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/ChannelBufferWrapper2Test.java @@ -25,8 +25,6 @@ */ public class ChannelBufferWrapper2Test extends ActiveMQBufferTestBase { - - // BufferWrapperBase overrides ----------------------------------- @Override diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java index df19067ec99..37d1fa12b9c 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java @@ -142,7 +142,6 @@ public void testNullParams() throws Exception { } } - /** * that java system properties are read */ diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java index c18b4702389..db305fff44d 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/security/impl/ActiveMQSecurityManagerImplTest.java @@ -31,9 +31,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -/** - * tests ActiveMQSecurityManagerImpl - */ public class ActiveMQSecurityManagerImplTest extends ActiveMQTestBase { private ActiveMQSecurityManagerImpl securityManager; 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 4b7e0d4abf9..1a3b4de1801 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 @@ -1221,8 +1221,6 @@ public void testMessagesAdded() throws Exception { /** * Test the paused and resumed states with async deliveries. - * - * @throws Exception */ @Test public void testPauseAndResumeWithAsync() throws Exception { @@ -1276,8 +1274,6 @@ public void testPauseAndResumeWithAsync() throws Exception { /** * Test the paused and resumed states with direct deliveries. - * - * @throws Exception */ @Test diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/logging/AssertionLoggerTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/logging/AssertionLoggerTest.java index 937a9e954e0..60bf6d9d100 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/logging/AssertionLoggerTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/logging/AssertionLoggerTest.java @@ -29,9 +29,9 @@ import org.slf4j.LoggerFactory; /** - * This will validate the AssertionLoggerHandler is working as expected. - * Even though the class belongs to artemis-unit-test-support, this test has to be done here as we - * are validating the log4j2-tests-config.properties files and the classloading of everything. + * This will validate the AssertionLoggerHandler is working as expected. Even though the class belongs to + * artemis-unit-test-support, this test has to be done here as we are validating the log4j2-tests-config.properties + * files and the classloading of everything. */ public class AssertionLoggerTest { 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 a9ba544617d..d2cc6e910d8 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 @@ -41,9 +41,10 @@ import org.xml.sax.InputSource; /** - * This test is used to generate the commented out configs in the src/config/ra.xml. If you add a setter to the ActiveMQResourceAdapter - * this test should fail, if it does paste the new commented out configs into the ra.xml file and in here. don't forget to - * add a description for each new property added and try and put it in the config some where appropriate. + * This test is used to generate the commented out configs in the src/config/ra.xml. If you add a setter to the + * ActiveMQResourceAdapter this test should fail, if it does paste the new commented out configs into the ra.xml file + * and in here. don't forget to 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 logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -505,10 +506,6 @@ public void testConfiguration() throws Exception { } } - /** - * @param setter - * @return - */ private Class lookupType(Method setter) { Class clzz = setter.getParameterTypes()[0]; diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java index 83e71041262..c4cfebe942a 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/ra/ConnectionFactoryPropertiesTest.java @@ -78,8 +78,7 @@ public class ConnectionFactoryPropertiesTest extends ActiveMQTestBase { UNSUPPORTED_RA_PROPERTIES.add("jgroupsChannelRefName"); UNSUPPORTED_RA_PROPERTIES.add("entries"); - // TODO: shouldn't this be also set on the ActiveMQConnectionFactory: - // https://community.jboss.org/thread/211815?tstart=0 + // TODO: shouldn't this be also set on the ActiveMQConnectionFactory? UNSUPPORTED_RA_PROPERTIES.add("connectionPoolName"); } diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/FakePagingManager.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/FakePagingManager.java index 20128480101..9c3a93b1e92 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/FakePagingManager.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/FakePagingManager.java @@ -31,17 +31,14 @@ public class FakePagingManager implements PagingManager { @Override public void addBlockedStore(PagingStore store) { - } @Override public void checkMemory(Runnable runWhenAvailable) { - } @Override public void counterSnapshot() { - } @Override @@ -135,28 +132,16 @@ public long getDiskTotalSpace() { return 0; } - /* - * (non-Javadoc) - * @see org.apache.activemq.artemis.core.paging.PagingManager#isGlobalFull() - */ @Override public boolean isGlobalFull() { return false; } - /* - * (non-Javadoc) - * @see org.apache.activemq.artemis.core.paging.PagingManager#getTransactions() - */ @Override public Map getTransactions() { return null; } - /* - * (non-Javadoc) - * @see org.apache.activemq.artemis.core.paging.PagingManager#processReload() - */ @Override public void processReload() { } @@ -169,26 +154,19 @@ public void disableCleanup() { public void resumeCleanup() { } - /* - * (non-Javadoc) - * @see org.apache.activemq.artemis.core.settings.HierarchicalRepositoryChangeListener#onChange() - */ @Override public void onChange() { } @Override public void lock() { - // no-op } @Override public void unlock() { - // no-op } @Override public void injectMonitor(FileStoreMonitor monitor) throws Exception { - } } diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java index 1a0a23df333..68d4af02e14 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java @@ -436,7 +436,7 @@ private void internalAddWithID(boolean deferSupplier) { assertEquals(1000, nodeStore.size()); - /** remove all even items */ + // remove all even items for (int i = 1; i <= 1000; i += 2) { objs.removeWithID(serverID, i); } @@ -825,9 +825,6 @@ private void testIterate1(int num, LinkedListIterator iter) { assertNoSuchElementIsThrown(iter); } - /** - * @param iter - */ private void assertNoSuchElementIsThrown(LinkedListIterator iter) { try { iter.next(); 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 a902797f082..a3f76575ac1 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 @@ -64,14 +64,10 @@ public void testLatchOnSingleThread() throws Exception { } /** - * This test will open numberOfThreads threads, and add numberOfAdds on the - * VariableLatch After those addthreads are finished, the latch count should - * be numberOfThreads * numberOfAdds Then it will open numberOfThreads - * threads again releasing numberOfAdds on the VariableLatch After those - * releaseThreads are finished, the latch count should be 0 And all the - * waiting threads should be finished also - * - * @throws Exception + * This test will open numberOfThreads threads, and add numberOfAdds on the VariableLatch After those addthreads are + * finished, the latch count should be numberOfThreads * numberOfAdds Then it will open numberOfThreads threads again + * releasing numberOfAdds on the VariableLatch After those releaseThreads are finished, the latch count should be 0 + * And all the waiting threads should be finished also */ @Test public void testLatchOnMultiThread() throws Exception {

          Default properties
          Name Default Value