Announcement Announcement Module
Collapse
No announcement yet.
How to get one Spring Bean configuration to return two different objects Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get one Spring Bean configuration to return two different objects

    I'm working on an internal tool where users will be able to configure two pieces of information with one spring entry.

    For example, i looked at implementing FactoryBean and have it return a Foo object. The Factorybean takes a one arg constructor that is a name (which isn't really related to the Foo Object)

    I can easily access the Foo object via something like:

    Code:
    @Resource(name="factory")
    private Foo object
    I can't, however, get access to the name without wiring up the factory bean itself.

    Is there a technique in spring i can use? I basically don't want to burden clients with having to include a bunch of spring beans to work with the API. They just configure the one master bean and they'll have access to the name, the Foo object created by the Factory, and anything else similar that comes along.

    Thanks
Working...
X