You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/03/14 13:50:47 UTC

[1/2] camel git commit: Camel-Hazelcast: Removed deprecated code

Repository: camel
Updated Branches:
  refs/heads/master 0d5803b97 -> b537350cb


Camel-Hazelcast: Removed deprecated code


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/91ecb0db
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/91ecb0db
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/91ecb0db

Branch: refs/heads/master
Commit: 91ecb0db638e68f3542628b1c1892425f7cc41f7
Parents: 0d5803b
Author: Andrea Cosentino <an...@gmail.com>
Authored: Tue Mar 14 14:48:59 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Tue Mar 14 14:48:59 2017 +0100

----------------------------------------------------------------------
 .../component/hazelcast/HazelcastComponent.java | 32 ++++++++++----------
 1 file changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/91ecb0db/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java
index c25e5fd..2e667bb 100644
--- a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java
+++ b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java
@@ -42,10 +42,11 @@ import org.apache.camel.component.hazelcast.seda.HazelcastSedaConfiguration;
 import org.apache.camel.component.hazelcast.seda.HazelcastSedaEndpoint;
 import org.apache.camel.component.hazelcast.set.HazelcastSetEndpoint;
 import org.apache.camel.component.hazelcast.topic.HazelcastTopicEndpoint;
-import org.apache.camel.impl.UriEndpointComponent;
+import org.apache.camel.impl.DefaultComponent;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ResourceHelper;
+import org.apache.camel.util.StringHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -53,9 +54,8 @@ import static org.apache.camel.component.hazelcast.HazelcastConstants.HAZELCAST_
 import static org.apache.camel.component.hazelcast.HazelcastConstants.HAZELCAST_CONFIGU_URI_PARAM;
 import static org.apache.camel.component.hazelcast.HazelcastConstants.HAZELCAST_INSTANCE_NAME_PARAM;
 import static org.apache.camel.component.hazelcast.HazelcastConstants.HAZELCAST_INSTANCE_PARAM;
-import static org.apache.camel.util.ObjectHelper.removeStartingCharacters;
 
-public class HazelcastComponent extends UriEndpointComponent {
+public class HazelcastComponent extends DefaultComponent {
     private static final Logger LOGGER = LoggerFactory.getLogger(HazelcastComponent.class);
 
     private final Set<HazelcastInstance> customHazelcastInstances;
@@ -65,12 +65,12 @@ public class HazelcastComponent extends UriEndpointComponent {
     private String hazelcastMode = HazelcastConstants.HAZELCAST_NODE_MODE;
 
     public HazelcastComponent() {
-        super(HazelcastDefaultEndpoint.class);
+        super();
         this.customHazelcastInstances = new LinkedHashSet<>();
     }
 
     public HazelcastComponent(final CamelContext context) {
-        super(context, HazelcastDefaultEndpoint.class);
+        super(context);
         this.customHazelcastInstances = new LinkedHashSet<>();
     }
 
@@ -95,49 +95,49 @@ public class HazelcastComponent extends UriEndpointComponent {
         // check type of endpoint
         if (remaining.startsWith(HazelcastConstants.MAP_PREFIX)) {
             // remaining is the cache name
-            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.MAP_PREFIX.length()), '/');
+            remaining = StringHelper.removeStartingCharacters(remaining.substring(HazelcastConstants.MAP_PREFIX.length()), '/');
             endpoint = new HazelcastMapEndpoint(hzInstance, uri, remaining, this);
             endpoint.setCommand(HazelcastCommand.map);
         }
 
         if (remaining.startsWith(HazelcastConstants.MULTIMAP_PREFIX)) {
             // remaining is the cache name
-            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.MULTIMAP_PREFIX.length()), '/');
+            remaining = StringHelper.removeStartingCharacters(remaining.substring(HazelcastConstants.MULTIMAP_PREFIX.length()), '/');
             endpoint = new HazelcastMultimapEndpoint(hzInstance, uri, remaining, this);
             endpoint.setCommand(HazelcastCommand.multimap);
         }
 
         if (remaining.startsWith(HazelcastConstants.ATOMICNUMBER_PREFIX)) {
             // remaining is the name of the atomic value
-            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.ATOMICNUMBER_PREFIX.length()), '/');
+            remaining = StringHelper.removeStartingCharacters(remaining.substring(HazelcastConstants.ATOMICNUMBER_PREFIX.length()), '/');
             endpoint = new HazelcastAtomicnumberEndpoint(hzInstance, uri, this, remaining);
             endpoint.setCommand(HazelcastCommand.atomicvalue);
         }
 
         if (remaining.startsWith(HazelcastConstants.INSTANCE_PREFIX)) {
             // remaining is anything (name it foo ;)
-            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.INSTANCE_PREFIX.length()), '/');
+            remaining = StringHelper.removeStartingCharacters(remaining.substring(HazelcastConstants.INSTANCE_PREFIX.length()), '/');
             endpoint = new HazelcastInstanceEndpoint(hzInstance, uri, this);
             endpoint.setCommand(HazelcastCommand.instance);
         }
 
         if (remaining.startsWith(HazelcastConstants.QUEUE_PREFIX)) {
             // remaining is anything (name it foo ;)
-            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.QUEUE_PREFIX.length()), '/');
+            remaining = StringHelper.removeStartingCharacters(remaining.substring(HazelcastConstants.QUEUE_PREFIX.length()), '/');
             endpoint = new HazelcastQueueEndpoint(hzInstance, uri, this, remaining);
             endpoint.setCommand(HazelcastCommand.queue);
         }
 
         if (remaining.startsWith(HazelcastConstants.TOPIC_PREFIX)) {
             // remaining is anything (name it foo ;)
-            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.TOPIC_PREFIX.length()), '/');
+            remaining = StringHelper.removeStartingCharacters(remaining.substring(HazelcastConstants.TOPIC_PREFIX.length()), '/');
             endpoint = new HazelcastTopicEndpoint(hzInstance, uri, this, remaining);
             endpoint.setCommand(HazelcastCommand.topic);
         }
 
         if (remaining.startsWith(HazelcastConstants.SEDA_PREFIX)) {
             // remaining is anything (name it foo ;)
-            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.SEDA_PREFIX.length()), '/');
+            remaining = StringHelper.removeStartingCharacters(remaining.substring(HazelcastConstants.SEDA_PREFIX.length()), '/');
             final HazelcastSedaConfiguration config = new HazelcastSedaConfiguration();
             setProperties(config, parameters);
             config.setQueueName(remaining);
