Skip to content

Commit f4809aa

Browse files
artembilangaryrussell
authored andcommitted
INT-4424: No @inherited on method annotations
JIRA: https://jira.spring.io/browse/INT-4424 * Polishing for `phase` JavaDocs
1 parent 35c7ef1 commit f4809aa

File tree

11 files changed

+69
-56
lines changed

11 files changed

+69
-56
lines changed

spring-integration-core/src/main/java/org/springframework/integration/annotation/Aggregator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@
3333
* @author Oleg Zhurakousky
3434
* @author Artem Bilan
3535
*/
36-
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
36+
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
3737
@Retention(RetentionPolicy.RUNTIME)
3838
@Documented
3939
public @interface Aggregator {
@@ -93,7 +93,7 @@
9393

9494
/**
9595
* Specify a {@link org.springframework.context.SmartLifecycle} {@code phase} option.
96-
* Defaults {@code 0} for {@link org.springframework.integration.endpoint.PollingConsumer}
96+
* Defaults {@code Integer.MAX_VALUE / 2} for {@link org.springframework.integration.endpoint.PollingConsumer}
9797
* and {@code Integer.MIN_VALUE} for {@link org.springframework.integration.endpoint.EventDrivenConsumer}.
9898
* Can be specified as 'property placeholder', e.g. {@code ${foo.phase}}.
9999
* @return the {@code SmartLifecycle} phase.
@@ -106,6 +106,6 @@
106106
* This attribute is an {@code array} just to allow an empty default (no poller).
107107
* Only one {@link Poller} element is allowed.
108108
*/
109-
Poller[] poller() default {};
109+
Poller[] poller() default { };
110110

111111
}

spring-integration-core/src/main/java/org/springframework/integration/annotation/BridgeFrom.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014 the original author or authors.
2+
* Copyright 2014-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
21-
import java.lang.annotation.Inherited;
2221
import java.lang.annotation.Retention;
2322
import java.lang.annotation.RetentionPolicy;
2423
import java.lang.annotation.Target;
@@ -37,13 +36,14 @@
3736
* is used as the {@code outputChannel} of the {@link org.springframework.integration.handler.BridgeHandler}.
3837
*
3938
* @author Artem Bilan
39+
*
4040
* @since 4.0
4141
*/
42-
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
42+
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
4343
@Retention(RetentionPolicy.RUNTIME)
44-
@Inherited
4544
@Documented
4645
public @interface BridgeFrom {
46+
4747
/**
4848
* @return the inbound channel name to receive message for the
4949
* {@link org.springframework.integration.handler.BridgeHandler}
@@ -56,13 +56,21 @@
5656
*/
5757
String autoStartup() default "true";
5858

59-
String phase() default "0";
59+
/**
60+
* Specify a {@link org.springframework.context.SmartLifecycle} {@code phase} option.
61+
* Defaults {@code Integer.MAX_VALUE / 2} for {@link org.springframework.integration.endpoint.PollingConsumer}
62+
* and {@code Integer.MIN_VALUE} for {@link org.springframework.integration.endpoint.EventDrivenConsumer}.
63+
* Can be specified as 'property placeholder', e.g. {@code ${foo.phase}}.
64+
* @return the {@code SmartLifecycle} phase.
65+
*/
66+
String phase() default "";
6067

6168
/**
6269
* @return the {@link Poller} options for a polled endpoint
6370
* ({@link org.springframework.integration.scheduling.PollerMetadata}).
6471
* This attribute is an {@code array} just to allow an empty default (no poller).
6572
* Only one {@link Poller} element is allowed.
6673
*/
67-
Poller[] poller() default {};
74+
Poller[] poller() default { };
75+
6876
}

