http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-server/src/test/resources/shared-store-slave-hapolicy-config2.xml ---------------------------------------------------------------------- diff --git a/artemis-server/src/test/resources/shared-store-slave-hapolicy-config2.xml b/artemis-server/src/test/resources/shared-store-slave-hapolicy-config2.xml index 57acd13..38661a6 100644 --- a/artemis-server/src/test/resources/shared-store-slave-hapolicy-config2.xml +++ b/artemis-server/src/test/resources/shared-store-slave-hapolicy-config2.xml @@ -15,9 +15,9 @@ limitations under the License. --> <configuration - xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="urn:activemq ../../../../activemq-server/src/main/resources/schema/artemis-server.xsd"> + xmlns="urn:activemq" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="urn:activemq ../../../../activemq-server/src/main/resources/schema/artemis-server.xsd"> <core xmlns="urn:activemq:core"> <ha-policy> <shared-store>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-server/src/test/resources/shared-store-slave-hapolicy-config3.xml ---------------------------------------------------------------------- diff --git a/artemis-server/src/test/resources/shared-store-slave-hapolicy-config3.xml b/artemis-server/src/test/resources/shared-store-slave-hapolicy-config3.xml index 991ea55..eb8e679 100644 --- a/artemis-server/src/test/resources/shared-store-slave-hapolicy-config3.xml +++ b/artemis-server/src/test/resources/shared-store-slave-hapolicy-config3.xml @@ -15,9 +15,9 @@ limitations under the License. --> <configuration - xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="urn:activemq ../../../../activemq-server/src/main/resources/schema/artemis-server.xsd"> + xmlns="urn:activemq" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="urn:activemq ../../../../activemq-server/src/main/resources/schema/artemis-server.xsd"> <core xmlns="urn:activemq:core"> <ha-policy> <shared-store> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-service-extensions/pom.xml ---------------------------------------------------------------------- diff --git a/artemis-service-extensions/pom.xml b/artemis-service-extensions/pom.xml index 175012d..f32a28c 100644 --- a/artemis-service-extensions/pom.xml +++ b/artemis-service-extensions/pom.xml @@ -14,7 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/ServiceUtils.java ---------------------------------------------------------------------- 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 99a372b..6faa5f8 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 @@ -16,15 +16,14 @@ */ package org.apache.activemq.artemis.service.extensions; +import javax.transaction.TransactionManager; +import javax.transaction.xa.XAResource; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Iterator; import java.util.Map; import java.util.ServiceLoader; -import javax.transaction.TransactionManager; -import javax.transaction.xa.XAResource; - import org.apache.activemq.artemis.service.extensions.transactions.TransactionManagerLocator; import org.apache.activemq.artemis.service.extensions.xa.ActiveMQXAResourceWrapper; import org.apache.activemq.artemis.service.extensions.xa.ActiveMQXAResourceWrapperFactory; @@ -54,8 +53,7 @@ public class ServiceUtils { transactionManager = findTransactionManager(); if (transactionManager != null) { transactionManagerLoaded = true; - } - else { + } else { ActiveMQServiceExtensionLogger.LOGGER.transactionManagerNotFound(); } } @@ -67,9 +65,8 @@ public class ServiceUtils { transactionManagerLoaded = (transactionManager != null); } - /** - * Find the <em>first</em> transaction manager loaded from the {@code TransactionManagerLocator} service or {@code null} if none is loaded. + * Find the <em>first</em> transaction manager loaded from the {@code TransactionManagerLocator} service or {@code null} if none is loaded. */ private static TransactionManager findTransactionManager() { return AccessController.doPrivileged(new PrivilegedAction<TransactionManager>() { @@ -85,8 +82,8 @@ public class ServiceUtils { } /** - * Find the <em>first</em> wrapper factory loaded from the {@code ActiveMQXAResourceWrapperFactory} service or - * use the default {@code ActiveMQXAResourceWrapperFactoryImpl} if none is loaded. + * Find the <em>first</em> 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(new PrivilegedAction<ActiveMQXAResourceWrapperFactory>() { @@ -95,8 +92,7 @@ public class ServiceUtils { Iterator<ActiveMQXAResourceWrapperFactory> iterator = ServiceLoader.load(ActiveMQXAResourceWrapperFactory.class, ServiceUtils.class.getClassLoader()).iterator(); if (iterator.hasNext()) { return iterator.next(); - } - else { + } else { return new ActiveMQXAResourceWrapperFactoryImpl(); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/ActiveMQXAResourceWrapperImpl.java ---------------------------------------------------------------------- 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 8f353e0..e1c182a 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 @@ -49,7 +49,7 @@ public class ActiveMQXAResourceWrapperImpl implements ActiveMQXAResourceWrapper //this.productVersion = VersionLoader.getVersion().getFullVersion(); this.productVersion = (String) properties.get(ACTIVEMQ_PRODUCT_VERSION); - String jndiName = (String) properties.get(ACTIVEMQ_JNDI_NAME); + String jndiName = (String) properties.get(ACTIVEMQ_JNDI_NAME); String nodeId = "NodeId:" + properties.get(ACTIVEMQ_NODE_ID); this.jndiNameNodeId = jndiName == null ? nodeId : jndiName + " " + nodeId; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/ActiveMQXAResourceWrapper.java ---------------------------------------------------------------------- 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 e00b49e..ceeec59 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 @@ -16,18 +16,17 @@ */ package org.apache.activemq.artemis.service.extensions.xa.recovery; -import java.util.Arrays; - import javax.transaction.xa.XAException; import javax.transaction.xa.XAResource; import javax.transaction.xa.Xid; +import java.util.Arrays; import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.ActiveMQExceptionType; import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException; +import org.apache.activemq.artemis.api.core.client.ActiveMQClient; import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; -import org.apache.activemq.artemis.api.core.client.ActiveMQClient; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.api.core.client.SessionFailureListener; @@ -81,8 +80,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList } return xids; - } - catch (XAException e) { + } catch (XAException e) { ActiveMQXARecoveryLogger.LOGGER.xaRecoverError(e); throw check(e); } @@ -96,8 +94,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList } try { xaResource.commit(xid, onePhase); - } - catch (XAException e) { + } catch (XAException e) { throw check(e); } } @@ -110,8 +107,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList } try { xaResource.rollback(xid); - } - catch (XAException e) { + } catch (XAException e) { throw check(e); } } @@ -125,8 +121,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList try { xaResource.forget(xid); - } - catch (XAException e) { + } catch (XAException e) { throw check(e); } } @@ -140,8 +135,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList XAResource xaResource = getDelegate(false); try { return xaResource.isSameRM(xaRes); - } - catch (XAException e) { + } catch (XAException e) { throw check(e); } } @@ -154,8 +148,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList } try { return xaResource.prepare(xid); - } - catch (XAException e) { + } catch (XAException e) { throw check(e); } } @@ -168,8 +161,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList } try { xaResource.start(xid, flags); - } - catch (XAException e) { + } catch (XAException e) { throw check(e); } } @@ -182,8 +174,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList } try { xaResource.end(xid, flags); - } - catch (XAException e) { + } catch (XAException e) { throw check(e); } } @@ -196,8 +187,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList } try { return xaResource.getTransactionTimeout(); - } - catch (XAException e) { + } catch (XAException e) { throw check(e); } } @@ -210,8 +200,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList } try { return xaResource.setTransactionTimeout(seconds); - } - catch (XAException e) { + } catch (XAException e) { throw check(e); } } @@ -222,8 +211,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList if (ActiveMQXARecoveryLogger.LOGGER.isDebugEnabled()) { ActiveMQXARecoveryLogger.LOGGER.debug("being disconnected for server shutdown", me); } - } - else { + } else { ActiveMQXARecoveryLogger.LOGGER.xaRecoverConnectionError(me, csf); } close(); @@ -249,8 +237,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList Exception error = null; try { result = connect(); - } - catch (Exception e) { + } catch (Exception e) { error = e; } @@ -267,8 +254,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList ActiveMQXARecoveryLogger.LOGGER.debug("Cannot get connectionFactory XAResource", xae); } throw xae; - } - else { + } else { XAException xae = new XAException("Error trying to connect to any providers for xa recovery"); xae.errorCode = XAException.XAER_RMFAIL; if (error != null) { @@ -317,8 +303,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList // Manual configuration may still use discovery, so we will keep this if (xaRecoveryConfig.getDiscoveryConfiguration() != null) { serverLocator = ActiveMQClient.createServerLocator(false, xaRecoveryConfig.getDiscoveryConfiguration()); - } - else { + } else { serverLocator = ActiveMQClient.createServerLocator(false, xaRecoveryConfig.getTransportConfig()); } serverLocator.disableFinalizeCheck(); @@ -326,12 +311,10 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList csf = serverLocator.createSessionFactory(); if (xaRecoveryConfig.getUsername() == null) { cs = csf.createSession(true, false, false); - } - else { + } else { cs = csf.createSession(xaRecoveryConfig.getUsername(), xaRecoveryConfig.getPassword(), true, false, false, false, 1); } - } - catch (Throwable e) { + } catch (Throwable e) { ActiveMQXARecoveryLogger.LOGGER.xaRecoverAutoConnectionError(e, xaRecoveryConfig); if (ActiveMQXARecoveryLogger.LOGGER.isDebugEnabled()) { ActiveMQXARecoveryLogger.LOGGER.debug(e.getMessage(), e); @@ -342,8 +325,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList cs.close(); if (serverLocator != null) serverLocator.close(); - } - catch (Throwable ignored) { + } catch (Throwable ignored) { if (ActiveMQXARecoveryLogger.LOGGER.isTraceEnabled()) { ActiveMQXARecoveryLogger.LOGGER.trace(e.getMessage(), ignored); } @@ -399,8 +381,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList if (oldDelegate != null) { try { oldDelegate.close(); - } - catch (Throwable ignorable) { + } catch (Throwable ignorable) { ActiveMQXARecoveryLogger.LOGGER.debug(ignorable.getMessage(), ignorable); } } @@ -408,8 +389,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList if (oldCSF != null) { try { oldCSF.close(); - } - catch (Throwable ignorable) { + } catch (Throwable ignorable) { ActiveMQXARecoveryLogger.LOGGER.debug(ignorable.getMessage(), ignorable); } } @@ -417,8 +397,7 @@ public class ActiveMQXAResourceWrapper implements XAResource, SessionFailureList if (oldServerLocator != null) { try { oldServerLocator.close(); - } - catch (Throwable ignorable) { + } catch (Throwable ignorable) { ActiveMQXARecoveryLogger.LOGGER.debug(ignorable.getMessage(), ignorable); } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-service-extensions/src/main/java/org/apache/activemq/artemis/service/extensions/xa/recovery/XARecoveryConfig.java ---------------------------------------------------------------------- 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 a75bdac..f2f7864 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 @@ -45,11 +45,13 @@ public class XARecoveryConfig { private final Map<String, String> properties; private final ClientProtocolManagerFactory clientProtocolManager; - public static XARecoveryConfig newConfig(ActiveMQConnectionFactory factory, String userName, String password, Map<String, String> properties) { + public static XARecoveryConfig newConfig(ActiveMQConnectionFactory factory, + String userName, + String password, + Map<String, String> properties) { if (factory.getServerLocator().getDiscoveryGroupConfiguration() != null) { return new XARecoveryConfig(factory.getServerLocator().isHA(), factory.getServerLocator().getDiscoveryGroupConfiguration(), userName, password, properties, factory.getServerLocator().getProtocolManagerFactory()); - } - else { + } else { return new XARecoveryConfig(factory.getServerLocator().isHA(), factory.getServerLocator().getStaticTransportConfigurations(), userName, password, properties, factory.getServerLocator().getProtocolManagerFactory()); } @@ -75,7 +77,6 @@ public class XARecoveryConfig { this.clientProtocolManager = clientProtocolManager; } - public XARecoveryConfig(final boolean ha, final TransportConfiguration[] transportConfiguration, final String username, @@ -143,8 +144,7 @@ public class XARecoveryConfig { public ServerLocator createServerLocator() { if (getDiscoveryConfiguration() != null) { return ActiveMQClient.createServerLocator(isHA(), getDiscoveryConfiguration()).setProtocolManagerFactory(clientProtocolManager); - } - else { + } else { return ActiveMQClient.createServerLocator(isHA(), getTransportConfig()).setProtocolManagerFactory(clientProtocolManager); } @@ -175,8 +175,7 @@ public class XARecoveryConfig { if (discoveryConfiguration == null) { if (other.discoveryConfiguration != null) return false; - } - else if (!discoveryConfiguration.equals(other.discoveryConfiguration)) + } else if (!discoveryConfiguration.equals(other.discoveryConfiguration)) return false; if (!Arrays.equals(transportConfiguration, other.transportConfiguration)) return false; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/recovery/XARecoveryConfigTest.java ---------------------------------------------------------------------- diff --git a/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/recovery/XARecoveryConfigTest.java b/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/recovery/XARecoveryConfigTest.java index b5f1021..d856220 100644 --- a/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/recovery/XARecoveryConfigTest.java +++ b/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/recovery/XARecoveryConfigTest.java @@ -6,7 +6,7 @@ * (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, @@ -22,7 +22,6 @@ import org.apache.activemq.artemis.service.extensions.xa.recovery.XARecoveryConf import org.junit.Assert; import org.junit.Test; - public class XARecoveryConfigTest { @Test @@ -30,12 +29,10 @@ public class XARecoveryConfigTest { String factClass = "org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory"; TransportConfiguration transportConfig = new TransportConfiguration(factClass, null); - XARecoveryConfig config = new XARecoveryConfig(false, new TransportConfiguration[]{transportConfig}, - null, null, null); + XARecoveryConfig config = new XARecoveryConfig(false, new TransportConfiguration[]{transportConfig}, null, null, null); TransportConfiguration transportConfig2 = new TransportConfiguration(factClass, null); - XARecoveryConfig config2 = new XARecoveryConfig(false, new TransportConfiguration[]{transportConfig2}, - null, null, null); + XARecoveryConfig config2 = new XARecoveryConfig(false, new TransportConfiguration[]{transportConfig2}, null, null, null); // They are using Different names Assert.assertNotEquals(transportConfig, transportConfig2); @@ -50,12 +47,10 @@ public class XARecoveryConfigTest { String factClass = "org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory"; TransportConfiguration transportConfig = new TransportConfiguration(factClass, null); - XARecoveryConfig config = new XARecoveryConfig(false, new TransportConfiguration[]{transportConfig}, - null, null, null); + XARecoveryConfig config = new XARecoveryConfig(false, new TransportConfiguration[]{transportConfig}, null, null, null); TransportConfiguration transportConfig2 = new TransportConfiguration(factClass + "2", null); - XARecoveryConfig config2 = new XARecoveryConfig(false, new TransportConfiguration[]{transportConfig2}, - null, null, null); + XARecoveryConfig config2 = new XARecoveryConfig(false, new TransportConfiguration[]{transportConfig2}, null, null, null); // They are using Different names Assert.assertNotEquals(transportConfig, transportConfig2); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/transactions/DummyTransactionManagerLocator.java ---------------------------------------------------------------------- diff --git a/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/transactions/DummyTransactionManagerLocator.java b/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/transactions/DummyTransactionManagerLocator.java index 3ed77fc..2fd09da 100644 --- a/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/transactions/DummyTransactionManagerLocator.java +++ b/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/transactions/DummyTransactionManagerLocator.java @@ -16,8 +16,6 @@ */ package org.apache.activemq.artemis.service.extensions.tests.transactions; -import org.apache.activemq.artemis.service.extensions.transactions.TransactionManagerLocator; - import javax.transaction.HeuristicMixedException; import javax.transaction.HeuristicRollbackException; import javax.transaction.InvalidTransactionException; @@ -27,6 +25,8 @@ import javax.transaction.SystemException; import javax.transaction.Transaction; import javax.transaction.TransactionManager; +import org.apache.activemq.artemis.service.extensions.transactions.TransactionManagerLocator; + public class DummyTransactionManagerLocator implements TransactionManagerLocator, TransactionManager { @Override http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ActiveMQXAResourceWrapperImplTest.java ---------------------------------------------------------------------- diff --git a/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ActiveMQXAResourceWrapperImplTest.java b/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ActiveMQXAResourceWrapperImplTest.java index 3d7f37e..7ecb0f7 100644 --- a/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ActiveMQXAResourceWrapperImplTest.java +++ b/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ActiveMQXAResourceWrapperImplTest.java @@ -17,7 +17,6 @@ package org.apache.activemq.artemis.service.extensions.tests.xa; import javax.transaction.xa.XAResource; - import java.util.HashMap; import java.util.Map; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ServiceUtilsTest.java ---------------------------------------------------------------------- diff --git a/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ServiceUtilsTest.java b/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ServiceUtilsTest.java index 5e9db00..2fd1395 100644 --- a/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ServiceUtilsTest.java +++ b/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ServiceUtilsTest.java @@ -16,13 +16,13 @@ */ package org.apache.activemq.artemis.service.extensions.tests.xa; -import static org.jgroups.util.Util.assertTrue; - import java.lang.reflect.Method; import org.apache.activemq.artemis.service.extensions.ServiceUtils; import org.junit.Test; +import static org.jgroups.util.Util.assertTrue; + public class ServiceUtilsTest { @Test http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-web/pom.xml ---------------------------------------------------------------------- diff --git a/artemis-web/pom.xml b/artemis-web/pom.xml index 89a54ad..8810192 100644 --- a/artemis-web/pom.xml +++ b/artemis-web/pom.xml @@ -14,7 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> @@ -28,7 +29,7 @@ <name>ActiveMQ Artemis Web</name> <properties> - <activemq.basedir>${project.basedir}/..</activemq.basedir> + <activemq.basedir>${project.basedir}/..</activemq.basedir> </properties> <dependencies> @@ -75,10 +76,10 @@ <!-- JBoss Logging --> - <dependency> - <groupId>org.jboss.logging</groupId> - <artifactId>jboss-logging</artifactId> - </dependency> + <dependency> + <groupId>org.jboss.logging</groupId> + <artifactId>jboss-logging</artifactId> + </dependency> </dependencies> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java ---------------------------------------------------------------------- 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 739edc0..699dce3 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 @@ -16,6 +16,11 @@ */ package org.apache.activemq.artemis.component; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Path; +import java.nio.file.Paths; + import org.apache.activemq.artemis.ActiveMQWebLogger; import org.apache.activemq.artemis.components.ExternalComponent; import org.apache.activemq.artemis.dto.AppDTO; @@ -34,11 +39,6 @@ import org.eclipse.jetty.server.handler.ResourceHandler; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.webapp.WebAppContext; -import java.io.IOException; -import java.net.URI; -import java.nio.file.Path; -import java.nio.file.Paths; - public class WebServerComponent implements ExternalComponent { private Server server; @@ -75,8 +75,7 @@ public class WebServerComponent implements ExternalComponent { connector = new ServerConnector(server, sslConnectionFactory, httpFactory); - } - else { + } else { connector = new ServerConnector(server); } connector.setPort(uri.getPort()); @@ -86,8 +85,7 @@ public class WebServerComponent implements ExternalComponent { handlers = new HandlerList(); - Path warDir = Paths.get(artemisHome != null ? artemisHome : ".") - .resolve( webServerConfig.path ).toAbsolutePath(); + Path warDir = Paths.get(artemisHome != null ? artemisHome : ".").resolve(webServerConfig.path).toAbsolutePath(); if (webServerConfig.apps != null) { for (AppDTO app : webServerConfig.apps) { @@ -134,8 +132,7 @@ public class WebServerComponent implements ExternalComponent { WebAppContext webapp = new WebAppContext(); if (url.startsWith("/")) { webapp.setContextPath(url); - } - else { + } else { webapp.setContextPath("/" + url); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java ---------------------------------------------------------------------- diff --git a/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java b/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java index 587c76f..1e0aff7 100644 --- a/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java +++ b/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java @@ -16,6 +16,8 @@ */ package org.apache.activemq.cli.test; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; import java.net.URI; import java.net.URISyntaxException; import java.util.concurrent.CountDownLatch; @@ -46,9 +48,6 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLEngine; - public class WebServerComponentTest extends Assert { static final String URL = System.getProperty("url", "http://localhost:8161/WebServerComponentTest.txt"); @@ -115,12 +114,7 @@ public class WebServerComponentTest extends Assert { // Make the connection attempt. String keyStoreProvider = "JKS"; - SSLContext context = SSLSupport.createContext(keyStoreProvider, - webServerDTO.keyStorePath, - webServerDTO.keyStorePassword, - keyStoreProvider, - webServerDTO.keyStorePath, - webServerDTO.keyStorePassword); + SSLContext context = SSLSupport.createContext(keyStoreProvider, webServerDTO.keyStorePath, webServerDTO.keyStorePassword, keyStoreProvider, webServerDTO.keyStorePath, webServerDTO.keyStorePassword); SSLEngine engine = context.createSSLEngine(); engine.setUseClientMode(true); @@ -173,12 +167,7 @@ public class WebServerComponentTest extends Assert { // Make the connection attempt. String keyStoreProvider = "JKS"; - SSLContext context = SSLSupport.createContext(keyStoreProvider, - webServerDTO.keyStorePath, - webServerDTO.keyStorePassword, - keyStoreProvider, - webServerDTO.trustStorePath, - webServerDTO.trustStorePassword); + SSLContext context = SSLSupport.createContext(keyStoreProvider, webServerDTO.keyStorePath, webServerDTO.keyStorePassword, keyStoreProvider, webServerDTO.trustStorePath, webServerDTO.trustStorePassword); SSLEngine engine = context.createSSLEngine(); engine.setUseClientMode(true); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-website/package.json ---------------------------------------------------------------------- diff --git a/artemis-website/package.json b/artemis-website/package.json index 9bf826f..1f7a8bc 100644 --- a/artemis-website/package.json +++ b/artemis-website/package.json @@ -8,6 +8,6 @@ "url": "https://github.com/apache/activemq-artemis" }, "devDependencies": { - "gitbook-cli": "~0.3.6" + "gitbook-cli": "~0.3.6" } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-website/pom.xml ---------------------------------------------------------------------- diff --git a/artemis-website/pom.xml b/artemis-website/pom.xml index 11cf3c0..9b2eba6 100644 --- a/artemis-website/pom.xml +++ b/artemis-website/pom.xml @@ -14,7 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> @@ -61,17 +62,17 @@ <!-- stuff needed to resolve various classes during javadoc processing --> <dependency> - <groupId>org.jboss.logging</groupId> - <artifactId>jboss-logging-processor</artifactId> - <scope>provided</scope> - <optional>true</optional> + <groupId>org.jboss.logging</groupId> + <artifactId>jboss-logging-processor</artifactId> + <scope>provided</scope> + <optional>true</optional> </dependency> <dependency> - <groupId>xalan</groupId> - <artifactId>xalan</artifactId> - <version>2.7.2</version> - <optional>true</optional> - <scope>provided</scope> + <groupId>xalan</groupId> + <artifactId>xalan</artifactId> + <version>2.7.2</version> + <optional>true</optional> + <scope>provided</scope> </dependency> </dependencies> @@ -119,7 +120,8 @@ </dependencySourceIncludes> <quiet>false</quiet> <aggregate>true</aggregate> - <excludePackageNames>org.apache.activemq.artemis.core:org.apache.activemq.artemis.utils</excludePackageNames> + <excludePackageNames>org.apache.activemq.artemis.core:org.apache.activemq.artemis.utils + </excludePackageNames> </configuration> </execution> </executions> @@ -168,25 +170,26 @@ <phase>generate-sources</phase> <configuration> <target> - <condition property="gitbook.cmd" value="${basedir}/node_modules/.bin/gitbook.cmd" else="${basedir}/node_modules/.bin/gitbook"> - <os family="windows" /> + <condition property="gitbook.cmd" value="${basedir}/node_modules/.bin/gitbook.cmd" + else="${basedir}/node_modules/.bin/gitbook"> + <os family="windows"/> </condition> <!-- lets generate the gitbook --> - <mkdir dir="${webapp-outdir-user-manual}" /> + <mkdir dir="${webapp-outdir-user-manual}"/> <echo>executing ${gitbook.cmd}</echo> <exec executable="${gitbook.cmd}" failonerror="true"> - <env key="PATH" path="${basedir}/node" /> - <arg value="build" /> - <arg value="${basedir}/../docs/user-manual/en" /> - <arg value="${webapp-outdir-user-manual}" /> + <env key="PATH" path="${basedir}/node"/> + <arg value="build"/> + <arg value="${basedir}/../docs/user-manual/en"/> + <arg value="${webapp-outdir-user-manual}"/> </exec> - <mkdir dir="${webapp-outdir-hacking-guide}" /> + <mkdir dir="${webapp-outdir-hacking-guide}"/> <echo>executing ${gitbook.cmd}</echo> <exec executable="${gitbook.cmd}" failonerror="true"> - <env key="PATH" path="${basedir}/node" /> - <arg value="build" /> - <arg value="${basedir}/../docs/hacking-guide/en" /> - <arg value="${webapp-outdir-hacking-guide}" /> + <env key="PATH" path="${basedir}/node"/> + <arg value="build"/> + <arg value="${basedir}/../docs/hacking-guide/en"/> + <arg value="${webapp-outdir-hacking-guide}"/> </exec> </target> </configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-website/src/main/resources/examples/index.html ---------------------------------------------------------------------- diff --git a/artemis-website/src/main/resources/examples/index.html b/artemis-website/src/main/resources/examples/index.html index 9c325e3..e6ddb74 100644 --- a/artemis-website/src/main/resources/examples/index.html +++ b/artemis-website/src/main/resources/examples/index.html @@ -31,7 +31,8 @@ <div class="wrapper"> <ul> <li><a href="../index.html">ActiveMQ Artemis</a></li> - </ul> <div></div> + </ul> + <div></div> </div> </div> <div id="content"> @@ -41,20 +42,27 @@ </div> <div class="message"> - <h1>Apache ActiveMQ Artemis Examples</h1> + <h1>Apache ActiveMQ Artemis Examples</h1> - <p>Apache ActiveMQ Artemis comes with over 90 runnable examples. These can be found in the examples directory in the root of the - distribution folder. There are examples covering JMS as well as all the protocols and functionality that Apache ActiveMQ Artemis - supports.</p> + <p>Apache ActiveMQ Artemis comes with over 90 runnable examples. These can be found in the examples + directory in the root of the + distribution folder. There are examples covering JMS as well as all the protocols and functionality that + Apache ActiveMQ Artemis + supports.</p> - <p>Each example has its own instructions as to how they can be run, but for most of them it is as simple as running - <code>mvn verify</code> from the example directory. This will start a broker with the correct configuration, run the - example and then stop the broker. You'll need to ensure there is not a broker already running as this may conflict - with the broker that is configured and used in the example.</p> + <p>Each example has its own instructions as to how they can be run, but for most of them it is as simple as + running + <code>mvn verify</code> from the example directory. This will start a broker with the correct + configuration, run the + example and then stop the broker. You'll need to ensure there is not a broker already running as this + may conflict + with the broker that is configured and used in the example.</p> - <p>You may also run the example without starting the server by specifying -PnoServer (mvn -PnoServer verify). You can then use your own server for the example.</p> + <p>You may also run the example without starting the server by specifying -PnoServer (mvn -PnoServer + verify). You can then use your own server for the example.</p> - <p>Notice that some examples will require special cases and multiple servers, for example in some Failover tests. Always refer to the README on each example.</p> + <p>Notice that some examples will require special cases and multiple servers, for example in some Failover + tests. Always refer to the README on each example.</p> <div></div> </div> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-website/src/main/resources/hacking-guide/index.html ---------------------------------------------------------------------- diff --git a/artemis-website/src/main/resources/hacking-guide/index.html b/artemis-website/src/main/resources/hacking-guide/index.html index 8f71b63..4975dcb 100644 --- a/artemis-website/src/main/resources/hacking-guide/index.html +++ b/artemis-website/src/main/resources/hacking-guide/index.html @@ -17,14 +17,17 @@ specific language governing permissions and limitations under the License. --> <html> - <head> - <meta http-equiv="refresh" content="3;url=https://github.com/apache/activemq-artemis/blob/master/docs/hacking-guide/en/SUMMARY.md"/> - </head> +<head> + <meta http-equiv="refresh" + content="3;url=https://github.com/apache/activemq-artemis/blob/master/docs/hacking-guide/en/SUMMARY.md"/> +</head> <h1>User Manual</h1> -<p>If you are seeing this message, it is because the Hacking Guide was not built during the Apache ActiveMQ Artemis build. To -build Apache ActiveMQ Artemis with the Hacking Guide you must use the maven release profile: -<code>mvn clean install -Prelease</code>.</p> -<p>You can view the current documentation directly on <a href="https://github.com/apache/activemq-artemis/blob/master/docs/hacking-guide/en/SUMMARY.md">github</a>.</p> +<p>If you are seeing this message, it is because the Hacking Guide was not built during the Apache ActiveMQ Artemis + build. To + build Apache ActiveMQ Artemis with the Hacking Guide you must use the maven release profile: + <code>mvn clean install -Prelease</code>.</p> +<p>You can view the current documentation directly on <a + href="https://github.com/apache/activemq-artemis/blob/master/docs/hacking-guide/en/SUMMARY.md">github</a>.</p> </html> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-website/src/main/resources/index.html ---------------------------------------------------------------------- diff --git a/artemis-website/src/main/resources/index.html b/artemis-website/src/main/resources/index.html index 3e8ab5c..58890ec 100644 --- a/artemis-website/src/main/resources/index.html +++ b/artemis-website/src/main/resources/index.html @@ -31,7 +31,8 @@ <div class="wrapper"> <ul> <li><a href="index.html">ActiveMQ Artemis</a></li> - </ul> <div></div> + </ul> + <div></div> </div> </div> <div id="overview"> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/artemis-website/src/main/resources/user-manual/index.html ---------------------------------------------------------------------- diff --git a/artemis-website/src/main/resources/user-manual/index.html b/artemis-website/src/main/resources/user-manual/index.html index 0727109..7fc5fda 100644 --- a/artemis-website/src/main/resources/user-manual/index.html +++ b/artemis-website/src/main/resources/user-manual/index.html @@ -18,15 +18,18 @@ under the License. --> <html> - <head> - <meta http-equiv="refresh" content="3;url=https://github.com/apache/activemq-artemis/blob/master/docs/user-manual/en/SUMMARY.md"/> - </head> +<head> + <meta http-equiv="refresh" + content="3;url=https://github.com/apache/activemq-artemis/blob/master/docs/user-manual/en/SUMMARY.md"/> +</head> <h1>User Manual</h1> -<p>If you are seeing this message, it is because the User Manual was not built during the Apache ActiveMQ Artemis build. To -build Apache ActiveMQ Artemis with the User Manual you must use the maven release profile: -<code>mvn clean install -Prelease</code>.</p> -<p>You can view the current documentation directly on <a href="https://github.com/apache/activemq-artemis/blob/master/docs/user-manual/en/SUMMARY.md">github</a>.</p> +<p>If you are seeing this message, it is because the User Manual was not built during the Apache ActiveMQ Artemis build. + To + build Apache ActiveMQ Artemis with the User Manual you must use the maven release profile: + <code>mvn clean install -Prelease</code>.</p> +<p>You can view the current documentation directly on <a + href="https://github.com/apache/activemq-artemis/blob/master/docs/user-manual/en/SUMMARY.md">github</a>.</p> </html> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/docs/hacking-guide/en/formatting.md ---------------------------------------------------------------------- diff --git a/docs/hacking-guide/en/formatting.md b/docs/hacking-guide/en/formatting.md index e6c4979..976d853 100644 --- a/docs/hacking-guide/en/formatting.md +++ b/docs/hacking-guide/en/formatting.md @@ -8,4 +8,8 @@ copy them _after importing all your projects_: done Do not use the [maven-eclipse-plugin](https://maven.apache.org/plugins/maven-eclipse-plugin/) to copy the files as it -conflicts with [m2e](http://eclipse.org/m2e/). \ No newline at end of file +conflicts with [m2e](http://eclipse.org/m2e/). + +# Idea + +If you completed the step described on [idea instructions](ide.md#style-templates-and-inspection-settings-for-idea), and selected the code style accordingly you should be ready to go. http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/docs/hacking-guide/en/ide.md ---------------------------------------------------------------------- diff --git a/docs/hacking-guide/en/ide.md b/docs/hacking-guide/en/ide.md index 88435a5..85a832e 100644 --- a/docs/hacking-guide/en/ide.md +++ b/docs/hacking-guide/en/ide.md @@ -45,7 +45,9 @@ We have shared the style templates that are good for this project. If you want t * Select both Code Style Templates and File templates (it's the default option) * Select OK and restart Idea -Similarly, to import inspection settings: +Alternatively you can copy artemis-codestyle.xml under your home settings at ``IntelliJIdea15/codestyles``. + +#### To import inspection settings: * File->Settings->Editor->Inspections->Manage->Import * Select the file ./artemis-cloned-folder/etc/ide-settings/IDEA-artemis-inspections.xml http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/etc/checkstyle.xml ---------------------------------------------------------------------- diff --git a/etc/checkstyle.xml b/etc/checkstyle.xml index bb266c5..f695bef 100644 --- a/etc/checkstyle.xml +++ b/etc/checkstyle.xml @@ -65,11 +65,13 @@ under the License. <module name="ArrayTypeStyle"/> <!-- Make sure left curly braces are on the same line. --> <module name="LeftCurly"> - <property name="option" value="eol"/> + <property name="maxLineLength" value="100"/> </module> - <!-- Make sure right curly braces are on a new line by itself. Note, this is not the recommendation from Sun. It is a legacy preference. --> + + <module name="RightCurly"/> <module name="RightCurly"> <property name="option" value="alone"/> + <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/> </module> <!-- Checks that there is no whitespace after certain tokens; e.g. "." and "!". --> <module name="NoWhitespaceAfter"/> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/etc/ide-settings/IDEA-artemis-inspections.xml ---------------------------------------------------------------------- diff --git a/etc/ide-settings/IDEA-artemis-inspections.xml b/etc/ide-settings/IDEA-artemis-inspections.xml deleted file mode 100644 index c6ec80b..0000000 --- a/etc/ide-settings/IDEA-artemis-inspections.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<inspections version="1.0"> - <option name="myName" value="Artemis" /> - <inspection_tool class="MissingOverrideAnnotation" enabled="true" level="ERROR" enabled_by_default="true"> - <option name="ignoreObjectMethods" value="false" /> - <option name="ignoreAnonymousClassMethods" value="false" /> - </inspection_tool> -</inspections> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/etc/ide-settings/IDEA-style.jar ---------------------------------------------------------------------- diff --git a/etc/ide-settings/IDEA-style.jar b/etc/ide-settings/IDEA-style.jar deleted file mode 100644 index 83893f3..0000000 Binary files a/etc/ide-settings/IDEA-style.jar and /dev/null differ http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/etc/ide-settings/idea/IDEA-style.jar ---------------------------------------------------------------------- diff --git a/etc/ide-settings/idea/IDEA-style.jar b/etc/ide-settings/idea/IDEA-style.jar new file mode 100644 index 0000000..8e40080 Binary files /dev/null and b/etc/ide-settings/idea/IDEA-style.jar differ http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/etc/ide-settings/idea/artemis-codestyle.xml ---------------------------------------------------------------------- diff --git a/etc/ide-settings/idea/artemis-codestyle.xml b/etc/ide-settings/idea/artemis-codestyle.xml new file mode 100644 index 0000000..e336530 --- /dev/null +++ b/etc/ide-settings/idea/artemis-codestyle.xml @@ -0,0 +1,52 @@ +<code_scheme name="artemis-codestyle"> + <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="50000" /> + <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="30000" /> + <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND"> + <value /> + </option> + <option name="IMPORT_LAYOUT_TABLE"> + <value> + <package name="javax" withSubpackages="true" static="false" /> + <package name="java" withSubpackages="true" static="false" /> + <emptyLine /> + <package name="junit.framework" withSubpackages="true" static="false" /> + <emptyLine /> + <package name="" withSubpackages="true" static="false" /> + <emptyLine /> + <package name="" withSubpackages="true" static="true" /> + </value> + </option> + <option name="JD_P_AT_EMPTY_LINES" value="false" /> + <option name="JD_PRESERVE_LINE_FEEDS" value="true" /> + <MarkdownNavigatorCodeStyleSettings> + <option name="RIGHT_MARGIN" value="72" /> + </MarkdownNavigatorCodeStyleSettings> + <XML> + <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" /> + </XML> + <codeStyleSettings language="JAVA"> + <option name="KEEP_LINE_BREAKS" value="false" /> + <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" /> + <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" /> + <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" /> + <option name="KEEP_BLANK_LINES_IN_CODE" value="1" /> + <option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" /> + <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" /> + <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" /> + <option name="METHOD_PARAMETERS_WRAP" value="5" /> + <option name="WHILE_BRACE_FORCE" value="3" /> + <option name="VARIABLE_ANNOTATION_WRAP" value="2" /> + <indentOptions> + <option name="INDENT_SIZE" value="3" /> + <option name="CONTINUATION_INDENT_SIZE" value="3" /> + <option name="TAB_SIZE" value="3" /> + <option name="LABEL_INDENT_SIZE" value="-3" /> + </indentOptions> + </codeStyleSettings> + <codeStyleSettings language="XML"> + <indentOptions> + <option name="INDENT_SIZE" value="3" /> + <option name="TAB_SIZE" value="3" /> + </indentOptions> + </codeStyleSettings> +</code_scheme> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/etc/ide-settings/idea/artemis-inspections.xml ---------------------------------------------------------------------- diff --git a/etc/ide-settings/idea/artemis-inspections.xml b/etc/ide-settings/idea/artemis-inspections.xml new file mode 100644 index 0000000..c6ec80b --- /dev/null +++ b/etc/ide-settings/idea/artemis-inspections.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inspections version="1.0"> + <option name="myName" value="Artemis" /> + <inspection_tool class="MissingOverrideAnnotation" enabled="true" level="ERROR" enabled_by_default="true"> + <option name="ignoreObjectMethods" value="false" /> + <option name="ignoreAnonymousClassMethods" value="false" /> + </inspection_tool> +</inspections> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java b/examples/features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java index af98901..ba96e56 100644 --- a/examples/features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java +++ b/examples/features/clustered/client-side-load-balancing/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideLoadBalancingExample.java @@ -16,8 +16,6 @@ */ package org.apache.activemq.artemis.jms.example; -import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal; - import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.JMSException; @@ -28,6 +26,8 @@ import javax.jms.Session; import javax.jms.TextMessage; import javax.naming.InitialContext; +import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal; + /** * This example demonstrates how sessions created from a single connection can be load * balanced across the different nodes of the cluster. @@ -70,8 +70,8 @@ public class ClientSideLoadBalancingExample { Session sessionC = connectionC.createSession(false, Session.AUTO_ACKNOWLEDGE); System.out.println("Session A - " + ((ClientSessionInternal) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionA).getCoreSession()).getConnection().getRemoteAddress()); - System.out.println("Session B - " + ((ClientSessionInternal)((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionB).getCoreSession()).getConnection().getRemoteAddress()); - System.out.println("Session C - " + ((ClientSessionInternal)((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionC).getCoreSession()).getConnection().getRemoteAddress()); + System.out.println("Session B - " + ((ClientSessionInternal) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionB).getCoreSession()).getConnection().getRemoteAddress()); + System.out.println("Session C - " + ((ClientSessionInternal) ((org.apache.activemq.artemis.jms.client.ActiveMQSession) sessionC).getCoreSession()).getConnection().getRemoteAddress()); // Step 6. We create JMS MessageProducer objects on the sessions MessageProducer producerA = sessionA.createProducer(queue); @@ -107,8 +107,7 @@ public class ClientSideLoadBalancingExample { consume(sessionA, queue, numMessages, "A"); consume(sessionB, queue, numMessages, "B"); consume(sessionC, queue, numMessages, "C"); - } - finally { + } finally { // Step 10. Be sure to close our resources! if (connectionA != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java b/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java index 6af9577..7935ce5 100644 --- a/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java +++ b/examples/features/clustered/clustered-durable-subscription/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredDurableSubscriptionExample.java @@ -115,8 +115,7 @@ public class ClusteredDurableSubscriptionExample { System.out.println("Got message: " + message1.getText() + " from node 1"); } - } - finally { + } finally { // Step 15. Be sure to close our JMS resources! if (connection0 != null) { connection0.close(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java b/examples/features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java index dfadef5..5d01f08 100644 --- a/examples/features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java +++ b/examples/features/clustered/clustered-grouping/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredGroupingExample.java @@ -133,8 +133,7 @@ public class ClusteredGroupingExample { System.out.println("Got message: " + message0.getText() + " from node 0"); } - } - finally { + } finally { // Step 17. Be sure to close our resources! if (connection0 != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java b/examples/features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java index 5f956b5..1c0cbbb 100644 --- a/examples/features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java +++ b/examples/features/clustered/clustered-jgroups/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredJgroupsExample.java @@ -116,8 +116,7 @@ public class ClusteredJgroupsExample { System.out.println("Got message: " + message1.getText() + " from node 1"); } - } - finally { + } finally { // Step 15. Be sure to close our resources! if (connection0 != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java b/examples/features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java index f92514b..7fe989b 100644 --- a/examples/features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java +++ b/examples/features/clustered/clustered-queue/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredQueueExample.java @@ -101,8 +101,7 @@ public class ClusteredQueueExample { System.out.println("Got message: " + message1.getText() + " from node 1"); } - } - finally { + } finally { // Step 15. Be sure to close our resources! if (connection0 != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/clustered-static-discovery-uri/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/clustered-static-discovery-uri/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java b/examples/features/clustered/clustered-static-discovery-uri/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java index 453fafc..6e649ce 100644 --- a/examples/features/clustered/clustered-static-discovery-uri/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java +++ b/examples/features/clustered/clustered-static-discovery-uri/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java @@ -145,8 +145,7 @@ public class StaticClusteredQueueExample { System.out.println("Got message: " + message3.getText() + " from node " + con3Node); } - } - finally { + } finally { // Step 15. Be sure to close our resources! if (initialConnection != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java b/examples/features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java index 170d1d3..7e732dd 100644 --- a/examples/features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java +++ b/examples/features/clustered/clustered-static-discovery/src/main/java/org/apache/activemq/artemis/jms/example/StaticClusteredQueueExample.java @@ -145,8 +145,7 @@ public class StaticClusteredQueueExample { System.out.println("Got message: " + message3.getText() + " from node " + con3Node); } - } - finally { + } finally { // Step 15. Be sure to close our resources! if (initialConnection != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java b/examples/features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java index 0397907..b8eddaa 100644 --- a/examples/features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java +++ b/examples/features/clustered/clustered-static-oneway/src/main/java/org/apache/activemq/artemis/jms/example/ClusterStaticOnewayExample.java @@ -135,8 +135,7 @@ public class ClusterStaticOnewayExample { System.out.println("Got message: " + message2.getText() + " from node " + con2Node); } - } - finally { + } finally { // Step 15. Be sure to close our resources! if (initialConnection != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/clustered-topic-uri/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/clustered-topic-uri/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java b/examples/features/clustered/clustered-topic-uri/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java index 10592c9..cca45b8 100644 --- a/examples/features/clustered/clustered-topic-uri/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java +++ b/examples/features/clustered/clustered-topic-uri/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java @@ -101,8 +101,7 @@ public class ClusteredTopicExample { System.out.println("Got message: " + message1.getText() + " from node 1"); } - } - finally { + } finally { // Step 15. Be sure to close our JMS resources! if (connection0 != null) { connection0.close(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java b/examples/features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java index 10592c9..cca45b8 100644 --- a/examples/features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java +++ b/examples/features/clustered/clustered-topic/src/main/java/org/apache/activemq/artemis/jms/example/ClusteredTopicExample.java @@ -101,8 +101,7 @@ public class ClusteredTopicExample { System.out.println("Got message: " + message1.getText() + " from node 1"); } - } - finally { + } finally { // Step 15. Be sure to close our JMS resources! if (connection0 != null) { connection0.close(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java b/examples/features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java index b3c056b..bc0ec2a 100644 --- a/examples/features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java +++ b/examples/features/clustered/queue-message-redistribution/src/main/java/org/apache/activemq/artemis/jms/example/QueueMessageRedistributionExample.java @@ -129,8 +129,7 @@ public class QueueMessageRedistributionExample { // Step 18. We ack the messages. message0.acknowledge(); - } - finally { + } finally { // Step 18. Be sure to close our resources! if (connection0 != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java ---------------------------------------------------------------------- diff --git a/examples/features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java b/examples/features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java index 1163ec8..1e3ea2b 100644 --- a/examples/features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java +++ b/examples/features/clustered/symmetric-cluster/src/main/java/org/apache/activemq/artemis/jms/example/SymmetricClusterExample.java @@ -207,8 +207,7 @@ public class SymmetricClusterExample { throw new IllegalStateException("Message is null!"); } } - } - finally { + } finally { // Step 15. Be sure to close our resources! connection0.close(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java ---------------------------------------------------------------------- diff --git a/examples/features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java b/examples/features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java index d4ab658..1d8d3a7 100644 --- a/examples/features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java +++ b/examples/features/ha/application-layer-failover/src/main/java/org/apache/activemq/artemis/jms/example/ApplicationLayerFailoverExample.java @@ -119,11 +119,9 @@ public class ApplicationLayerFailoverExample { System.out.println("Got message: " + message0.getText()); } - } - catch (Throwable t) { + } catch (Throwable t) { t.printStackTrace(); - } - finally { + } finally { // Step 14. Be sure to close our resources! closeResources(); ServerUtil.killServer(server0); @@ -158,8 +156,7 @@ public class ApplicationLayerFailoverExample { if (initialContext != null) { try { initialContext.close(); - } - catch (NamingException e) { + } catch (NamingException e) { e.printStackTrace(); } } @@ -167,8 +164,7 @@ public class ApplicationLayerFailoverExample { if (connection != null) { try { connection.close(); - } - catch (JMSException e) { + } catch (JMSException e) { e.printStackTrace(); } } @@ -180,8 +176,7 @@ public class ApplicationLayerFailoverExample { public void onException(final JMSException exception) { try { connection.close(); - } - catch (JMSException e) { + } catch (JMSException e) { //ignore } for (int i = 0; i < 10; i++) { @@ -205,13 +200,11 @@ public class ApplicationLayerFailoverExample { failoverLatch.countDown(); return; - } - catch (Exception e) { + } catch (Exception e) { System.out.println("Failed to handle failover, trying again."); try { Thread.sleep(500); - } - catch (InterruptedException e1) { + } catch (InterruptedException e1) { //ignored } } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java ---------------------------------------------------------------------- diff --git a/examples/features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java b/examples/features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java index 335da0d..6f430c1 100644 --- a/examples/features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java +++ b/examples/features/ha/client-side-failoverlistener/src/main/java/org/apache/activemq/artemis/jms/example/ClientSideFailoverListerExample.java @@ -16,11 +16,6 @@ */ package org.apache.activemq.artemis.jms.example; -import org.apache.activemq.artemis.api.core.client.FailoverEventListener; -import org.apache.activemq.artemis.api.core.client.FailoverEventType; -import org.apache.activemq.artemis.jms.client.ActiveMQConnection; -import org.apache.activemq.artemis.util.ServerUtil; - import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.MessageConsumer; @@ -30,6 +25,11 @@ import javax.jms.Session; import javax.jms.TextMessage; import javax.naming.InitialContext; +import org.apache.activemq.artemis.api.core.client.FailoverEventListener; +import org.apache.activemq.artemis.api.core.client.FailoverEventType; +import org.apache.activemq.artemis.jms.client.ActiveMQConnection; +import org.apache.activemq.artemis.util.ServerUtil; + /** * This example demonstrates how you can listen on failover event on the client side * <p/> @@ -88,8 +88,7 @@ public class ClientSideFailoverListerExample { // Step 9. We consume messages from the session A, one at a time. // We reached message no 5 the first server will crash consume(sessionA, queue, numMessages, "A"); - } - finally { + } finally { // Step 10. Be sure to close our resources! if (connectionA != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java ---------------------------------------------------------------------- diff --git a/examples/features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java b/examples/features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java index ee592f9..43521a5 100644 --- a/examples/features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java +++ b/examples/features/ha/colocated-failover-scale-down/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverScaleDownExample.java @@ -116,8 +116,7 @@ public class ColocatedFailoverScaleDownExample { System.out.println("Got message: " + message0.getText()); } message0.acknowledge(); - } - finally { + } finally { // Step 11. Be sure to close our resources! if (connection != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java ---------------------------------------------------------------------- diff --git a/examples/features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java b/examples/features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java index 5bf32f5..e2b24c0 100644 --- a/examples/features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java +++ b/examples/features/ha/colocated-failover/src/main/java/org/apache/activemq/artemis/jms/example/ColocatedFailoverExample.java @@ -123,8 +123,7 @@ public class ColocatedFailoverExample { System.out.println("Got message: " + message0.getText()); } message0.acknowledge(); - } - finally { + } finally { // Step 11. Be sure to close our resources! if (connection != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java ---------------------------------------------------------------------- diff --git a/examples/features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java b/examples/features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java index d2b8d95..dcbbbda 100644 --- a/examples/features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java +++ b/examples/features/ha/ha-policy-autobackup/src/main/java/org/apache/activemq/artemis/jms/example/HAPolicyAutoBackupExample.java @@ -116,8 +116,7 @@ public class HAPolicyAutoBackupExample { System.out.println("Got message: " + message0.getText() + " from node 1"); } - } - finally { + } finally { // Step 17. Be sure to close our resources! if (connection0 != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java ---------------------------------------------------------------------- diff --git a/examples/features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java b/examples/features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java index ab0baec..848243e 100644 --- a/examples/features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java +++ b/examples/features/ha/multiple-failover-failback/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverFailbackExample.java @@ -16,8 +16,6 @@ */ package org.apache.activemq.artemis.jms.example; -import org.apache.activemq.artemis.util.ServerUtil; - import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.JMSException; @@ -28,6 +26,8 @@ import javax.jms.Session; import javax.jms.TextMessage; import javax.naming.InitialContext; +import org.apache.activemq.artemis.util.ServerUtil; + public class MultipleFailoverFailbackExample { public static void main(final String[] args) throws Exception { @@ -93,8 +93,7 @@ public class MultipleFailoverFailbackExample { // backup server has occurred try { message0.acknowledge(); - } - catch (JMSException e) { + } catch (JMSException e) { System.err.println("Got exception while acknowledging message: " + e.getMessage()); } @@ -111,8 +110,7 @@ public class MultipleFailoverFailbackExample { // backup server has occurred try { message0.acknowledge(); - } - catch (JMSException e) { + } catch (JMSException e) { System.err.println("Got exception while acknowledging message: " + e.getMessage()); } @@ -122,8 +120,7 @@ public class MultipleFailoverFailbackExample { System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered()); } message0.acknowledge(); - } - finally { + } finally { // Step 13. Be sure to close our resources! if (connection != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java ---------------------------------------------------------------------- diff --git a/examples/features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java b/examples/features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java index 41d9e52..071930e 100644 --- a/examples/features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java +++ b/examples/features/ha/multiple-failover/src/main/java/org/apache/activemq/artemis/jms/example/MultipleFailoverExample.java @@ -16,8 +16,6 @@ */ package org.apache.activemq.artemis.jms.example; -import org.apache.activemq.artemis.util.ServerUtil; - import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.JMSException; @@ -28,6 +26,8 @@ import javax.jms.Session; import javax.jms.TextMessage; import javax.naming.InitialContext; +import org.apache.activemq.artemis.util.ServerUtil; + public class MultipleFailoverExample { public static void main(final String[] args) throws Exception { @@ -93,8 +93,7 @@ public class MultipleFailoverExample { // backup server has occurred try { message0.acknowledge(); - } - catch (JMSException e) { + } catch (JMSException e) { System.err.println("Got exception while acknowledging message: " + e.getMessage()); } @@ -111,8 +110,7 @@ public class MultipleFailoverExample { // backup server has occurred try { message0.acknowledge(); - } - catch (JMSException e) { + } catch (JMSException e) { throw new IllegalStateException("Got exception while acknowledging message: " + e.getMessage()); } @@ -122,8 +120,7 @@ public class MultipleFailoverExample { System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered()); } message0.acknowledge(); - } - finally { + } finally { // Step 13. Be sure to close our resources! if (connection != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java ---------------------------------------------------------------------- diff --git a/examples/features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java b/examples/features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java index 9352ac5..3957316 100644 --- a/examples/features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java +++ b/examples/features/ha/non-transaction-failover/src/main/java/org/apache/activemq/artemis/jms/example/NonTransactionFailoverExample.java @@ -16,8 +16,6 @@ */ package org.apache.activemq.artemis.jms.example; -import org.apache.activemq.artemis.util.ServerUtil; - import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.JMSException; @@ -28,6 +26,8 @@ import javax.jms.Session; import javax.jms.TextMessage; import javax.naming.InitialContext; +import org.apache.activemq.artemis.util.ServerUtil; + /** * A simple example that demonstrates failover of the JMS connection from one node to another * when the live server crashes using a JMS <em>non-transacted</em> session. @@ -97,8 +97,7 @@ public class NonTransactionFailoverExample { // backup server has occurred try { message0.acknowledge(); - } - catch (JMSException e) { + } catch (JMSException e) { System.err.println("Got exception while acknowledging message: " + e.getMessage()); } @@ -108,8 +107,7 @@ public class NonTransactionFailoverExample { System.out.printf("Got message: %s (redelivered?: %s)%n", message0.getText(), message0.getJMSRedelivered()); } message0.acknowledge(); - } - finally { + } finally { // Step 13. Be sure to close our resources! if (connection != null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ec48f9ed/examples/features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java ---------------------------------------------------------------------- diff --git a/examples/features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java b/examples/features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java index d2f74ba..b3bd466 100644 --- a/examples/features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java +++ b/examples/features/ha/replicated-failback-static/src/main/java/org/apache/activemq/artemis/jms/example/ReplicatedFailbackStaticExample.java @@ -16,8 +16,6 @@ */ package org.apache.activemq.artemis.jms.example; -import org.apache.activemq.artemis.util.ServerUtil; - import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.JMSException; @@ -28,6 +26,8 @@ import javax.jms.Session; import javax.jms.TextMessage; import javax.naming.InitialContext; +import org.apache.activemq.artemis.util.ServerUtil; + /** * Example of live and replicating backup pair. * <p> @@ -101,8 +101,7 @@ public class ReplicatedFailbackStaticExample { // backup server has occurred try { message0.acknowledge(); - } - catch (JMSException e) { + } catch (JMSException e) { System.out.println("Got (the expected) exception while acknowledging message: " + e.getMessage()); } @@ -119,8 +118,7 @@ public class ReplicatedFailbackStaticExample { // backup server has occurred try { message0.acknowledge(); - } - catch (JMSException e) { + } catch (JMSException e) { System.err.println("Got exception while acknowledging message: " + e.getMessage()); } @@ -130,8 +128,7 @@ public class ReplicatedFailbackStaticExample { System.out.printf("Got message: %s (redelivered?: %s)\n", message0.getText(), message0.getJMSRedelivered()); } message0.acknowledge(); - } - finally { + } finally { // Step 13. Be sure to close our resources! if (connection != null) {
