activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-1446 Use Contructor on TransformerConfiguration
Date Tue, 10 Oct 2017 19:26:15 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 3b24a3b74 -> c0e4fd42c


ARTEMIS-1446 Use Contructor on TransformerConfiguration


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

Branch: refs/heads/master
Commit: ea898332049fa6817db85d0a0b0be94b6cf4a67c
Parents: 3b24a3b
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Tue Oct 10 13:47:01 2017 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Oct 10 15:17:31 2017 -0400

----------------------------------------------------------------------
 .../artemis/core/config/TransformerConfiguration.java  | 13 +++----------
 .../core/deployers/impl/FileConfigurationParser.java   |  4 ++--
 .../management/impl/ActiveMQServerControlImpl.java     |  6 +++---
 .../tests/integration/cluster/bridge/BridgeTest.java   |  4 ++--
 .../integration/management/DivertControlTest.java      |  2 +-
 5 files changed, 11 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ea898332/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/TransformerConfiguration.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/TransformerConfiguration.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/TransformerConfiguration.java
index 17f2702..36c9960 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/TransformerConfiguration.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/TransformerConfiguration.java
@@ -24,25 +24,18 @@ public final class TransformerConfiguration implements Serializable {
 
    private static final long serialVersionUID = -1057244274380572226L;
 
-   private String className = null;
+   private final String className;
 
    private Map<String, String> properties = new HashMap<>();
 
-   public TransformerConfiguration() {
+   public TransformerConfiguration(String className) {
+      this.className = className;
    }
 
    public String getClassName() {
       return className;
    }
 
-   /**
-    * @param className the class name to set
-    */
-   public TransformerConfiguration setClassName(final String className) {
-      this.className = className;
-      return this;
-   }
-
    public Map<String, String> getProperties() {
       return properties;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ea898332/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
index def6b61..bf92840 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
@@ -1641,11 +1641,11 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
{
             properties.put(key, value);
          }
       }
-      return new TransformerConfiguration().setClassName(className).setProperties(properties);
+      return new TransformerConfiguration(className).setProperties(properties);
    }
 
    private TransformerConfiguration getTransformerConfiguration(final String transformerClassName)
{
-      return new TransformerConfiguration().setClassName(transformerClassName).setProperties(Collections.EMPTY_MAP);
+      return new TransformerConfiguration(transformerClassName).setProperties(Collections.EMPTY_MAP);
    }
 
    private void parseBridgeConfiguration(final Element brNode, final Configuration mainConfig)
throws Exception {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ea898332/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index 5a4b10e..08facbf 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -2294,7 +2294,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements
Active
 
       clearIO();
       try {
-         TransformerConfiguration transformerConfiguration = transformerClassName == null
? null : new TransformerConfiguration().setClassName(transformerClassName).setProperties(transformerProperties);
+         TransformerConfiguration transformerConfiguration = transformerClassName == null
? null : new TransformerConfiguration(transformerClassName).setProperties(transformerProperties);
          DivertConfiguration config = new DivertConfiguration().setName(name).setRoutingName(routingName).setAddress(address).setForwardingAddress(forwardingAddress).setExclusive(exclusive).setFilterString(filterString).setTransformerConfiguration(transformerConfiguration).setRoutingType(DivertConfigurationRoutingType.valueOf(routingType));
          server.deployDivert(config);
       } finally {
@@ -2439,7 +2439,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements
Active
       clearIO();
 
       try {
-         TransformerConfiguration transformerConfiguration = transformerClassName == null
? null : new TransformerConfiguration().setClassName(transformerClassName).setProperties(transformerProperties);
+         TransformerConfiguration transformerConfiguration = transformerClassName == null
? null : new TransformerConfiguration(transformerClassName).setProperties(transformerProperties);
          BridgeConfiguration config = new BridgeConfiguration().setName(name).setQueueName(queueName).setForwardingAddress(forwardingAddress).setFilterString(filterString).setTransformerConfiguration(transformerConfiguration).setClientFailureCheckPeriod(clientFailureCheckPeriod).setRetryInterval(retryInterval).setRetryIntervalMultiplier(retryIntervalMultiplier).setInitialConnectAttempts(initialConnectAttempts).setReconnectAttempts(reconnectAttempts).setUseDuplicateDetection(useDuplicateDetection).setConfirmationWindowSize(confirmationWindowSize).setProducerWindowSize(producerWindowSize).setHA(ha).setUser(user).setPassword(password);
 
          if (useDiscoveryGroup) {
@@ -2477,7 +2477,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements
Active
       clearIO();
 
       try {
-         TransformerConfiguration transformerConfiguration = transformerClassName == null
? null : new TransformerConfiguration().setClassName(transformerClassName);
+         TransformerConfiguration transformerConfiguration = transformerClassName == null
? null : new TransformerConfiguration(transformerClassName);
          BridgeConfiguration config = new BridgeConfiguration().setName(name).setQueueName(queueName).setForwardingAddress(forwardingAddress).setFilterString(filterString).setTransformerConfiguration(transformerConfiguration).setClientFailureCheckPeriod(clientFailureCheckPeriod).setRetryInterval(retryInterval).setRetryIntervalMultiplier(retryIntervalMultiplier).setInitialConnectAttempts(initialConnectAttempts).setReconnectAttempts(reconnectAttempts).setUseDuplicateDetection(useDuplicateDetection).setConfirmationWindowSize(confirmationWindowSize).setHA(ha).setUser(user).setPassword(password);
 
          if (useDiscoveryGroup) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ea898332/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
index 88dff9b..3f7d1c6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
@@ -973,7 +973,7 @@ public class BridgeTest extends ActiveMQTestBase {
       ArrayList<String> staticConnectors = new ArrayList<>();
       staticConnectors.add(server1tc.getName());
 
-      BridgeConfiguration bridgeConfiguration = new BridgeConfiguration().setName("bridge1").setQueueName(queueName0).setForwardingAddress(forwardAddress).setTransformerConfiguration(new
TransformerConfiguration().setClassName(SimpleTransformer.class.getName())).setRetryInterval(1000).setReconnectAttemptsOnSameNode(-1).setUseDuplicateDetection(false).setConfirmationWindowSize(1024).setStaticConnectors(staticConnectors);
+      BridgeConfiguration bridgeConfiguration = new BridgeConfiguration().setName("bridge1").setQueueName(queueName0).setForwardingAddress(forwardAddress).setTransformerConfiguration(new
TransformerConfiguration(SimpleTransformer.class.getName())).setRetryInterval(1000).setReconnectAttemptsOnSameNode(-1).setUseDuplicateDetection(false).setConfirmationWindowSize(1024).setStaticConnectors(staticConnectors);
 
       List<BridgeConfiguration> bridgeConfigs = new ArrayList<>();
       bridgeConfigs.add(bridgeConfiguration);
@@ -1059,7 +1059,7 @@ public class BridgeTest extends ActiveMQTestBase {
       final String propValue = "true";
 
 
-      TransformerConfiguration transformerConfiguration = new TransformerConfiguration().setClassName(AddHeadersTransformer.class.getName());
+      TransformerConfiguration transformerConfiguration = new TransformerConfiguration(AddHeadersTransformer.class.getName());
       transformerConfiguration.getProperties().put(propKey, propValue);
 
       Map<String, Object> server0Params = new HashMap<>();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ea898332/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlTest.java
index 6483ced..749f626 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/DivertControlTest.java
@@ -81,7 +81,7 @@ public class DivertControlTest extends ManagementTestBase {
       CoreQueueConfiguration forwardQueueConfig = new CoreQueueConfiguration().setAddress(RandomUtil.randomString()).setName(RandomUtil.randomString()).setDurable(false);
 
       divertConfig = new DivertConfiguration().setName(RandomUtil.randomString()).setRoutingName(RandomUtil.randomString()).setAddress(queueConfig.getAddress()).setForwardingAddress(forwardQueueConfig.getAddress()).setExclusive(RandomUtil.randomBoolean()).
-         setTransformerConfiguration(new TransformerConfiguration().setClassName(AddHeadersTransformer.class.getName()));
+         setTransformerConfiguration(new TransformerConfiguration(AddHeadersTransformer.class.getName()));
 
       TransportConfiguration connectorConfig = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
 


Mime
View raw message