Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Prototype bean constructor/factory runtime args

  1. #11
    Join Date
    Oct 2004
    Location
    Herndon, VA, US
    Posts
    648

    Default

    I wonder if perhaps there is some other way better than going under the hood of bean factory? For example, your LocalSessionFactoryBean subclass, say, MySessionFactoryBean could expose an extra property, schemaProvider, which is essentially a proxy interface that knows how to get the schema name at runtime.
    --Jing Xue

  2. #12
    Join Date
    Jan 2005
    Location
    DC Metro Area
    Posts
    18

    Default

    I just added my vote to this. I had a similar idea that is in a different SPR (SPR-695, now marked as closed, with the code in the sandbox). Better to combine votes to get this functionality in Spring ASAP.

  3. #13
    Join Date
    Aug 2004
    Location
    u.s.a
    Posts
    399

    Default

    Quote Originally Posted by manifoldronin
    I wonder if perhaps there is some other way better than going under the hood of bean factory? For example, your LocalSessionFactoryBean subclass, say, MySessionFactoryBean could expose an extra property, schemaProvider, which is essentially a proxy interface that knows how to get the schema name at runtime.
    The approach I give here "Run-Time Dependency Injection": http://forum.springframework.org/showthread.php?t=14679
    would help in this, or may be a starting point for an alternate solution.
    Last edited by robyn; May 14th, 2006 at 11:08 AM.

  4. #14
    Join Date
    Sep 2004
    Location
    Berthoud, CO
    Posts
    13

    Default Having trouble getting to AbstractBeanFactory

    So ultimately I need to / want to use getBean(myObject, MyObject.class, args), but we're using a BeanFactory derived from the ContextSingletonBeanFactoryLocator

    Code:
      protected BeanFactory createBeanFactory(String factoryName) {
        BeanFactoryLocator bfl = ContextSingletonBeanFactoryLocator.getInstance();
        BeanFactoryReference ref =	bfl.useBeanFactory(factoryName);
        return ref.getFactory();
      }
    Given that I only have a BeanFactory and not an instance of ApplicationContext derived from say ClassPathXmlApplicationContext, how can I get a handle to the AbstractBeanFactory?

    Thanks
    .rob.park.

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  5. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •