Skip to content

Commit 0db9b2b

Browse files
committed
Change constructor
1 parent 9bbcd7a commit 0db9b2b

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

spar-wings-sns-notification/src/main/java/jp/xet/sparwings/aws/sns/NotificationService.java

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.Locale;
2323
import java.util.Map;
2424

25+
import lombok.RequiredArgsConstructor;
2526
import org.springframework.beans.factory.InitializingBean;
2627
import org.springframework.beans.factory.annotation.Autowired;
2728
import org.springframework.beans.factory.annotation.Value;
@@ -45,6 +46,7 @@
4546
* @since 0.3
4647
* @author daisuke
4748
*/
49+
@RequiredArgsConstructor
4850
public class NotificationService implements InitializingBean {
4951

5052
private static Logger logger = LoggerFactory.getLogger(NotificationService.class);
@@ -67,10 +69,11 @@ private static String toString(Throwable t) {
6769
}
6870

6971

72+
private final AmazonSNS sns;
73+
7074
private final String appCodeName;
7175

72-
@Autowired
73-
AmazonSNS sns;
76+
private final EnvironmentService env;
7477

7578
@Autowired(required = false)
7679
InstanceInfo instanceInfo;
@@ -79,9 +82,6 @@ private static String toString(Throwable t) {
7982
@Autowired(required = false)
8083
jp.xet.sparwings.aws.ec2.InstanceMetadata instanceMetadata;
8184

82-
@Autowired
83-
EnvironmentService env;
84-
8585
@Value("#{systemEnvironment['CFN_STACK_NAME'] ?: systemProperties['CFN_STACK_NAME']}")
8686
String stackName;
8787

@@ -92,16 +92,6 @@ private static String toString(Throwable t) {
9292
String opsTopicArn;
9393

9494

95-
/**
96-
* インスタンスを生成する。
97-
*
98-
* @param appCodeName Application code name
99-
* @since 0.3
100-
*/
101-
public NotificationService(String appCodeName) {
102-
this.appCodeName = appCodeName;
103-
}
104-
10595
@Override
10696
public void afterPropertiesSet() {
10797
logger.info("Initialize devTopicArn = {}", devTopicArn);

0 commit comments

Comments
 (0)