Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scoped data container [SPR-16971] #21509

Open
spring-projects-issues opened this issue Jun 24, 2018 · 0 comments
Open

Scoped data container [SPR-16971] #21509

spring-projects-issues opened this issue Jun 24, 2018 · 0 comments
Labels
in: core status: waiting-for-triage

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jun 24, 2018

László Stahorszki opened SPR-16971 and commented

My suggestion would be some kind of a generic data container, whose scope can be parameterized. There could be some annotation, let's say

@ScopedContainer(scope = "some_scope")

that can be applied to fields, or setter methods.

A typical use-case would be, when I want to store some data in a bean of scope singleton, but I need the data List to be session scoped. I could then write a code:

@Component
public class MySingletonBean {

    @ScopedContainer(scope="session")
    private List<String> dataForSession;

    public List<String> getStrings() {
        return dataForSession;
    }
    ...
}

A work around for this feature is creating a generic bean for every scope and using proxy to inject, but I think we could all at some point make use of some feature like this.


No further details from SPR-16971

@spring-projects-issues spring-projects-issues added status: waiting-for-triage type: enhancement in: core and removed type: enhancement labels Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: waiting-for-triage
Projects
None yet
Development

No branches or pull requests

1 participant