Skip to content

Commit 17e6a31

Browse files
ngocnhan-tran1996artembilan
authored andcommitted
GH-10083: Apply Nullability to some core support packages
Related to: #10083 This commit applies Nullability to `support.channel`, `support.context` and `support.converter` packages Implement `#getComponentType` Signed-off-by: Tran Ngoc Nhan <[email protected]>
1 parent 5ce4b1e commit 17e6a31

File tree

31 files changed

+124
-51
lines changed

31 files changed

+124
-51
lines changed

spring-integration-core/src/main/java/org/springframework/integration/channel/DefaultHeaderChannelRegistry.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ public void run() {
259259
}
260260
}
261261

262+
@Override
263+
public String getComponentType() {
264+
return "header-channel-registry";
265+
}
266+
262267
protected record MessageChannelWrapper(MessageChannel channel, long expireAt) {
263268

264269
}

spring-integration-core/src/main/java/org/springframework/integration/codec/CodecMessageConverter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,9 @@ public Message<?> toMessage(Object payload, @Nullable MessageHeaders headers) {
7777
}
7878
}
7979

80+
@Override
81+
public String getComponentType() {
82+
return "converter";
83+
}
84+
8085
}

spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationObjectSupport.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,6 @@ public void setComponentName(String componentName) {
138138
this.componentName = componentName;
139139
}
140140

141-
/**
142-
* Subclasses may implement this method to provide component type information.
143-
*/
144-
@Override
145-
@Nullable
146-
public String getComponentType() {
147-
return null;
148-
}
149-
150141
@Override
151142
public void setComponentSource(Object source) {
152143
this.beanSource = source;

spring-integration-core/src/main/java/org/springframework/integration/dsl/RouterSpec.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ else if (conversionService.canConvert(key.getClass(), String.class)) {
278278
}
279279
}
280280

281+
@Override
282+
public String getComponentType() {
283+
return "router-mapping-provider";
284+
}
285+
281286
}
282287

283288
}

spring-integration-core/src/main/java/org/springframework/integration/endpoint/EventDrivenConsumer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ public MessageHandler getHandler() {
7979
return this.handler;
8080
}
8181

82+
@Override
83+
public String getComponentType() {
84+
return "event-driven-consumer";
85+
}
86+
8287
@Override
8388
protected void doStart() {
8489
this.logComponentSubscriptionEvent(true);

spring-integration-core/src/main/java/org/springframework/integration/endpoint/MessageProducerSupport.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ public void setOutputChannelName(String outputChannelName) {
111111
return this.outputChannel;
112112
}
113113

114+
@Override
115+
public String getComponentType() {
116+
return "message-producer";
117+
}
118+
114119
public void setErrorChannel(MessageChannel errorChannel) {
115120
this.errorChannel = errorChannel;
116121
}

spring-integration-core/src/main/java/org/springframework/integration/endpoint/PollingConsumer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ protected boolean isReactive() {
126126
this.handler instanceof Subscriber;
127127
}
128128

129+
@Override
130+
public String getComponentType() {
131+
return "polling-consumer";
132+
}
133+
129134
@Override
130135
protected void doStart() {
131136
if (this.handler instanceof Lifecycle lifecycle) {

spring-integration-core/src/main/java/org/springframework/integration/endpoint/ReactiveStreamsConsumer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ public MessageHandler getHandler() {
163163
return this.handler;
164164
}
165165

166+
@Override
167+
public String getComponentType() {
168+
return "reactive-streams-consumer";
169+
}
170+
166171
@Override
167172
protected void onInit() {
168173
super.onInit();

spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,11 @@ public void destroy() {
10551055
this.gatewayMap.values().forEach(MethodInvocationGateway::destroy);
10561056
}
10571057

1058+
@Override
1059+
public String getComponentType() {
1060+
return "gateway-proxy-factory";
1061+
}
1062+
10581063
private static final class MethodInvocationGateway extends MessagingGatewaySupport {
10591064

10601065
private Expression receiveTimeoutExpression;

spring-integration-core/src/main/java/org/springframework/integration/handler/advice/AbstractRequestHandlerAdvice.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ public final Object invoke(final MethodInvocation invocation) throws Throwable {
7373
}
7474
}
7575

76+
@Override
77+
public String getComponentType() {
78+
return "advice";
79+
}
80+
7681
/**
7782
* Subclasses implement this method to apply behavior to the {@link MessageHandler}.
7883
* <p>

0 commit comments

Comments
 (0)