The life cycle and visibility of Spring Bean.
singleton prototype request session application websocket
The last four scopes mentioned, request, session, application and websocket, are only available in a web-aware application.
@Bean@Scope("singleton")publicPersonpersonSingleton(){ return new Person(); } @Service @Scope("prototype") public class SpecificationParserClickHouse implements SpecificationParser { @Resource FieldFeatureBuilder fieldFeatureBuilder; ListspecList; IQuerySpecification spec =null; ... }