activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [35/50] [abbrv] activemq-artemis git commit: Consolidate RoutingType impls
Date Mon, 07 Nov 2016 16:36:55 GMT
Consolidate RoutingType impls


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/b730828a
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/b730828a
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/b730828a

Branch: refs/heads/ARTEMIS-780
Commit: b730828af2669e5b7caf4567df18a5219809035d
Parents: a2a48df
Author: jbertram <jbertram@apache.com>
Authored: Fri Oct 21 10:51:29 2016 -0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Nov 7 11:28:07 2016 -0500

----------------------------------------------------------------------
 .../core/config/CoreAddressConfiguration.java   |  8 ++---
 .../core/persistence/AddressBindingInfo.java    |  4 +--
 .../codec/PersistentAddressBindingEncoding.java | 10 +++---
 .../artemis/core/server/impl/AddressInfo.java   | 33 ++++++++++++++++----
 .../core/config/impl/FileConfigurationTest.java |  7 ++---
 pom.xml                                         |  1 +
 6 files changed, 41 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b730828a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/CoreAddressConfiguration.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/CoreAddressConfiguration.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/CoreAddressConfiguration.java
index e01c398..6327f79 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/CoreAddressConfiguration.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/CoreAddressConfiguration.java
@@ -21,13 +21,13 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
-import org.apache.activemq.artemis.core.server.impl.AddressInfo.RoutingType;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 
 public class CoreAddressConfiguration implements Serializable {
 
    private String name = null;
 
-   private RoutingType routingType = null;
+   private AddressInfo.RoutingType routingType = null;
 
    private Integer defaultMaxConsumers = ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers();
 
@@ -47,11 +47,11 @@ public class CoreAddressConfiguration implements Serializable {
       return this;
    }
 
-   public RoutingType getRoutingType() {
+   public AddressInfo.RoutingType getRoutingType() {
       return routingType;
    }
 
-   public CoreAddressConfiguration setRoutingType(RoutingType routingType) {
+   public CoreAddressConfiguration setRoutingType(AddressInfo.RoutingType routingType) {
       this.routingType = routingType;
       return this;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b730828a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/AddressBindingInfo.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/AddressBindingInfo.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/AddressBindingInfo.java
index 4256774..83d37bc 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/AddressBindingInfo.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/AddressBindingInfo.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.core.persistence;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.core.persistence.impl.RoutingType;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 
 public interface AddressBindingInfo {
 
@@ -29,6 +29,6 @@ public interface AddressBindingInfo {
 
    SimpleString getUser();
 
-   RoutingType getRoutingType();
+   AddressInfo.RoutingType getRoutingType();
 
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b730828a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentAddressBindingEncoding.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentAddressBindingEncoding.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentAddressBindingEncoding.java
index 8aa54e4..9f47362 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentAddressBindingEncoding.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/codec/PersistentAddressBindingEncoding.java
@@ -20,7 +20,7 @@ import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.journal.EncodingSupport;
 import org.apache.activemq.artemis.core.persistence.AddressBindingInfo;
-import org.apache.activemq.artemis.core.persistence.impl.RoutingType;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.utils.DataConstants;
 
 public class PersistentAddressBindingEncoding implements EncodingSupport, AddressBindingInfo
{
@@ -33,7 +33,7 @@ public class PersistentAddressBindingEncoding implements EncodingSupport,
Addres
 
    public SimpleString user;
 
-   public RoutingType routingType;
+   public AddressInfo.RoutingType routingType;
 
    public PersistentAddressBindingEncoding() {
    }
@@ -55,7 +55,7 @@ public class PersistentAddressBindingEncoding implements EncodingSupport,
Addres
    public PersistentAddressBindingEncoding(final SimpleString name,
                                            final SimpleString user,
                                            final boolean autoCreated,
-                                           final RoutingType routingType) {
+                                           final AddressInfo.RoutingType routingType) {
       this.name = name;
       this.user = user;
       this.autoCreated = autoCreated;
@@ -87,7 +87,7 @@ public class PersistentAddressBindingEncoding implements EncodingSupport,
Addres
    }
 
    @Override
-   public RoutingType getRoutingType() {
+   public AddressInfo.RoutingType getRoutingType() {
       return routingType;
    }
 
@@ -109,7 +109,7 @@ public class PersistentAddressBindingEncoding implements EncodingSupport,
Addres
       }
 
       autoCreated = buffer.readBoolean();
-      routingType = RoutingType.getType(buffer.readByte());
+      routingType = AddressInfo.RoutingType.getType(buffer.readByte());
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b730828a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
----------------------------------------------------------------------
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 03c3fa0..4c6ec1f 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
@@ -16,18 +16,13 @@
  */
 package org.apache.activemq.artemis.core.server.impl;
 
-import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.SimpleString;
 
 public class AddressInfo {
 
-   public enum RoutingType {
-      MULTICAST, ANYCAST
-   }
-
    private final SimpleString name;
 
-   private RoutingType routingType = RoutingType.MULTICAST;
+   private RoutingType routingType = RoutingType.Multicast;
 
    private boolean defaultDeleteOnNoConsumers;
 
@@ -64,4 +59,30 @@ public class AddressInfo {
    public SimpleString getName() {
       return name;
    }
+
+   public enum RoutingType {
+      Multicast, Anycast;
+
+      public byte getType() {
+         switch (this) {
+            case Multicast:
+               return 0;
+            case Anycast:
+               return 1;
+            default:
+               return -1;
+         }
+      }
+
+      public static RoutingType getType(byte type) {
+         switch (type) {
+            case 0:
+               return Multicast;
+            case 1:
+               return Anycast;
+            default:
+               return null;
+         }
+      }
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b730828a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
index 33abc83..214070e 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java
@@ -52,9 +52,6 @@ import org.apache.activemq.artemis.core.settings.impl.SlowConsumerPolicy;
 import org.junit.Assert;
 import org.junit.Test;
 
-import static org.apache.activemq.artemis.core.server.impl.AddressInfo.RoutingType.ANYCAST;
-import static org.apache.activemq.artemis.core.server.impl.AddressInfo.RoutingType.MULTICAST;
-
 public class FileConfigurationTest extends ConfigurationImplTest {
 
    private final String fullConfigurationName = "ConfigurationTest-full-config.xml";
@@ -372,7 +369,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
       // Addr 1
       CoreAddressConfiguration addressConfiguration = conf.getAddressConfigurations().get(0);
       assertEquals("addr1", addressConfiguration.getName());
-      assertEquals(ANYCAST, addressConfiguration.getRoutingType());
+      assertEquals(AddressInfo.RoutingType.Anycast, addressConfiguration.getRoutingType());
       assertEquals(2, addressConfiguration.getQueueConfigurations().size());
 
       // Addr 1 Queue 1
@@ -398,7 +395,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
       // Addr 2
       addressConfiguration = conf.getAddressConfigurations().get(1);
       assertEquals("addr2", addressConfiguration.getName());
-      assertEquals(MULTICAST, addressConfiguration.getRoutingType());
+      assertEquals(AddressInfo.RoutingType.Multicast, addressConfiguration.getRoutingType());
       assertEquals(2, addressConfiguration.getQueueConfigurations().size());
 
       // Addr 2 Queue 1

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b730828a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7db3136..0c27716 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1255,6 +1255,7 @@
                   <exclude>docs/**/_book/</exclude>
                   <exclude>**/target/</exclude>
                   <exclude>**/META-INF/services/*</exclude>
+                  <exclude>**/META-INF/MANIFEST.MF</exclude>
                   <exclude>**/*.iml</exclude>
                   <exclude>**/*.jceks</exclude>
                   <exclude>**/*.jks</exclude>


Mime
View raw message