reduced empty collections. Fixed Ui eventbus memory leak.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
kaizimmerm
2016-09-20 13:40:51 +02:00
parent bacaed8482
commit 66297d7c27
92 changed files with 743 additions and 647 deletions

View File

@@ -9,7 +9,6 @@
package org.eclipse.hawkbit.amqp;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
@@ -47,6 +46,8 @@ import org.springframework.retry.backoff.ExponentialBackOffPolicy;
import org.springframework.retry.support.RetryTemplate;
import org.springframework.util.ErrorHandler;
import com.google.common.collect.Maps;
/**
* Spring configuration for AMQP 0.9 based DMF communication for indirect device
* integration.
@@ -306,7 +307,7 @@ public class AmqpConfiguration {
}
private static Map<String, Object> getTTLMaxArgsAuthenticationQueue() {
final Map<String, Object> args = new HashMap<>();
final Map<String, Object> args = Maps.newHashMapWithExpectedSize(2);
args.put("x-message-ttl", Duration.ofSeconds(30).toMillis());
args.put("x-max-length", 1_000);
return args;

View File

@@ -9,12 +9,13 @@
package org.eclipse.hawkbit.amqp;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
import org.springframework.amqp.core.Queue;
import org.springframework.boot.context.properties.ConfigurationProperties;
import com.google.common.collect.Maps;
/**
* Bean which holds the necessary properties for configuring the AMQP deadletter
* queue.
@@ -36,7 +37,7 @@ public class AmqpDeadletterProperties {
* @return map which holds the properties
*/
public Map<String, Object> getDeadLetterExchangeArgs(final String exchange) {
final Map<String, Object> args = new HashMap<>();
final Map<String, Object> args = Maps.newHashMapWithExpectedSize(1);
args.put("x-dead-letter-exchange", exchange);
return args;
}
@@ -53,7 +54,7 @@ public class AmqpDeadletterProperties {
}
private Map<String, Object> getTTLArgs() {
final Map<String, Object> args = new HashMap<>();
final Map<String, Object> args = Maps.newHashMapWithExpectedSize(1);
args.put("x-message-ttl", getTtl());
return args;
}