@@ -148,21 +148,21 @@ public class HazelcastComponent extends UriEndpointComponent {
 
         if (remaining.startsWith(HazelcastConstants.LIST_PREFIX)) {
             // remaining is anything (name it foo ;)
-            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.LIST_PREFIX.length()), '/');
+            remaining = StringHelper.removeStartingCharacters(remaining.substring(HazelcastConstants.LIST_PREFIX.length()), '/');
             endpoint = new HazelcastListEndpoint(hzInstance, uri, this, remaining);
             endpoint.setCommand(HazelcastCommand.list);
         }
 
         if (remaining.startsWith(HazelcastConstants.REPLICATEDMAP_PREFIX)) {
             // remaining is anything (name it foo ;)
-            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.REPLICATEDMAP_PREFIX.length()), '/');
+            remaining = StringHelper.removeStartingCharacters(remaining.substring(HazelcastConstants.REPLICATEDMAP_PREFIX.length()), '/');
             endpoint = new HazelcastReplicatedmapEndpoint(hzInstance, uri, remaining, this);
             endpoint.setCommand(HazelcastCommand.replicatedmap);
         } 
         
         if (remaining.startsWith(HazelcastConstants.SET_PREFIX)) {
             // remaining is anything (name it foo ;)
-            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.SET_PREFIX.length()), '/');
+            remaining = StringHelper.removeStartingCharacters(remaining.substring(HazelcastConstants.SET_PREFIX.length()), '/');
             endpoint = new HazelcastSetEndpoint(hzInstance, uri, this, remaining);
             endpoint.setCommand(HazelcastCommand.set);
         } 
@@ -170,7 +170,7 @@ public class HazelcastComponent extends UriEndpointComponent {
         
         if (remaining.startsWith(HazelcastConstants.RINGBUFFER_PREFIX)) {
             // remaining is anything (name it foo ;)
-            remaining = removeStartingCharacters(remaining.substring(HazelcastConstants.RINGBUFFER_PREFIX.length()), '/');
+            remaining = StringHelper.removeStartingCharacters(remaining.substring(HazelcastConstants.RINGBUFFER_PREFIX.length()), '/');
             endpoint = new HazelcastRingbufferEndpoint(hzInstance, uri, this, remaining);
             endpoint.setCommand(HazelcastCommand.ringbuffer);
         } 


[2/2] camel git commit: Camel-Hazelcast: Removed deprecated code

Posted by ac...@apache.org.
Camel-Hazelcast: Removed deprecated code


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

Branch: refs/heads/master
Commit: b537350cb941b664eff9a4ebd5315c622e9bef55
Parents: 91ecb0d
Author: Andrea Cosentino <an...@gmail.com>
Authored: Tue Mar 14 14:50:10 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Tue Mar 14 14:50:10 2017 +0100

----------------------------------------------------------------------
 .../aggregate/hazelcast/HazelcastAggregationRepository.java     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b537350c/components/camel-hazelcast/src/main/java/org/apache/camel/processor/aggregate/hazelcast/HazelcastAggregationRepository.java
----------------------------------------------------------------------
diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/processor/aggregate/hazelcast/HazelcastAggregationRepository.java b/components/camel-hazelcast/src/main/java/org/apache/camel/processor/aggregate/hazelcast/HazelcastAggregationRepository.java
index 309aee5..e84f0f6 100644
--- a/components/camel-hazelcast/src/main/java/org/apache/camel/processor/aggregate/hazelcast/HazelcastAggregationRepository.java
+++ b/components/camel-hazelcast/src/main/java/org/apache/camel/processor/aggregate/hazelcast/HazelcastAggregationRepository.java
@@ -38,6 +38,7 @@ import org.apache.camel.spi.OptimisticLockingAggregationRepository;
 import org.apache.camel.spi.RecoverableAggregationRepository;
 import org.apache.camel.support.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.StringHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -345,7 +346,7 @@ public class HazelcastAggregationRepository extends ServiceSupport
                 // if no commit occurs during the timeout. So we are still consistent whether local node crashes.
                 TransactionOptions tOpts = new TransactionOptions();
 
-                tOpts.setTransactionType(TransactionOptions.TransactionType.LOCAL);
+                tOpts.setTransactionType(TransactionOptions.TransactionType.ONE_PHASE);
                 TransactionContext tCtx = hzInstance.newTransactionContext(tOpts);
 
                 try {
@@ -405,7 +406,7 @@ public class HazelcastAggregationRepository extends ServiceSupport
         if (recoveryInterval < 0) {
             throw new IllegalArgumentException("Recovery interval must be zero or a positive integer.");
         }
-        ObjectHelper.notEmpty(mapName, "repositoryName");
+        StringHelper.notEmpty(mapName, "repositoryName");
         if (useLocalHzInstance)  {
             Config cfg = new XmlConfigBuilder().build();
             cfg.setProperty("hazelcast.version.check.enabled", "false");