spring-integration-core/src/main/java/org/springframework/integration/annotation/BridgeTo.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014 the original author or authors.
2+
* Copyright 2014-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
21-
import java.lang.annotation.Inherited;
2221
import java.lang.annotation.Retention;
2322
import java.lang.annotation.RetentionPolicy;
2423
import java.lang.annotation.Target;
@@ -42,13 +41,14 @@
4241
* If no output channel is provided and no reply-channel exists, an exception is thrown.
4342
*
4443
* @author Artem Bilan
44+
*
4545
* @since 4.0
4646
*/
47-
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
47+
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
4848
@Retention(RetentionPolicy.RUNTIME)
49-
@Inherited
5049
@Documented
5150
public @interface BridgeTo {
51+
5252
/**
5353
* @return the outbound channel name to send the message to
5454
* {@link org.springframework.integration.handler.BridgeHandler}.
@@ -63,13 +63,21 @@
6363
*/
6464
String autoStartup() default "true";
6565

66-
String phase() default "0";
66+
/**
67+
* Specify a {@link org.springframework.context.SmartLifecycle} {@code phase} option.
68+
* Defaults {@code Integer.MAX_VALUE / 2} for {@link org.springframework.integration.endpoint.PollingConsumer}
69+
* and {@code Integer.MIN_VALUE} for {@link org.springframework.integration.endpoint.EventDrivenConsumer}.
70+
* Can be specified as 'property placeholder', e.g. {@code ${foo.phase}}.
71+
* @return the {@code SmartLifecycle} phase.
72+
*/
73+
String phase() default "";
6774

6875
/**
6976
* @return the {@link org.springframework.integration.annotation.Poller} options for a polled endpoint
7077
* ({@link org.springframework.integration.scheduling.PollerMetadata}).
7178
* This attribute is an {@code array} just to allow an empty default (no poller).
7279
* Only one {@link org.springframework.integration.annotation.Poller} element is allowed.
7380
*/
74-
Poller[] poller() default {};
81+
Poller[] poller() default { };
82+
7583
}

spring-integration-core/src/main/java/org/springframework/integration/annotation/Filter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@
4040
* @author Artem Bilan
4141
* @since 2.0
4242
*/
43-
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
43+
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
4444
@Retention(RetentionPolicy.RUNTIME)
4545
@Documented
4646
public @interface Filter {
@@ -80,7 +80,7 @@
8080
* Only the handler is advised, not the downstream flow.
8181
* @return the advice chain.
8282
*/
83-
String[] adviceChain() default {};
83+
String[] adviceChain() default { };
8484

8585
/**
8686
* When {@code true} (default) any discard action (and exception thrown) will occur
@@ -115,7 +115,7 @@
115115

116116
/**
117117
* Specify a {@link org.springframework.context.SmartLifecycle} {@code phase} option.
118-
* Defaults {@code 0} for {@link org.springframework.integration.endpoint.PollingConsumer}
118+
* Defaults {@code Integer.MAX_VALUE / 2} for {@link org.springframework.integration.endpoint.PollingConsumer}
119119
* and {@code Integer.MIN_VALUE} for {@link org.springframework.integration.endpoint.EventDrivenConsumer}.
120120
* Can be specified as 'property placeholder', e.g. {@code ${foo.phase}}.
121121
* @return the {@code SmartLifecycle} phase.
@@ -128,6 +128,6 @@
128128
* This attribute is an {@code array} just to allow an empty default (no poller).
129129
* Only one {@link Poller} element is allowed.
130130
*/
131-
Poller[] poller() default {};
131+
Poller[] poller() default { };
132132

133133
}

