Java 19552 Move articles from spring-core-* module to spring-di-4 module (#13814)
* JAVA-19552 Move articles from spring-core module to spring-di-4 module * JAVA-19552 Minor Correction
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
package com.baeldung.sampleabstract;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
public abstract class BallService {
|
||||
|
||||
private RuleRepository ruleRepository;
|
||||
|
||||
private LogRepository logRepository;
|
||||
|
||||
public BallService(RuleRepository ruleRepository) {
|
||||
this.ruleRepository = ruleRepository;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public final void setLogRepository(LogRepository logRepository) {
|
||||
this.logRepository = logRepository;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void afterInitialize() {
|
||||
|
||||
System.out.println(ruleRepository.toString());
|
||||
System.out.println(logRepository.toString());
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.baeldung.sampleabstract;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class BasketballService extends BallService {
|
||||
|
||||
@Autowired
|
||||
public BasketballService(RuleRepository ruleRepository) {
|
||||
super(ruleRepository);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.baeldung.sampleabstract;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan(basePackages = "com.baeldung.sampleabstract")
|
||||
public class DemoApp {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(DemoApp.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.baeldung.sampleabstract;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class LogRepository {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "logRepository";
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.baeldung.sampleabstract;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class RuleRepository {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ruleRepository";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user