Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8190111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:30:49+00:00 2026-06-07T03:30:49+00:00

I am using Spring3.1 My application will have kind of bean-manager. That manager will

  • 0

I am using Spring3.1

My application will have kind of bean-manager.

That manager will be able to retrieve request and on each request I need to create new instance of bean dynamically which will be initiate with it’s own unique params.

The params will be retrieved via the request method.

This bean must be alive and work asynchronously. (For example it will listen to jms calls, execute methods by demand and so on..)

Moreover I want to have the option to destroy beans also.

Those bean could be resemble as sessions so when the user log off i will destroy those beans.

I understand that I have to create some kind of bean-list or beans pool and manage it with some kind of manager.

How can I create those beans dynamically and have them remain them alive until I destroy them?

Any idea how could I implement such thing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:30:51+00:00Added an answer on June 7, 2026 at 3:30 am

    Well in this sense, the easiest way would be to create a StaticApplicationContext setting its parent context as the common context (the one holding the beans you want to share over all). This you could reach by doing something like:

    StaticApplicationContext innerContext = new StaticApplicationContext(parentContext);
    

    after this, you probably want to declare the bean you want to instantiate over Spring in order to attach all the AOP stuff, Autowiring and other functionalities, therefore you will need to do something like:

    innerContext.registerSingleton("beanName", beanClass);
    

    After registering you could instantiate the bean like:

    innerContext.getBean(beanClass);
    

    Of course there is the implementation of scope Session for spring and therefore I advise you to check the WebApplicationContext documentation, method loadParentContext that you basically pass the ServletContext as paramenter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing application using a DB called EXAMPLE, which uses a kind-of-old
For work I've been asked to create a web application that will be fairly
I have a Spring MVC application (using 3.0.5 version), and need to bind to
I'm using Spring's form tag library in a Spring MVC application that I am
I'm creating a web application using spring mvc. I have started to incorporate the
I have this web application using Spring Web Flow framework. In my main page
I have a web application using spring annotations extensivley and I have my proguard
I'd like to run my Spring application using STS, but I have no idea
I have a spring web application that is required to work as following the
I have created a java web application using spring. I want the users of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.