Why doesn't spring provide an implementation of a flow region?

Why doesn't Spring provide a stream scope implementation? Has anyone used a beans tagged area with Spring in a web application context? There should be a standard, clear description of how to do this! (SpringByExample has a solution: I have not tested it, but it is not core yet.)

+4
source share
3 answers

Spring provides a stream scope, but it is not registered by default.

Existing bean areas are defined in the documentation here .

single point

  • (default) Defines one bean definition for an instance of a single object in a Spring IoC container.

prototype

  • bean .

  • bean HTTP-; HTTP- bean, bean. - Spring ApplicationContext.

  • bean HTTP. - Spring ApplicationContext.

  • bean ServletContext. - Spring ApplicationContext.

WebSocket

  • bean WebSocket. - Spring ApplicationContext.

Spring 3.0, , . . SimpleThreadScope.

, , ,

[SimpleThreadScope] .

ThreadLocal beans. /dying Thread Java, IOC Spring , beans ThreadLocal . .

, . , , bean . .

+8
+6

- , , . bean , , , .

Keep in mind that threads can be combined on servers, and this is probably the reason why on Spring

no flow area

Take a look at the request area: http://docs.spring.io/spring/docs/3.0.0.M3/reference/html/ch04s04.html

+2
source

Source: https://habr.com/ru/post/1525214/


All Articles