Fix some compile warnings (#2919)
* Fix some compile warnings * Some classes made final * JPA entities made not serializable Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -25,7 +25,7 @@ import org.springframework.amqp.core.Message;
|
||||
/**
|
||||
* An in-memory simulated DMF Tenant to hold the controller twins in memory and be able to retrieve them again.
|
||||
*/
|
||||
public class DmfTenant {
|
||||
public final class DmfTenant {
|
||||
|
||||
@Getter
|
||||
private final Tenant tenant;
|
||||
@@ -39,8 +39,8 @@ public class DmfTenant {
|
||||
|
||||
public DmfTenant(final Tenant tenant, final Amqp amqp, final boolean initVHost) {
|
||||
this.tenant = tenant;
|
||||
this.vHost = amqp.getVhost(tenant.getDmf(), initVHost);
|
||||
this.vHost.register(this);
|
||||
vHost = amqp.getVhost(tenant.getDmf(), initVHost);
|
||||
vHost.register(this);
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
|
||||
@@ -46,7 +46,7 @@ import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
* Abstract class for sender and receiver service.
|
||||
*/
|
||||
@Slf4j
|
||||
public class VHost extends DmfSender implements MessageListener {
|
||||
public final class VHost extends DmfSender implements MessageListener {
|
||||
|
||||
private static final String REGEX_EXTRACT_ACTION_ID = "[^0-9]";
|
||||
|
||||
@@ -54,19 +54,12 @@ public class VHost extends DmfSender implements MessageListener {
|
||||
private final ConcurrentHashMap<String, DmfTenant> dmfTenants = new ConcurrentHashMap<>();
|
||||
private final Set<Long> openActions = Collections.synchronizedSet(new HashSet<>());
|
||||
|
||||
public VHost(final ConnectionFactory connectionFactory, final AmqpProperties amqpProperties) {
|
||||
this(connectionFactory, amqpProperties, true);
|
||||
}
|
||||
|
||||
public VHost(final ConnectionFactory connectionFactory, final AmqpProperties amqpProperties, final boolean initVHost) {
|
||||
super(new RabbitTemplate(connectionFactory), amqpProperties);
|
||||
|
||||
// It is necessary to define rabbitTemplate as a Bean and set
|
||||
// Jackson2JsonMessageConverter explicitly here in order to convert only
|
||||
// OUTCOMING messages to json. In case of INCOMING messages,
|
||||
// Jackson2JsonMessageConverter can not handle messages with NULL
|
||||
// payload (e.g. REQUEST_ATTRIBUTES_UPDATE), so the
|
||||
// SimpleMessageConverter is used instead per default.
|
||||
// It is necessary to define rabbitTemplate as a Bean and set Jackson2JsonMessageConverter explicitly here in order to convert only
|
||||
// OUTCOMING messages to JSON. In case of INCOMING messages, Jackson2JsonMessageConverter can not handle messages with NULL
|
||||
// payload (e.g. REQUEST_ATTRIBUTES_UPDATE), so the SimpleMessageConverter is used instead per default.
|
||||
rabbitTemplate.setMessageConverter(new Jackson2JsonMessageConverter());
|
||||
|
||||
if (initVHost) {
|
||||
|
||||
Reference in New Issue
Block a user