spring-integration-core/src/main/java/org/springframework/integration/annotation/Gateway.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
21-
import java.lang.annotation.Inherited;
2221
import java.lang.annotation.Retention;
2322
import java.lang.annotation.RetentionPolicy;
2423
import java.lang.annotation.Target;
@@ -59,7 +58,6 @@
5958
*/
6059
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
6160
@Retention(RetentionPolicy.RUNTIME)
62-
@Inherited
6361
@Documented
6462
public @interface Gateway {
6563

spring-integration-core/src/main/java/org/springframework/integration/annotation/InboundChannelAdapter.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2016 the original author or authors.
2+
* Copyright 2014-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
21-
import java.lang.annotation.Inherited;
2221
import java.lang.annotation.Retention;
2322
import java.lang.annotation.RetentionPolicy;
2423
import java.lang.annotation.Target;
@@ -46,11 +45,11 @@
4645
*
4746
* @author Artem Bilan
4847
* @author Gary Russell
48+
*
4949
* @since 4.0
5050
*/
51-
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
51+
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
5252
@Retention(RetentionPolicy.RUNTIME)
53-
@Inherited
5453
@Documented
5554
public @interface InboundChannelAdapter {
5655

@@ -74,7 +73,14 @@
7473
*/
7574
String autoStartup() default "true";
7675

77-
String phase() default "0";
76+
/**
77+
* Specify a {@link org.springframework.context.SmartLifecycle} {@code phase} option.
78+
* Defaults {@code Integer.MAX_VALUE / 2} for {@link org.springframework.integration.endpoint.PollingConsumer}
79+
* and {@code Integer.MIN_VALUE} for {@link org.springframework.integration.endpoint.EventDrivenConsumer}.
80+
* Can be specified as 'property placeholder', e.g. {@code ${foo.phase}}.
81+
* @return the {@code SmartLifecycle} phase.
82+
*/
83+
String phase() default "";
7884

7985
/**
8086
* @return the {@link org.springframework.integration.annotation.Poller} options for a polled endpoint
@@ -83,6 +89,6 @@
8389
* Only one {@link org.springframework.integration.annotation.Poller} element is allowed.
8490
* NOTE: a {@link Poller} here has {@link Poller#maxMessagesPerPoll()} set to 1 by default.
8591
*/
86-
Poller[] poller() default {};
92+
Poller[] poller() default { };
8793

8894
}

spring-integration-core/src/main/java/org/springframework/integration/annotation/Role.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
21-
import java.lang.annotation.Inherited;
2221
import java.lang.annotation.Retention;
2322
import java.lang.annotation.RetentionPolicy;
2423
import java.lang.annotation.Target;
@@ -28,11 +27,11 @@
2827
* a group. See {@code SmartLifecycleRoleController}.
2928
*
3029
* @author Gary Russell
30+
*
3131
* @since 4.2
3232
*/
33-
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
33+
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
3434
@Retention(RetentionPolicy.RUNTIME)
35-
@Inherited
3635
@Documented
3736
public @interface Role {
3837

spring-integration-core/src/main/java/org/springframework/integration/annotation/Router.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
21-
import java.lang.annotation.Inherited;
2221
import java.lang.annotation.Retention;
2322
import java.lang.annotation.RetentionPolicy;
2423
import java.lang.annotation.Target;
@@ -45,9 +44,8 @@
4544
* @author Mark Fisher
4645
* @author Artem Bilan
4746
*/
48-
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
47+
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
4948
@Retention(RetentionPolicy.RUNTIME)
50-
@Inherited
5149
@Documented
5250
public @interface Router {
5351

@@ -71,7 +69,7 @@
7169
* @return the channelMappings.
7270
* @see org.springframework.integration.router.AbstractMappingMessageRouter#setChannelMapping(String, String)
7371
*/
74-
String[] channelMappings() default {};
72+
String[] channelMappings() default { };
7573

7674
/**
7775
* Specify a prefix to be added to each channel name prior to resolution.
@@ -141,7 +139,7 @@
141139

142140
/**
143141
* Specify a {@link org.springframework.context.SmartLifecycle} {@code phase} option.
144-
* Defaults {@code 0} for {@link org.springframework.integration.endpoint.PollingConsumer}
142+
* Defaults {@code Integer.MAX_VALUE / 2} for {@link org.springframework.integration.endpoint.PollingConsumer}
145143
* and {@code Integer.MIN_VALUE} for {@link org.springframework.integration.endpoint.EventDrivenConsumer}.
146144
* Can be specified as 'property placeholder', e.g. {@code ${foo.phase}}.
147145
* @return the {@code SmartLifecycle} phase.
@@ -154,6 +152,6 @@
154152
* This attribute is an {@code array} just to allow an empty default (no poller).
155153
* Only one {@link Poller} element is allowed.
156154
*/
157-
Poller[] poller() default {};
155+
Poller[] poller() default { };
158156

159157
}

spring-integration-core/src/main/java/org/springframework/integration/annotation/ServiceActivator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
21-
import java.lang.annotation.Inherited;
2221
import java.lang.annotation.Retention;
2322
import java.lang.annotation.RetentionPolicy;
2423
import java.lang.annotation.Target;
@@ -45,7 +44,6 @@
4544
*/
4645
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
4746
@Retention(RetentionPolicy.RUNTIME)
48-
@Inherited
4947
@Documented
5048
public @interface ServiceActivator {
5149

@@ -104,7 +102,7 @@
104102

105103
/**
106104
* Specify a {@link org.springframework.context.SmartLifecycle} {@code phase} option.
107-
* Defaults {@code 0} for {@link org.springframework.integration.endpoint.PollingConsumer}
105+
* Defaults {@code Integer.MAX_VALUE / 2} for {@link org.springframework.integration.endpoint.PollingConsumer}
108106
* and {@code Integer.MIN_VALUE} for {@link org.springframework.integration.endpoint.EventDrivenConsumer}.
109107
* Can be specified as 'property placeholder', e.g. {@code ${foo.phase}}.
110108
* @return the {@code SmartLifecycle} phase.

0 commit comments

Comments
 (0)