Add Nullability support into Java DSL
This commit is contained in:
@@ -55,7 +55,9 @@ public final class Jms {
|
||||
*/
|
||||
public static JmsPollableMessageChannelSpec<?, PollableJmsChannel> pollableChannel(@Nullable String id,
|
||||
ConnectionFactory connectionFactory) {
|
||||
JmsPollableMessageChannelSpec<?, PollableJmsChannel> spec = new JmsPollableMessageChannelSpec<>(connectionFactory);
|
||||
|
||||
JmsPollableMessageChannelSpec<?, PollableJmsChannel> spec =
|
||||
new JmsPollableMessageChannelSpec<>(connectionFactory);
|
||||
return spec.id(id);
|
||||
}
|
||||
|
||||
@@ -166,14 +168,9 @@ public final class Jms {
|
||||
public static JmsInboundGatewaySpec.JmsInboundGatewayListenerContainerSpec<JmsDefaultListenerContainerSpec, DefaultMessageListenerContainer>
|
||||
inboundGateway(ConnectionFactory connectionFactory) {
|
||||
|
||||
try {
|
||||
return new JmsInboundGatewaySpec.JmsInboundGatewayListenerContainerSpec<>(
|
||||
new JmsDefaultListenerContainerSpec()
|
||||
.connectionFactory(connectionFactory));
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
return new JmsInboundGatewaySpec.JmsInboundGatewayListenerContainerSpec<>(
|
||||
new JmsDefaultListenerContainerSpec()
|
||||
.connectionFactory(connectionFactory));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,15 +186,10 @@ public final class Jms {
|
||||
JmsInboundGatewaySpec.JmsInboundGatewayListenerContainerSpec<?, C> inboundGateway(
|
||||
ConnectionFactory connectionFactory, Class<C> containerClass) {
|
||||
|
||||
try {
|
||||
JmsListenerContainerSpec<?, C> spec =
|
||||
new JmsListenerContainerSpec<>(containerClass)
|
||||
.connectionFactory(connectionFactory);
|
||||
return new JmsInboundGatewaySpec.JmsInboundGatewayListenerContainerSpec(spec);
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
JmsListenerContainerSpec<?, C> spec =
|
||||
new JmsListenerContainerSpec<>(containerClass)
|
||||
.connectionFactory(connectionFactory);
|
||||
return new JmsInboundGatewaySpec.JmsInboundGatewayListenerContainerSpec(spec);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2021 the original author or authors.
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,6 +21,7 @@ import jakarta.jms.ConnectionFactory;
|
||||
import org.springframework.integration.dsl.IntegrationComponentSpec;
|
||||
import org.springframework.jms.support.destination.DestinationResolver;
|
||||
import org.springframework.jms.support.destination.JmsDestinationAccessor;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* A base {@link IntegrationComponentSpec} for {@link JmsDestinationAccessor}s.
|
||||
@@ -45,7 +46,7 @@ public abstract class JmsDestinationAccessorSpec<S extends JmsDestinationAccesso
|
||||
}
|
||||
|
||||
@Override
|
||||
public S id(String id) { // NOSONAR - not useless, increases visibility
|
||||
public S id(@Nullable String id) { // NOSONAR - not useless, increases visibility
|
||||
return super.id(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/**
|
||||
* Provides JMS Component support for the Java DSL.
|
||||
*/
|
||||
@org.springframework.lang.NonNullApi
|
||||
@org.springframework.lang.NonNullFields
|
||||
package org.springframework.integration.jms.dsl;
|
||||
|
||||
Reference in New Issue
Block a user