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 8444519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:24:43+00:00 2026-06-10T09:24:43+00:00

I am a relatively new Spring user, and i am interested to use this

  • 0

I am a relatively new Spring user, and i am interested to use this framework to load a complex nested configuration.

The following is a pseudo code of my architecture design:

   class **A** implements runnable{
      int x;
      Collection<**B**> clist;         //not fixed size list, 
      run(){
           // if (something happens) 
           //           new Thread(**B**(y,z,w))
      }
   } 

   class **B** implements runnable{
      int y;
      int z;
      int w;
      Array<**C**> bclist;            // fixed size array of C known at init time
      run(){
           process...
      }
   } 

   class **C**{
      int v;
      int l;
   }

i need to be able to configure A.x, B.y , B.z, B.w , B.clist, C.v and C.l

I have a single problem that is relevant to the initialization of B for every new Thread, i don’t know at compile time if clist will stay empty, and only at runtime i will know how many threads will be created. for every new thread i create new B with the same configuration.

(i looked over autowire and prototype features , and i suspect it somehow may help)

EDIT

Here i have xml example file:

            <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
            <beans>
                <bean id="A" class="...">
                    <property name="x" value="150" />
                    <!-- HERE IS MY PROBLEM-->

                    <property name="clist">
                        <list>
                            <ref bean="B" />
                        </list>
                </bean>

                <bean id="B" class="...">
                    <property name="y" value="20" />
                    <property name="z" value="7" />
                    <property name="w" value="7" />
                    <property name="bclist">
                        <list>
                            <ref bean="C" />
                        </list>
                </bean>

                <bean id="C" class="...">
                    <property name="v" value="3" />
                    <property name="l" value="1" />
                </bean>
            </beans>
  • 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-10T09:24:44+00:00Added an answer on June 10, 2026 at 9:24 am

    I have a possible solution to this issue, it may be not optimal.

    in the A bean in the xml i may comment out the setting of the clist (no including it at all in the structure),

    and when i create in java code the B bean , i may use getBean(“B”) every time , while defining the B bean in the xml as prototype.

    Like this :

                <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
                <beans>
                    <bean id="A" class="...">
                        <property name="x" value="150" />
                    </bean>
    
                    <bean id="B" class="..." scope="prototype">
                        <property name="y" value="20" />
                        <property name="z" value="7" />
                        <property name="w" value="7" />
                        <property name="bclist">
                            <list>
                                <ref bean="C" />
                            </list>
                    </bean>
    
                    <bean id="C" class="...">
                        <property name="v" value="3" />
                        <property name="l" value="1" />
                    </bean>
                </beans>
    

    Java code:

      class **A** implements runnable{
        int x;
        Collection<**B**> clist;         //not fixed size list, 
        run(){
           // if (something happens) 
           //           new Thread((B)context.getBean("B"))
        }
      } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Apologies as I'm relatively new to Spring. I have the following code... org.assessme.com.dao.UserDAOImpl.java @Repository
I am relatively new to the Spring Framework and Spring security. I have used
I'm relatively new to X Code and I m working on photo collage App
I am relatively new to Spring and Spring security. I was attempting to write
I'm relatively new to Java, so I hope this isn't a dumb question. I
I'm relatively new to php / mysqli i'm having trouble authenticating the user, I'm
I'm relatively new to Rails, so I've been following Railscasts to get up to
I'm relatively new to programming and am new to this site, please bear with
I'm relatively new to web application programming so I hope this question isn't too
I'm relatively new to this, so sorry if I'm posting in the wrong place.

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.