Details
-
Type:
New Feature
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: Waiting for Triage
-
Component/s: Core:DI
-
Labels:None
-
Last commented by a User:true
Description
I tried this, but including the autowired HttpServletRequest
@Bean @RequestScope static CloseableThreadContext.Instance requestContext( @Value( "${dex.environment}" ) String env, String hostname ) {// spring will close CloseableThreadContext.Instance ctx = CloseableThreadContext.put( "env", env ); ctx.put( "hostname", hostname ); return ctx; }
was thinking that I could simply propagate the context with with it, I then tried adding @Lazy(false) to the definition, but it still didn't instantiate object until I fetched, and called a method on it.
I would like a way to say @Eager on scoped beans (note: this example has @RequestScope but I was also trying to do it with a registered/known working SimpleTransactionScope and SimpleThreadScope
I don't want that to be the default behavior for scoped beans, just an option to create them as soon as scope comes into being.
Attachments
Issue Links
- is related to
-
SPR-17158 Repeatable @Scope
-
- Open
-