Last active
August 27, 2023 13:31
-
-
Save couragecowardlydog/1facd357b699794c7fc7800eb8e5a53b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
@Scope(value = "prototype") | |
public class UserContextHolder extends ContextHolder { | |
} | |
@Component | |
@AllArgsConstructor | |
public class ReportGenerator { | |
@Autowired | |
@Qualifier("userContextHolder") | |
private ContextHolder contextHolder; | |
public void run(IReport report) { | |
// some code that is dependent on contextHolder | |
report.generate(...args); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment